Skip to content

Commit 97caf1a

Browse files
committed
250106
1 parent 2b45ca9 commit 97caf1a

File tree

4 files changed

+81
-89
lines changed

4 files changed

+81
-89
lines changed

.github/actions/linux/action.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 67 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,49 +8,83 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
x86_64-linux:
12-
name: linux-${{ matrix.arch }}
11+
linux:
12+
name: ${{ matrix.arch }}-linux
1313
runs-on:
14-
- X64
14+
- ${{ matrix.runner_tag }}
1515
- Linux
1616
- podman
1717
strategy:
18-
fail-fast: false
1918
matrix:
20-
arch:
21-
- x86_64
19+
include:
20+
- arch: x86_64
21+
runner_tag: X64
22+
- arch: aarch64
23+
runner_tag: ARM64
2224
steps:
2325
- name: checkout
2426
uses: actions/checkout@v4
2527

26-
- name: build-linux
27-
uses: ./.github/actions/linux
28+
- name: build-image
29+
run: |
30+
podman rmi --ignore rust:alpine-mimalloc
31+
32+
pushd "$(mktemp -d)"
33+
curl -f -L --retry 5 https://github.com/tweag/rust-alpine-mimalloc/archive/refs/heads/master.tar.gz | tar xz --strip-components=1
34+
podman build \
35+
--network host \
36+
--pull \
37+
--squash-all \
38+
--tag rust:alpine-mimalloc \
39+
.
40+
popd
2841
29-
aarch64-linux:
30-
name: linux-${{ matrix.arch }}
31-
runs-on:
32-
- ARM64
33-
- Linux
34-
- podman
35-
strategy:
36-
fail-fast: false
37-
matrix:
38-
arch:
39-
- aarch64
40-
steps:
41-
- name: checkout
42-
uses: actions/checkout@v4
42+
- name: build
43+
run: |
44+
podman run \
45+
--env RUSTFLAGS="-C target-feature=+crt-static" \
46+
--init \
47+
--network host \
48+
--rm \
49+
--tmpfs /tmp:exec \
50+
--volume $PWD:/workspace \
51+
--workdir /workspace \
52+
rust:alpine-mimalloc \
53+
sh -c 'TARGET=$(rustc -vV | sed -n "s|host: ||p") && exec ./build.sh --target $TARGET'
54+
55+
MIMALLOC_VERBOSE=1 ./bin/wasm-component-ld --help
56+
MIMALLOC_VERBOSE=1 ./bin/wasm-tools --version
57+
MIMALLOC_VERBOSE=1 ./bin/wasmtime --version
58+
MIMALLOC_VERBOSE=1 ./bin/wit-bindgen --version
59+
MIMALLOC_VERBOSE=1 ./bin/wizer --version
4360
44-
- name: build-linux
45-
uses: ./.github/actions/linux
61+
file ./bin/wasm-component-ld
62+
file ./bin/wasm-tools
63+
file ./bin/wasmtime
64+
file ./bin/wit-bindgen
65+
file ./bin/wizer
66+
67+
mkdir wasm-tools-${{ github.ref_name }}-${{ matrix.arch }}-linux
68+
mv bin wasm-tools-${{ github.ref_name }}-${{ matrix.arch }}-linux
69+
tar \
70+
--sort=name \
71+
--owner=0 --group=0 --numeric-owner \
72+
--use-compress-program="zstd --ultra -22 --threads=0" \
73+
-cf wasm-tools-${{ github.ref_name }}-${{ matrix.arch }}-linux.tar.zst \
74+
wasm-tools-${{ github.ref_name }}-${{ matrix.arch }}-linux
75+
76+
- name: upload-artifact
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: wasm-tools-${{ github.ref_name }}-${{ matrix.arch }}-linux
80+
path: wasm-tools-${{ github.ref_name }}-${{ matrix.arch }}-linux.tar.zst
4681

4782
darwin:
4883
name: darwin-${{ matrix.arch }}
4984
runs-on:
5085
- ARM64
5186
- macOS
5287
strategy:
53-
fail-fast: false
5488
matrix:
5589
arch:
5690
- x86_64
@@ -61,6 +95,7 @@ jobs:
6195

6296
- name: install-deps
6397
run: |
98+
rustup update
6499
rustup target add ${{ matrix.arch }}-apple-darwin
65100
66101
- name: build
@@ -92,7 +127,6 @@ jobs:
92127
- X64
93128
- Windows
94129
strategy:
95-
fail-fast: false
96130
matrix:
97131
arch:
98132
- x86_64
@@ -102,6 +136,7 @@ jobs:
102136

103137
- name: install-deps
104138
run: |
139+
rustup update
105140
rustup target add ${{ matrix.arch }}-pc-windows-msvc
106141
107142
- name: build
@@ -115,11 +150,16 @@ jobs:
115150
--git https://github.com/haskell-wasm/wizer.git `
116151
wizer
117152
153+
cargo install `
154+
--root wasm-tools-${{ github.ref_name }}-windows-${{ matrix.arch }} `
155+
--target ${{ matrix.arch }}-pc-windows-msvc `
156+
wasm-tools
157+
118158
cargo install `
119159
--all-features `
120160
--root wasm-tools-${{ github.ref_name }}-windows-${{ matrix.arch }} `
121161
--target ${{ matrix.arch }}-pc-windows-msvc `
122-
wasmtime-cli wasm-component-ld wasm-tools wit-bindgen-cli
162+
wasmtime-cli wasm-component-ld wit-bindgen-cli
123163
124164
- name: upload-artifact
125165
uses: actions/upload-artifact@v4

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Static builds of `wasm-tools`, `wasmtime-cli`, `wizer` for
44
{x86_64,aarch64}-{linux,darwin,windows}:
55

6-
- `wasm-component-ld`: `v0.5.10`
7-
- `wasm-tools`: `v1.220.0`
8-
- `wasmtime-cli`: `v27.0.0`
9-
- `wit-bindgen-cli`: `v0.35.0`
6+
- `wasm-component-ld`: `v0.5.11`
7+
- `wasm-tools`: `v1.222.0`
8+
- `wasmtime-cli`: `v28.0.0`
9+
- `wit-bindgen-cli`: `v0.36.0`
1010
- `wizer`: `v7.0.5-git`

build.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,27 @@ set -eu
44

55
cargo install \
66
--all-features \
7+
--config 'profile.release.lto = "thin"' \
78
--config 'profile.release.strip = "symbols"' \
89
--root "$PWD" \
910
--git https://github.com/haskell-wasm/wizer.git \
1011
wizer ${1+"$@"}
1112

13+
cargo install \
14+
--config 'profile.release.lto = "thin"' \
15+
--config 'profile.release.strip = "symbols"' \
16+
--root "$PWD" \
17+
wasm-tools ${1+"$@"}
18+
1219
cargo install \
1320
--all-features \
21+
--config 'profile.release.lto = "thin"' \
1422
--config 'profile.release.strip = "symbols"' \
1523
--root "$PWD" \
16-
wasm-component-ld wasm-tools wit-bindgen-cli ${1+"$@"}
24+
wasm-component-ld wit-bindgen-cli ${1+"$@"}
1725

1826
cargo install \
1927
--all-features \
28+
--config 'profile.release.lto = "thin"' \
2029
--root "$PWD" \
2130
wasmtime-cli ${1+"$@"}

0 commit comments

Comments
 (0)