Skip to content

wasmtime: fix build on Linux/aarch64. #228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 46 additions & 28 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,36 +58,48 @@ jobs:
addlicense -check .

build:
name: build (${{ matrix.name }})
name: ${{ matrix.action }} with ${{ matrix.name }}

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

strategy:
fail-fast: false
matrix:
include:
- name: 'V8 on Linux'
- name: 'V8 on Linux/x86_64'
runtime: 'v8'
os: ubuntu-20.04
action: test
flags: '--define crypto=system'
- name: 'V8 on macOS'
- name: 'V8 on macOS/x86_64'
runtime: 'v8'
os: macos-11
- name: 'WAMR on Linux'
action: test
- name: 'WAMR on Linux/x86_64'
runtime: 'wamr'
os: ubuntu-20.04
- name: 'WAMR on macOS'
action: test
- name: 'WAMR on macOS/x86_64'
runtime: 'wamr'
os: macos-11
- name: 'Wasmtime on Linux'
action: test
- name: 'Wasmtime on Linux/x86_64'
runtime: 'wasmtime'
os: ubuntu-20.04
- name: 'Wasmtime on macOS'
action: test
- name: 'Wasmtime on Linux/aarch64'
runtime: 'wasmtime'
os: ubuntu-20.04
action: build
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
- name: 'Wasmtime on macOS/x86_64'
runtime: 'wasmtime'
os: macos-11
- name: 'WAVM on Linux'
action: test
- name: 'WAVM on Linux/x86_64'
runtime: 'wavm'
os: ubuntu-20.04
action: test

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

- name: Activate Docker/QEMU
if: startsWith(matrix.run_under, 'docker')
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

- name: Bazel cache
if: matrix.runtime != 'wasmtime'
if: ${{ matrix.runtime != 'wasmtime' || startsWith(matrix.run_under, 'docker') }}
uses: actions/cache@v2
with:
path: |
~/.cache/bazel
/private/var/tmp/_bazel_runner/
key: bazel-${{ matrix.os }}-${{ matrix.runtime }}-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.raze.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }}

- name: Test
run: |
bazel test \
--verbose_failures \
--test_output=errors \
--define runtime=${{ matrix.runtime }} \
${{ matrix.flags }} \
//test/...

- name: Test (signed Wasm module)
run: |
bazel test \
--verbose_failures \
--test_output=errors \
--define runtime=${{ matrix.runtime }} \
${{ matrix.flags }} \
--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-)\" \
//test:signature_util_test
- name: Bazel build/test
run: >
${{ matrix.run_under }}
bazel ${{ matrix.action }}
--verbose_failures
--test_output=errors
--define runtime=${{ matrix.runtime }}
${{ matrix.flags }}
//test/...

- name: Bazel build/test (signed Wasm module)
run: >
${{ matrix.run_under }}
bazel ${{ matrix.action }}
--verbose_failures
--test_output=errors
--define runtime=${{ matrix.runtime }}
${{ matrix.flags }}
--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-)\"
//test:signature_util_test

- name: Cleanup Bazel cache
if: matrix.runtime != 'wasmtime'
if: ${{ matrix.runtime != 'wasmtime' || startsWith(matrix.run_under, 'docker') }}
run: |
export OUTPUT=$(bazel info output_base)
# BoringSSL's test data (90 MiB).
Expand Down
5 changes: 5 additions & 0 deletions bazel/cargo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ additional_flags = [
buildrs_additional_deps = [
"@proxy_wasm_cpp_host__cc__1_0_72//:cc",
]

[package.metadata.raze.crates.wasmtime-jit.'*']
additional_deps = [
"@proxy_wasm_cpp_host__rustix__0_31_3//:rustix",
]
1 change: 1 addition & 0 deletions bazel/cargo/remote/BUILD.wasmtime-jit-0.33.0.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ rust_library(
"@proxy_wasm_cpp_host__gimli__0_26_1//:gimli",
"@proxy_wasm_cpp_host__object__0_27_1//:object",
"@proxy_wasm_cpp_host__region__2_2_0//:region",
"@proxy_wasm_cpp_host__rustix__0_31_3//:rustix",
"@proxy_wasm_cpp_host__serde__1_0_133//:serde",
"@proxy_wasm_cpp_host__target_lexicon__0_12_2//:target_lexicon",
"@proxy_wasm_cpp_host__thiserror__1_0_30//:thiserror",
Expand Down