Skip to content

Commit

Permalink
Add aarch64 Linux build, test, and publish to CI
Browse files Browse the repository at this point in the history
 - Rename circleci artifact tarbal names to differentiate x86_64 and aarch64

 - Add circleci build, test, and publish for aarch64

 - Add arch to tarball name in install-filcrypto

 - update install-filcrypto script to differentiate Linux x86_64 and aarch64

 - Run unit tests on Linux aarch64
  • Loading branch information
Shawn Rader authored and Stebalien committed Mar 30, 2023
1 parent 54d9976 commit 7f66133
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 7 deletions.
47 changes: 41 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,25 @@ jobs:
- run:
command: make go-lint

build_and_test_aarch64_linux_cgo_bindings:
parameters:
run_leak_detector:
type: boolean
default: true
machine:
image: ubuntu-2004:current
resource_class: arm.large
working_directory: ~/go/src/github.com/filecoin-project/filecoin-ffi
steps:
- configure_environment_variables
- prepare
- build_project
- restore_parameter_cache
- obtain_filecoin_parameters
- save_parameter_cache
- run: cd rust && rustup target add wasm32-unknown-unknown
- run_tests

build_and_test_linux_cgo_bindings:
parameters:
run_leak_detector:
Expand Down Expand Up @@ -68,12 +87,20 @@ jobs:
- run: cd rust && cargo install cargo-lipo
- build_project
- compile_tests
publish_linux_staticlib:
publish_linux_x86_64_staticlib:
executor: golang
steps:
- configure_environment_variables
- prepare
- publish_release
publish_linux_aarch64_staticlib:
machine:
image: ubuntu-2004:current
resource_class: arm.large
steps:
- configure_environment_variables
- prepare
- publish_release
publish_darwin_staticlib:
macos:
xcode: "12.5.1"
Expand Down Expand Up @@ -167,13 +194,21 @@ workflows:
- go_lint
- build_and_test_linux_cgo_bindings:
run_leak_detector: false
- publish_linux_staticlib:
- build_and_test_aarch64_linux_cgo_bindings
run_leak_detector: false
- build_darwin_cgo_bindings
- publish_linux_x86_64_staticlib
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- publish_linux_aarch64_staticlib
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- build_darwin_cgo_bindings
- publish_darwin_staticlib:
filters:
tags:
Expand Down Expand Up @@ -231,8 +266,8 @@ commands:
command: |
cd rust
TARBALL_PATH="/tmp/${CIRCLE_PROJECT_REPONAME}-$(uname)-standard.tar.gz"
RELEASE_NAME="${CIRCLE_PROJECT_REPONAME}-$(uname)-standard"
TARBALL_PATH="/tmp/${CIRCLE_PROJECT_REPONAME}-$(uname)-$(uname -m)-standard.tar.gz"
RELEASE_NAME="${CIRCLE_PROJECT_REPONAME}-$(uname)-$(uname -m)-standard"
# Note: the blst dependency uses the portable configuration for maximum compatibility
./scripts/build-release.sh filcrypto $(cat ./rust-toolchain) build --verbose --no-default-features --features multicore-sdr,opencl,blst-portable
Expand All @@ -243,7 +278,7 @@ commands:
command: |
cd rust
TARBALL_PATH="/tmp/${CIRCLE_PROJECT_REPONAME}-$(uname)-optimized.tar.gz"
TARBALL_PATH="/tmp/${CIRCLE_PROJECT_REPONAME}-$(uname)-$(uname -m)-optimized.tar.gz"
RUSTFLAGS="-C target-feature=$(cat rustc-target-features-optimized.json | jq -r '.[].rustc_target_feature' | tr '\n' ',')"
./scripts/build-release.sh filcrypto $(cat ./rust-toolchain) build --verbose --no-default-features --features multicore-sdr,opencl
Expand Down
7 changes: 6 additions & 1 deletion install-filcrypto
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ download_release_tarball() {
# names are constructed. Marginally less-bad would be to require that this
# function's caller provide the release name.
#
local __release_name="${__repo_name}-$(uname)-${release_flag_name}"
if [ "$(uname -s)" = "Darwin" ]; then
# For MacOS a universal library is used so naming convention is different
local __release_name="${__repo_name}-$(uname)-${release_flag_name}"
else
local __release_name="${__repo_name}-$(uname)-$(uname -m)-${release_flag_name}"
fi

(>&2 echo "[download_release_tarball] acquiring release @ ${__release_tag}")

Expand Down

0 comments on commit 7f66133

Please sign in to comment.