Skip to content

Commit

Permalink
ci: build arm64 linux nightlies (#694)
Browse files Browse the repository at this point in the history
* ci: build arm64 linux nightlies

* fix: disable solc autodetection on arm

* fix: add autodetect warning on arm devices

Forge will output a warning on ARM devices stating that
autodetection is disabled, unless autodetection is explicitly
disabled by the user to silence the warning.

* ci: install `gcc-aarch64-linux-gnu` for arm builds
  • Loading branch information
onbjerg authored Feb 8, 2022
1 parent d456eb2 commit 2834702
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,15 @@ jobs:
# The OS is used for the runner
# The platform is a generic platform name
# The target is used by Cargo
# The arch is either 386 or amd64
# The arch is either 386, arm64 or amd64
- os: ubuntu-latest
platform: linux
target: x86_64-unknown-linux-gnu
arch: amd64
- os: ubuntu-latest
platform: linux
target: aarch64-unknown-linux-gnu
arch: arm64
- os: macos-latest
platform: darwin
target: x86_64-apple-darwin
Expand Down Expand Up @@ -112,6 +116,12 @@ jobs:
echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV
- name: Linux ARM setup
if: ${{ matrix.job.target == 'aarch64-unknown-linux-gnu' }}
run: |
sudo apt-get update -y
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Build binaries
env:
RUSTFLAGS: -C link-args=-s
Expand Down
11 changes: 11 additions & 0 deletions cli/src/cmd/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,21 @@ impl Provider for BuildArgs {
dict.insert("libs".to_string(), libs.into());
}

#[cfg(not(target_arch = "aarch64"))]
if self.no_auto_detect {
dict.insert("auto_detect_solc".to_string(), false.into());
}

#[cfg(target_arch = "aarch64")]
{
if !self.no_auto_detect {
println!("Solidity compiler autodetection is disabled on ARM.");
println!("You can track progress on ARM support in https://github.com/gakonst/foundry/issues/525");
println!("To silence this warning use --no-auto-detect");
}
dict.insert("auto_detect_solc".to_string(), false.into());
}

if self.force {
dict.insert("force".to_string(), self.force.into());
}
Expand Down

0 comments on commit 2834702

Please sign in to comment.