Skip to content

Commit 827e603

Browse files
authored
Fix linking on macOS. (#208)
Signed-off-by: Piotr Sikora <[email protected]>
1 parent 1eb66a0 commit 827e603

File tree

2 files changed

+37
-8
lines changed

2 files changed

+37
-8
lines changed

.github/workflows/cpp.yml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ on:
3131
jobs:
3232

3333
format:
34-
runs-on: ubuntu-latest
34+
runs-on: ubuntu-20.04
3535

3636
steps:
3737
- uses: actions/checkout@v2
@@ -58,33 +58,53 @@ jobs:
5858
addlicense -check .
5959
6060
build:
61-
name: build (${{ matrix.runtime }})
61+
name: build (${{ matrix.name }})
6262

63-
runs-on: ubuntu-latest
63+
runs-on: ${{ matrix.os }}
6464

6565
strategy:
6666
fail-fast: false
6767
matrix:
68-
runtime: ["wamr", "wasmtime", "wavm"]
68+
include:
69+
- name: 'WAMR on Linux'
70+
runtime: 'wamr'
71+
os: ubuntu-20.04
72+
- name: 'WAMR on macOS'
73+
runtime: 'wamr'
74+
os: macos-11
75+
- name: 'Wasmtime on Linux'
76+
runtime: 'wasmtime'
77+
os: ubuntu-20.04
78+
- name: 'Wasmtime on macOS'
79+
runtime: 'wasmtime'
80+
os: macos-11
81+
- name: 'WAVM on Linux'
82+
runtime: 'wavm'
83+
os: ubuntu-20.04
6984

7085
steps:
7186
- uses: actions/checkout@v2
7287

73-
- name: Install dependency
88+
- name: Install dependency (Linux)
89+
if: startsWith(matrix.os, 'ubuntu')
7490
run: sudo apt-get install ninja-build
7591

92+
- name: Install dependency (macOS)
93+
if: startsWith(matrix.os, 'macos')
94+
run: brew install ninja
95+
7696
- name: Mount Bazel cache
7797
uses: actions/cache@v2
7898
with:
7999
path: |
80100
~/.cache/bazel
81101
~/.cache/bazelisk
82-
key: bazel-${{ matrix.runtime }}-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.raze.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }}
102+
key: bazel-${{ matrix.os }}-${{ matrix.runtime }}-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.raze.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }}
83103

84104
- name: Test
85105
run: |
86-
bazel test --define runtime=${{ matrix.runtime }} //test/...
106+
bazel test --test_output=errors --define runtime=${{ matrix.runtime }} //test/...
87107
88108
- name: Test (signed Wasm module)
89109
run: |
90-
bazel test --define runtime=${{ matrix.runtime }} --per_file_copt=//...@-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -b9-)\" //test:signature_util_test
110+
bazel test --test_output=errors --define runtime=${{ matrix.runtime }} --per_file_copt=//...@-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -b9-)\" //test:signature_util_test

test/BUILD

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package(default_visibility = ["//visibility:public"])
77
cc_test(
88
name = "null_vm_test",
99
srcs = ["null_vm_test.cc"],
10+
linkstatic = 1,
1011
deps = [
1112
"//:lib",
1213
"@com_google_googletest//:gtest",
@@ -20,6 +21,7 @@ cc_test(
2021
data = [
2122
"//test/test_data:abi_export.wasm",
2223
],
24+
linkstatic = 1,
2325
deps = [
2426
":utility_lib",
2527
"//:lib",
@@ -36,6 +38,7 @@ cc_test(
3638
"//test/test_data:abi_export.signed.with.key2.wasm",
3739
"//test/test_data:abi_export.wasm",
3840
],
41+
linkstatic = 1,
3942
# Test only when compiled to verify plugins.
4043
tags = ["manual"],
4144
deps = [
@@ -54,6 +57,7 @@ cc_test(
5457
"//test/test_data:callback.wasm",
5558
"//test/test_data:trap.wasm",
5659
],
60+
linkstatic = 1,
5761
deps = [
5862
":utility_lib",
5963
"//:lib",
@@ -69,6 +73,7 @@ cc_test(
6973
"//test/test_data:clock.wasm",
7074
"//test/test_data:env.wasm",
7175
],
76+
linkstatic = 1,
7277
deps = [
7378
":utility_lib",
7479
"//:lib",
@@ -83,6 +88,7 @@ cc_test(
8388
data = [
8489
"//test/test_data:abi_export.wasm",
8590
],
91+
linkstatic = 1,
8692
deps = [
8793
":utility_lib",
8894
"//:lib",
@@ -94,6 +100,7 @@ cc_test(
94100
cc_test(
95101
name = "shared_data",
96102
srcs = ["shared_data_test.cc"],
103+
linkstatic = 1,
97104
deps = [
98105
"//:lib",
99106
"@com_google_googletest//:gtest",
@@ -104,6 +111,7 @@ cc_test(
104111
cc_test(
105112
name = "shared_queue",
106113
srcs = ["shared_queue_test.cc"],
114+
linkstatic = 1,
107115
deps = [
108116
"//:lib",
109117
"@com_google_googletest//:gtest",
@@ -114,6 +122,7 @@ cc_test(
114122
cc_test(
115123
name = "vm_id_handle",
116124
srcs = ["vm_id_handle_test.cc"],
125+
linkstatic = 1,
117126
deps = [
118127
"//:lib",
119128
"@com_google_googletest//:gtest",

0 commit comments

Comments
 (0)