Skip to content

Commit e293456

Browse files
author
Shawn Rader
committed
Add aarch64 Linux build, test, and publish to CI
- 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
1 parent a6558cb commit e293456

File tree

2 files changed

+40
-6
lines changed

2 files changed

+40
-6
lines changed

.circleci/config.yml

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,25 @@ jobs:
3030
- run:
3131
command: make go-lint
3232

33+
build_and_test_aarch64_linux_cgo_bindings:
34+
parameters:
35+
run_leak_detector:
36+
type: boolean
37+
default: true
38+
machine:
39+
image: ubuntu-2004:current
40+
resource_class: arm.large
41+
working_directory: ~/go/src/github.com/filecoin-project/filecoin-ffi
42+
steps:
43+
- configure_environment_variables
44+
- prepare
45+
- build_project
46+
- restore_parameter_cache
47+
- obtain_filecoin_parameters
48+
- save_parameter_cache
49+
- run: cd rust && rustup target add wasm32-unknown-unknown
50+
- run_tests
51+
3352
build_and_test_linux_cgo_bindings:
3453
parameters:
3554
run_leak_detector:
@@ -68,12 +87,20 @@ jobs:
6887
- run: cd rust && cargo install cargo-lipo
6988
- build_project
7089
- compile_tests
71-
publish_linux_staticlib:
90+
publish_linux_x86_64_staticlib:
7291
executor: golang
7392
steps:
7493
- configure_environment_variables
7594
- prepare
7695
- publish_release
96+
publish_linux_aarch64_staticlib:
97+
machine:
98+
image: ubuntu-2004:current
99+
resource_class: arm.large
100+
steps:
101+
- configure_environment_variables
102+
- prepare
103+
- publish_release
77104
publish_darwin_staticlib:
78105
macos:
79106
xcode: "12.5.1"
@@ -167,7 +194,9 @@ workflows:
167194
- go_lint
168195
- build_and_test_linux_cgo_bindings:
169196
run_leak_detector: false
170-
- publish_linux_staticlib
197+
- build_and_test_aarch64_linux_cgo_bindings
198+
- publish_linux_x86_64_staticlib
199+
- publish_linux_aarch64_staticlib
171200
- build_darwin_cgo_bindings
172201
- publish_darwin_staticlib
173202

@@ -221,8 +250,8 @@ commands:
221250
command: |
222251
cd rust
223252
224-
TARBALL_PATH="/tmp/${CIRCLE_PROJECT_REPONAME}-$(uname)-standard.tar.gz"
225-
RELEASE_NAME="${CIRCLE_PROJECT_REPONAME}-$(uname)-standard"
253+
TARBALL_PATH="/tmp/${CIRCLE_PROJECT_REPONAME}-$(uname)-$(uname -m)-standard.tar.gz"
254+
RELEASE_NAME="${CIRCLE_PROJECT_REPONAME}-$(uname)-$(uname -m)-standard"
226255
227256
# Note: the blst dependency uses the portable configuration for maximum compatibility
228257
./scripts/build-release.sh filcrypto $(cat ./rust-toolchain) build --verbose --no-default-features --features multicore-sdr,opencl,blst-portable
@@ -233,7 +262,7 @@ commands:
233262
command: |
234263
cd rust
235264
236-
TARBALL_PATH="/tmp/${CIRCLE_PROJECT_REPONAME}-$(uname)-optimized.tar.gz"
265+
TARBALL_PATH="/tmp/${CIRCLE_PROJECT_REPONAME}-$(uname)-$(uname -m)-optimized.tar.gz"
237266
RUSTFLAGS="-C target-feature=$(cat rustc-target-features-optimized.json | jq -r '.[].rustc_target_feature' | tr '\n' ',')"
238267
239268
./scripts/build-release.sh filcrypto $(cat ./rust-toolchain) build --verbose --no-default-features --features multicore-sdr,opencl

install-filcrypto

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,12 @@ download_release_tarball() {
9292
# names are constructed. Marginally less-bad would be to require that this
9393
# function's caller provide the release name.
9494
#
95-
local __release_name="${__repo_name}-$(uname)-${release_flag_name}"
95+
if [ "$(uname -s)" = "Darwin" ]; then
96+
# For MacOS a universal library is used so naming convention is different
97+
local __release_name="${__repo_name}-$(uname)-${release_flag_name}"
98+
else
99+
local __release_name="${__repo_name}-$(uname)-$(uname -m)-${release_flag_name}"
100+
fi
96101

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

0 commit comments

Comments
 (0)