From a5b62f799b4113c5dc072ded3e0a2e3b08e01065 Mon Sep 17 00:00:00 2001 From: Loong Date: Sun, 10 Dec 2023 22:49:27 +0800 Subject: [PATCH] fix: fix cross compilation --- .github/actions/setup/action.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index b39d928a..f2fee119 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -7,10 +7,6 @@ inputs: arch: description: 'Target architecture' required: true - cross: - description: 'Whether to install cross' - required: false - default: ${{ arch != 'x86_64' }} coverage: description: 'Whether to install cargo-tarpaulin' required: false @@ -41,11 +37,11 @@ runs: esac echo "CARGO_BUILD_TARGET=$target" >> $GITHUB_ENV - name: Install Target - if: fromJson(inputs.cross) + if: inputs.arch != 'x86_64' shell: bash run: rustup target add $CARGO_BUILD_TARGET - name: Setup Cross Compiling Toolchain (Linux x86_64 to aarch64) - if: fromJson(inputs.cross) && inputs.arch == 'aarch64' && startsWith(inputs.os, 'ubuntu') + if: inputs.arch == 'aarch64' && startsWith(inputs.os, 'ubuntu') shell: bash run: | sudo apt-get update @@ -57,11 +53,12 @@ runs: echo "CFLAGS_aarch64_unknown_linux_gnu=--sysroot=/usr/aarch64-linux-gnu" >> $GITHUB_ENV echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV - name: Setup Cross Compiling Toolchain (macOS x86_64 to aarch64) - if: fromJson(inputs.cross) && inputs.arch == 'aarch64' && startsWith(inputs.os, 'macos') + if: inputs.arch == 'aarch64' && startsWith(inputs.os, 'macos') shell: bash run: | which cc cc --version + echo "CC_aarch64_apple_darwin=(brew --prefix llvm@15)/bin/clang" >> $GITHUB_ENV - name: Install Cargo tarpaulin if: fromJson(inputs.coverage) uses: taiki-e/install-action@v2