From 7f71667924c6c9fbc24e40b271a2a844b45a0fd9 Mon Sep 17 00:00:00 2001 From: William Villeneuve Date: Sat, 26 Oct 2024 13:26:37 -0400 Subject: [PATCH] linux-arm: build --- .cargo/config.toml | 3 +++ .github/workflows/build.yml | 36 ++++++++++++++++++++++++------------ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index ed629ee..bf93244 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -8,3 +8,6 @@ rustflags = [ "-L", "-Wl,--copy-dt-needed-entries", ] + +[target.aarch64-unknown-linux-musl] +linker = "aarch64-linux-gnu-gcc" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40aff8f..fae9b21 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,24 +1,29 @@ name: build on: push: - tags: - - v* + # TODO: debug + # tags: + # - v* jobs: build: name: Build strategy: matrix: build: - - target: x86_64-apple-darwin - os: macos-latest - - target: aarch64-apple-darwin - os: macos-latest - - target: x86_64-unknown-linux-musl + # TODO: + # - target: x86_64-apple-darwin + # os: macos-latest + # - target: aarch64-apple-darwin + # os: macos-latest + # - target: x86_64-unknown-linux-musl + # os: ubuntu-latest + - target: aarch64-unknown-linux-musl os: ubuntu-latest - - target: x86_64-pc-windows-msvc - os: windows-latest - - target: aarch64-pc-windows-msvc - os: windows-latest + # TODO: + # - target: x86_64-pc-windows-msvc + # os: windows-latest + # - target: aarch64-pc-windows-msvc + # os: windows-latest runs-on: ${{ matrix.build.os }} steps: - uses: actions/checkout@v4 @@ -27,6 +32,9 @@ jobs: - name: Setup musl run: sudo apt-get install -y musl-tools if: endsWith(matrix.build.target, '-musl') + - name: Setup aarch64 linux + run: sudo apt-get install -y gcc-aarch64-linux-gnu + if: matrix.build.target == 'aarch64-unknown-linux-musl' - name: Setup windows run: | # setup perl for bash shell https://github.com/sfackler/rust-openssl/issues/2149#issuecomment-2014064057 @@ -47,7 +55,11 @@ jobs: --target "$TARGET" \ --message-format=json \ | jq -r '.message.rendered // .executable // empty' - )" + )" || { + declare exit_code="$?" + echo "$output" + exit "$exit_code" + } { echo 'ARTIFACT_PATHS<