38
38
strategy :
39
39
fail-fast : false
40
40
matrix :
41
- build : [linux-x64, macos-x64, macos-arm64, windows-x64, linux-aarch64]
42
41
include :
43
42
- build : linux-x64
44
43
os : ubuntu-18.04
47
46
artifact_name : ' wasmer-linux-amd64'
48
47
cross_compilation_artifact_name : ' cross_compiled_from_linux'
49
48
run_integration_tests : true
49
+ - build : linux-musl-x64
50
+ os : ubuntu-18.04
51
+ rust : 1.48
52
+ target : x86_64-unknown-linux-musl
53
+ artifact_name : ' wasmer-linux-musl-amd64'
54
+ cross_compilation_artifact_name : ' cross_compiled_from_linux'
55
+ run_integration_tests : false
50
56
- build : macos-x64
51
57
os : macos-latest
52
58
rust : 1.48
@@ -77,14 +83,20 @@ jobs:
77
83
CARGO_SCCACHE_VERSION : 0.2.14-alpha.0-parity
78
84
SCCACHE_AZURE_BLOB_CONTAINER : wasmerstoragesccacheblob
79
85
SCCACHE_AZURE_CONNECTION_STRING : ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }}
86
+ TARGET : ${{ matrix.target }}
80
87
steps :
81
88
- uses : actions/checkout@v2
82
89
- name : Set up libstdc++ on Linux
90
+ if : matrix.build == 'linux-x64'
83
91
run : |
84
92
sudo apt-get update -y
85
93
sudo apt-get install -y --allow-downgrades libstdc++6=8.4.0-1ubuntu1~18.04
86
94
sudo apt-get install --reinstall g++-8
87
- if : matrix.os == 'ubuntu-18.04'
95
+ - name : Set up musl on Linux
96
+ if : matrix.build == 'linux-musl-x64'
97
+ run : |
98
+ sudo apt-get update -y
99
+ sudo apt-get install -y musl-dev musl-tools
88
100
- name : Install Rust ${{ matrix.rust }}
89
101
uses : actions-rs/toolchain@v1
90
102
with :
@@ -125,7 +137,6 @@ jobs:
125
137
~/.cargo/registry
126
138
~/.cargo/git
127
139
key : ${{ matrix.build }}-${{ matrix.target }}-cargo-${{ hashFiles('Cargo.lock') }}-v1
128
- # Install sccache
129
140
- uses : actions/cache@v2
130
141
with :
131
142
path : ${{ runner.tool_cache }}/cargo-sccache
@@ -172,26 +183,46 @@ jobs:
172
183
- name : Test
173
184
run : |
174
185
make test
175
- if : matrix.target != 'aarch64-apple-darwin'
186
+ if : matrix.build != 'macos-arm64' && matrix.build != 'linux-musl-x64'
187
+ - name : Test (musl)
188
+ if : matrix.build == 'linux-musl-x64'
189
+ run : |
190
+ LIBC=musl WASMER_CAPI_USE_SYSTEM_LIBFFI=1 make test
176
191
- name : Test C API
177
192
run : |
178
193
make test-capi
179
- if : matrix.os != 'windows-latest' && matrix.target != 'aarch64-apple-darwin' # we can't test yet on Apple Silicon or Windows
194
+ if : matrix.os != 'windows-latest' && matrix.target != 'aarch64-apple-darwin' && matrix.build != 'linux-musl-x64' # we can't test yet on Apple Silicon or Windows
195
+ - name : Test C API (musl)
196
+ run : |
197
+ CC=musl-gcc LIBC=musl WASMER_CAPI_USE_SYSTEM_LIBFFI=1 make test-capi-cranelift-jit
198
+ LIBC=musl make test-capi-tests
199
+ CC=musl-gcc LIBC=musl WASMER_CAPI_USE_SYSTEM_LIBFFI=1 make test-capi-singlepass-jit
200
+ LIBC=musl make test-capi-tests
201
+ if : matrix.build == 'linux-musl-x64'
180
202
- name : Build C API
181
203
run : |
182
204
make build-capi
183
- if : matrix.target != 'aarch64-apple-darwin'
205
+ if : matrix.target != 'aarch64-apple-darwin' && matrix.build != 'linux-musl-x64'
184
206
- name : Build C API (system libffi)
185
207
run : |
186
208
make build-capi-cranelift-system-libffi
187
209
if : matrix.target == 'aarch64-apple-darwin'
210
+ - name : Build C API (musl)
211
+ run : |
212
+ LIBC=musl WASMER_CAPI_USE_SYSTEM_LIBFFI=1 make build-capi
213
+ if : matrix.build == 'linux-musl-x64'
188
214
- name : Build Wasmer binary
215
+ if : matrix.build != 'linux-musl-x64'
189
216
run : |
190
217
make build-wasmer
218
+ - name : Build Wasmer binary (musl)
219
+ if : matrix.build == 'linux-musl-x64'
220
+ run : |
221
+ LIBC=musl WASMER_CAPI_USE_SYSTEM_LIBFFI=1 make build-wasmer
191
222
- name : Build Wapm binary
223
+ if : needs.setup.outputs.DOING_RELEASE == '1' && matrix.build != 'linux-musl-x64'
192
224
run : |
193
225
make build-wapm
194
- if : needs.setup.outputs.DOING_RELEASE == '1'
195
226
- name : Install Nightly Rust for Headless
196
227
uses : actions-rs/toolchain@v1
197
228
with :
@@ -201,6 +232,7 @@ jobs:
201
232
components : " rust-src"
202
233
if : needs.setup.outputs.DOING_RELEASE == '1'
203
234
- name : Build Minimal Wasmer Headless
235
+ if : needs.setup.outputs.DOING_RELEASE == '1' && matrix.build != 'linux-musl-x64'
204
236
run : |
205
237
cargo install xargo
206
238
echo "" >> Cargo.toml
@@ -215,12 +247,13 @@ jobs:
215
247
echo "codegen-units = 1" >> Cargo.toml
216
248
echo "rpath = false" >> Cargo.toml
217
249
make build-wasmer-headless-minimal
218
- if : needs.setup.outputs.DOING_RELEASE == '1'
219
250
- name : Copy target binaries
220
251
run : |
221
252
mkdir -p target/release
222
253
cp target/${{matrix.target}}/release/wasmer* target/release
223
- cp target/${{matrix.target}}/release/libwasmer* target/release
254
+ if find target/${{matrix.target}}/release -type f -name 'libwasmer*' -maxdepth 1 | grep -q "."; then
255
+ cp target/${{matrix.target}}/release/libwasmer* target/release
256
+ fi
224
257
if [ -d "wapm-cli" ]; then
225
258
mkdir -p wapm-cli/target/release
226
259
cp wapm-cli/target/${{matrix.target}}/release/wapm* wapm-cli/target/release
@@ -242,7 +275,7 @@ jobs:
242
275
make test-integration
243
276
if : matrix.run_integration_tests && matrix.os != 'windows-latest'
244
277
- name : Cross compile from Linux
245
- if : matrix.os == 'ubuntu-18.04 '
278
+ if : matrix.build == 'linux-x64 '
246
279
shell : bash
247
280
run : |
248
281
ls target/release
@@ -347,7 +380,6 @@ jobs:
347
380
uses : actions/download-artifact@v2
348
381
with :
349
382
path : artifacts
350
-
351
383
- name : Create Release
352
384
id : create_release
353
385
uses : actions/create-release@v1
@@ -358,7 +390,6 @@ jobs:
358
390
release_name : Release ${{ needs.setup.outputs.VERSION }}
359
391
draft : true
360
392
prerelease : false
361
-
362
393
- name : Upload Release Asset Windows Installer
363
394
uses : actions/upload-release-asset@v1
364
395
env :
@@ -368,7 +399,6 @@ jobs:
368
399
asset_path : artifacts/wasmer-windows-amd64/WasmerInstaller.exe
369
400
asset_name : wasmer-windows.exe
370
401
asset_content_type : application/vnd.microsoft.portable-executable
371
-
372
402
- name : Upload Release Asset Windows
373
403
uses : actions/upload-release-asset@v1
374
404
env :
@@ -378,7 +408,6 @@ jobs:
378
408
asset_path : artifacts/wasmer-windows-amd64/wasmer.tar.gz
379
409
asset_name : wasmer-windows-amd64.tar.gz
380
410
asset_content_type : application/gzip
381
-
382
411
- name : Upload Release Asset Linux amd64
383
412
uses : actions/upload-release-asset@v1
384
413
env :
@@ -388,7 +417,16 @@ jobs:
388
417
asset_path : artifacts/wasmer-linux-amd64/wasmer.tar.gz
389
418
asset_name : wasmer-linux-amd64.tar.gz
390
419
asset_content_type : application/gzip
391
-
420
+ - name : Upload Release Asset Linux amd64 (musl)
421
+ id : upload-release-asset-linux-musl-amd64
422
+ uses : actions/upload-release-asset@v1
423
+ env :
424
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
425
+ with :
426
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
427
+ asset_path : artifacts/wasmer-linux-musl-amd64/wasmer.tar.gz
428
+ asset_name : wasmer-linux-musl-amd64.tar.gz
429
+ asset_content_type : application/gzip
392
430
- name : Upload Release Asset Mac amd64
393
431
uses : actions/upload-release-asset@v1
394
432
env :
0 commit comments