From b2e14b863e4071145bd11d202cbc7a8c509b9608 Mon Sep 17 00:00:00 2001 From: Francisco Melo <43780565+francis2tm@users.noreply.github.com> Date: Mon, 5 Feb 2024 20:43:45 +0000 Subject: [PATCH] Feat/build aarch64 (#18) * feat: build for aarch64 --- .github/workflows/build.yml | 24 +++++++++++++++++------- Cargo.lock | 13 ++++++------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f9d1702..b6cec41 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,9 @@ name: "build" on: push: - branches: [ "*" ] + branches: ["main"] pull_request: - branches: [ "*" ] + branches: ["main"] # This is the example from the readme. # On each push to the `main` branch it will create or update a GitHub build, build your app, and upload the artifacts to the build. @@ -15,9 +15,15 @@ jobs: strategy: fail-fast: false matrix: - platform: [ macos-latest, ubuntu-20.04, windows-latest ] + include: + - os: macos-latest + target: aarch64-apple-darwin + - os: macos-latest + target: x86_64-apple-darwin + - os: ubuntu-20.04 + - os: windows-latest - runs-on: ${{ matrix.platform }} + runs-on: ${{ matrix.os }} steps: - name: "Setup actions/checkout" uses: actions/checkout@v4 @@ -25,6 +31,9 @@ jobs: - name: "Setup rust" uses: actions-rust-lang/setup-rust-toolchain@v1 + - if: matrix.target + run: rustup target add ${{ matrix.target }} + - name: Install Node.js uses: actions/setup-node@v3 with: @@ -38,14 +47,14 @@ jobs: # setup dependencies - name: install dependencies (ubuntu only) - if: matrix.platform == 'ubuntu-20.04' + if: matrix.os == 'ubuntu-20.04' run: | sudo apt-get update sudo apt-get install -y build-essential curl wget file libssl-dev libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev patchelf - # install llvm (for llvm-copy) on macos only + # install llvm (for llvm-copy) on macos only. For cpp runtimes. - name: Install LLVM - if: matrix.platform == 'macos-latest' + if: matrix.os == 'macos-latest' run: | brew update brew install llvm@17 @@ -67,3 +76,4 @@ jobs: releaseDraft: true prerelease: false projectPath: ./edgen + args: ${{ matrix.target && format('--target {0}', matrix.target) }} diff --git a/Cargo.lock b/Cargo.lock index ec1b6fe..a86e510 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2165,9 +2165,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" [[package]] name = "hex" @@ -2791,7 +2791,7 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "llama_cpp" version = "0.3.0" -source = "git+https://github.com/edgenai/llama_cpp-rs?branch=main#f4f56beac06c6e35993b1ca94a28dc3786409bda" +source = "git+https://github.com/edgenai/llama_cpp-rs?branch=main#bc38e77dae3f9bb91f3053a53f45d29c20628d84" dependencies = [ "ctor", "derive_more", @@ -2806,7 +2806,7 @@ dependencies = [ [[package]] name = "llama_cpp_sys" version = "0.3.0" -source = "git+https://github.com/edgenai/llama_cpp-rs?branch=main#f4f56beac06c6e35993b1ca94a28dc3786409bda" +source = "git+https://github.com/edgenai/llama_cpp-rs?branch=main#bc38e77dae3f9bb91f3053a53f45d29c20628d84" dependencies = [ "bindgen", "cc", @@ -5140,13 +5140,12 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", "fastrand 2.0.1", - "redox_syscall", "rustix", "windows-sys 0.52.0", ]