Skip to content

Commit 47c5182

Browse files
authored
wasmtime: fix build on Linux/aarch64. (#228)
Signed-off-by: Piotr Sikora <[email protected]>
1 parent 18e8d38 commit 47c5182

File tree

3 files changed

+52
-28
lines changed

3 files changed

+52
-28
lines changed

.github/workflows/cpp.yml

Lines changed: 46 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -58,36 +58,48 @@ jobs:
5858
addlicense -check .
5959
6060
build:
61-
name: build (${{ matrix.name }})
61+
name: ${{ matrix.action }} with ${{ matrix.name }}
6262

6363
runs-on: ${{ matrix.os }}
6464

6565
strategy:
6666
fail-fast: false
6767
matrix:
6868
include:
69-
- name: 'V8 on Linux'
69+
- name: 'V8 on Linux/x86_64'
7070
runtime: 'v8'
7171
os: ubuntu-20.04
72+
action: test
7273
flags: '--define crypto=system'
73-
- name: 'V8 on macOS'
74+
- name: 'V8 on macOS/x86_64'
7475
runtime: 'v8'
7576
os: macos-11
76-
- name: 'WAMR on Linux'
77+
action: test
78+
- name: 'WAMR on Linux/x86_64'
7779
runtime: 'wamr'
7880
os: ubuntu-20.04
79-
- name: 'WAMR on macOS'
81+
action: test
82+
- name: 'WAMR on macOS/x86_64'
8083
runtime: 'wamr'
8184
os: macos-11
82-
- name: 'Wasmtime on Linux'
85+
action: test
86+
- name: 'Wasmtime on Linux/x86_64'
8387
runtime: 'wasmtime'
8488
os: ubuntu-20.04
85-
- name: 'Wasmtime on macOS'
89+
action: test
90+
- name: 'Wasmtime on Linux/aarch64'
91+
runtime: 'wasmtime'
92+
os: ubuntu-20.04
93+
action: build
94+
run_under: docker run --rm --env HOME=$HOME --env USER=$(id -un) --volume "$HOME:$HOME" --workdir $(pwd) --user $(id -u):$(id -g) --platform linux/arm64 piotrsikora/build-tools:bazel-4.2.2-clang-13-gcc-11
95+
- name: 'Wasmtime on macOS/x86_64'
8696
runtime: 'wasmtime'
8797
os: macos-11
88-
- name: 'WAVM on Linux'
98+
action: test
99+
- name: 'WAVM on Linux/x86_64'
89100
runtime: 'wavm'
90101
os: ubuntu-20.04
102+
action: test
91103

92104
steps:
93105
- uses: actions/checkout@v2
@@ -100,36 +112,42 @@ jobs:
100112
if: startsWith(matrix.os, 'macos')
101113
run: brew install ninja
102114

115+
- name: Activate Docker/QEMU
116+
if: startsWith(matrix.run_under, 'docker')
117+
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
118+
103119
- name: Bazel cache
104-
if: matrix.runtime != 'wasmtime'
120+
if: ${{ matrix.runtime != 'wasmtime' || startsWith(matrix.run_under, 'docker') }}
105121
uses: actions/cache@v2
106122
with:
107123
path: |
108124
~/.cache/bazel
109125
/private/var/tmp/_bazel_runner/
110126
key: bazel-${{ matrix.os }}-${{ matrix.runtime }}-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.raze.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }}
111127

112-
- name: Test
113-
run: |
114-
bazel test \
115-
--verbose_failures \
116-
--test_output=errors \
117-
--define runtime=${{ matrix.runtime }} \
118-
${{ matrix.flags }} \
119-
//test/...
120-
121-
- name: Test (signed Wasm module)
122-
run: |
123-
bazel test \
124-
--verbose_failures \
125-
--test_output=errors \
126-
--define runtime=${{ matrix.runtime }} \
127-
${{ matrix.flags }} \
128-
--per_file_copt=src/signature_util.cc,test/signature_util_test.cc@-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -b9-)\" \
129-
//test:signature_util_test
128+
- name: Bazel build/test
129+
run: >
130+
${{ matrix.run_under }}
131+
bazel ${{ matrix.action }}
132+
--verbose_failures
133+
--test_output=errors
134+
--define runtime=${{ matrix.runtime }}
135+
${{ matrix.flags }}
136+
//test/...
137+
138+
- name: Bazel build/test (signed Wasm module)
139+
run: >
140+
${{ matrix.run_under }}
141+
bazel ${{ matrix.action }}
142+
--verbose_failures
143+
--test_output=errors
144+
--define runtime=${{ matrix.runtime }}
145+
${{ matrix.flags }}
146+
--per_file_copt=src/signature_util.cc,test/signature_util_test.cc@-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -b9-)\"
147+
//test:signature_util_test
130148
131149
- name: Cleanup Bazel cache
132-
if: matrix.runtime != 'wasmtime'
150+
if: ${{ matrix.runtime != 'wasmtime' || startsWith(matrix.run_under, 'docker') }}
133151
run: |
134152
export OUTPUT=$(bazel info output_base)
135153
# BoringSSL's test data (90 MiB).

bazel/cargo/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,8 @@ additional_flags = [
3131
buildrs_additional_deps = [
3232
"@proxy_wasm_cpp_host__cc__1_0_72//:cc",
3333
]
34+
35+
[package.metadata.raze.crates.wasmtime-jit.'*']
36+
additional_deps = [
37+
"@proxy_wasm_cpp_host__rustix__0_31_3//:rustix",
38+
]

bazel/cargo/remote/BUILD.wasmtime-jit-0.33.0.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ rust_library(
5959
"@proxy_wasm_cpp_host__gimli__0_26_1//:gimli",
6060
"@proxy_wasm_cpp_host__object__0_27_1//:object",
6161
"@proxy_wasm_cpp_host__region__2_2_0//:region",
62+
"@proxy_wasm_cpp_host__rustix__0_31_3//:rustix",
6263
"@proxy_wasm_cpp_host__serde__1_0_133//:serde",
6364
"@proxy_wasm_cpp_host__target_lexicon__0_12_2//:target_lexicon",
6465
"@proxy_wasm_cpp_host__thiserror__1_0_30//:thiserror",

0 commit comments

Comments
 (0)