Skip to content

Commit

Permalink
fix: fix cross compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
wangl-cc committed Dec 10, 2023
1 parent a59fc92 commit a5b62f7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a5b62f7

Please sign in to comment.