Skip to content

Commit 85b27b6

Browse files
committed
Add a MinGW release to our CI
This commit extends our CI to produce release artifacts for the x86_64-pc-windows-gnu target. This was originally motivate by the [go extension] where it looks like the Go toolchain primarily interoperates with MinGW, not with MSVC natively. The support here turned out to be quite trivial, largely just adding the configuration to make the release. I don't think we should necessarily commit to this being a primary platform for Wasmtime at this time though. If the support here regresses in the future for a difficult-to-fix reason I think it would be fine to back out the platform at least temporarily. Note that this does not add a full test suite for the MinGW target, only a release builder. This release builder does run tests, but not with full debug assertions enabled. [go extension]: bytecodealliance/wasmtime-go#3 Closes #1535
1 parent d1aa86f commit 85b27b6

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

.github/workflows/main.yml

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,17 @@ jobs:
269269
include:
270270
- build: x86_64-linux
271271
os: ubuntu-latest
272+
rust: stable
272273
- build: x86_64-macos
273274
os: macos-latest
275+
rust: stable
274276
- build: x86_64-windows
275277
os: windows-latest
278+
rust: stable
279+
- build: x86_64-mingw
280+
os: windows-latest
281+
target: x86_64-pc-windows-gnu
282+
rust: nightly # needs rust-lang/rust#69351 to ride to stable
276283
- build: aarch64-linux
277284
os: ubuntu-latest
278285
rust: stable
@@ -286,9 +293,18 @@ jobs:
286293
with:
287294
submodules: true
288295
- uses: ./.github/actions/install-rust
296+
with:
297+
toolchain: ${{ matrix.rust }}
289298
- uses: ./.github/actions/binary-compatible-builds
290299
if: matrix.target == ''
291300

301+
- name: Configure Cargo target
302+
run: |
303+
echo ::set-env name=CARGO_BUILD_TARGET::${{ matrix.target }}
304+
rustup target add ${{ matrix.target }}
305+
shell: bash
306+
if: matrix.target != ''
307+
292308
- name: Install cross-compilation tools
293309
run: |
294310
set -ex
@@ -309,9 +325,7 @@ jobs:
309325
upcase=$(echo ${{ matrix.target }} | awk '{ print toupper($0) }' | sed 's/-/_/g')
310326
echo ::set-env name=CARGO_TARGET_${upcase}_RUNNER::$HOME/qemu/bin/${{ matrix.qemu }}
311327
echo ::set-env name=CARGO_TARGET_${upcase}_LINKER::${{ matrix.gcc }}
312-
echo ::set-env name=CARGO_BUILD_TARGET::${{ matrix.target }}
313-
rustup target add ${{ matrix.target }}
314-
if: matrix.target != ''
328+
if: matrix.target != '' && matrix.os == 'ubuntu-latest'
315329

316330
# Install wasm32-wasi target in order to build wasi-common's integration
317331
# tests
@@ -348,7 +362,10 @@ jobs:
348362
if: matrix.os != 'windows-latest' && matrix.target != ''
349363
- run: cp target/release/wasmtime.exe dist
350364
shell: bash
351-
if: matrix.os == 'windows-latest'
365+
if: matrix.build == 'x86_64-windows'
366+
- run: cp target/x86_64-pc-windows-gnu/release/wasmtime.exe dist
367+
shell: bash
368+
if: matrix.build == 'x86_64-mingw'
352369

353370
# Move libwasmtime dylib to dist folder
354371
- run: cp target/release/libwasmtime.{so,a} dist
@@ -359,7 +376,10 @@ jobs:
359376
if: matrix.os == 'macos-latest'
360377
- run: cp target/release/wasmtime.{dll,lib,dll.lib} dist
361378
shell: bash
362-
if: matrix.os == 'windows-latest'
379+
if: matrix.build == 'x86_64-windows'
380+
- run: cp target/x86_64-pc-windows-gnu/release/{wasmtime.dll,libwasmtime.a} dist
381+
shell: bash
382+
if: matrix.build == 'x86_64-mingw'
363383

364384
# Make a Windows MSI installer if we're on Windows
365385
- run: |
@@ -368,7 +388,7 @@ jobs:
368388
"$WIX/bin/light" -out dist/installer.msi target/wasmtime.wixobj -ext WixUtilExtension
369389
rm dist/installer.wixpdb
370390
shell: bash
371-
if: matrix.os == 'windows-latest'
391+
if: matrix.build == 'x86_64-windows'
372392
373393
- uses: actions/upload-artifact@v1
374394
with:
@@ -416,6 +436,10 @@ jobs:
416436
uses: actions/download-artifact@v1
417437
with:
418438
name: bins-x86_64-windows
439+
- name: Download x86_64 Windows MinGW binaries
440+
uses: actions/download-artifact@v1
441+
with:
442+
name: bins-x86_64-mingw
419443

420444
- name: Assemble gh-pages
421445
run: |
@@ -449,6 +473,7 @@ jobs:
449473
run: |
450474
./ci/build-tarballs.sh x86_64-linux
451475
./ci/build-tarballs.sh x86_64-windows .exe
476+
./ci/build-tarballs.sh x86_64-mingw .exe
452477
./ci/build-tarballs.sh x86_64-macos
453478
./ci/build-tarballs.sh aarch64-linux
454479

ci/build-tarballs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ mv bins-$platform/wasmtime$exe tmp/$bin_pkgname
4040
chmod +x tmp/$bin_pkgname/wasmtime$exe
4141
mktarball $bin_pkgname
4242

43-
if [ "$exe" = ".exe" ]; then
43+
if [ -f bins-$platform/installer.msi ]; then
4444
mv bins-$platform/installer.msi dist/$bin_pkgname.msi
4545
fi
4646

0 commit comments

Comments
 (0)