Skip to content

Commit 6cfb93d

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 6cfb93d

File tree

2 files changed

+41
-6
lines changed

2 files changed

+41
-6
lines changed

.circleci/config.yml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,26 @@ 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+
run_leak_detector: << parameters.run_leak_detector >>
52+
3353
build_and_test_linux_cgo_bindings:
3454
parameters:
3555
run_leak_detector:
@@ -68,12 +88,20 @@ jobs:
6888
- run: cd rust && cargo install cargo-lipo
6989
- build_project
7090
- compile_tests
71-
publish_linux_staticlib:
91+
publish_linux_x86_64_staticlib:
7292
executor: golang
7393
steps:
7494
- configure_environment_variables
7595
- prepare
7696
- publish_release
97+
publish_linux_aarch64_staticlib:
98+
machine:
99+
image: ubuntu-2004:current
100+
resource_class: arm.large
101+
steps:
102+
- configure_environment_variables
103+
- prepare
104+
- publish_release
77105
publish_darwin_staticlib:
78106
macos:
79107
xcode: "12.5.1"
@@ -167,7 +195,9 @@ workflows:
167195
- go_lint
168196
- build_and_test_linux_cgo_bindings:
169197
run_leak_detector: false
170-
- publish_linux_staticlib
198+
- build_and_test_aarch64_linux_cgo_bindings
199+
- publish_linux_x86_64_staticlib
200+
- publish_linux_aarch64_staticlib
171201
- build_darwin_cgo_bindings
172202
- publish_darwin_staticlib
173203

@@ -221,8 +251,8 @@ commands:
221251
command: |
222252
cd rust
223253
224-
TARBALL_PATH="/tmp/${CIRCLE_PROJECT_REPONAME}-$(uname)-standard.tar.gz"
225-
RELEASE_NAME="${CIRCLE_PROJECT_REPONAME}-$(uname)-standard"
254+
TARBALL_PATH="/tmp/${CIRCLE_PROJECT_REPONAME}-$(uname)-$(uname -m)-standard.tar.gz"
255+
RELEASE_NAME="${CIRCLE_PROJECT_REPONAME}-$(uname)-$(uname -m)-standard"
226256
227257
# Note: the blst dependency uses the portable configuration for maximum compatibility
228258
./scripts/build-release.sh filcrypto $(cat ./rust-toolchain) build --verbose --no-default-features --features multicore-sdr,opencl,blst-portable
@@ -233,7 +263,7 @@ commands:
233263
command: |
234264
cd rust
235265
236-
TARBALL_PATH="/tmp/${CIRCLE_PROJECT_REPONAME}-$(uname)-optimized.tar.gz"
266+
TARBALL_PATH="/tmp/${CIRCLE_PROJECT_REPONAME}-$(uname)-$(uname -m)-optimized.tar.gz"
237267
RUSTFLAGS="-C target-feature=$(cat rustc-target-features-optimized.json | jq -r '.[].rustc_target_feature' | tr '\n' ',')"
238268
239269
./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)