Skip to content

Commit

Permalink
241122
Browse files Browse the repository at this point in the history
  • Loading branch information
TerrorJack committed Nov 22, 2024
1 parent c1e66bd commit 2b45ca9
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 76 deletions.
57 changes: 57 additions & 0 deletions .github/actions/linux/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: build-linux
runs:
using: composite
steps:
- name: build-image
shell: bash
run: |
pushd "$(mktemp -d)"
curl -f -L --retry 5 https://github.com/tweag/rust-alpine-mimalloc/archive/refs/heads/master.tar.gz | tar xz --strip-components=1
podman build \
--network host \
--pull \
--squash-all \
--tag rust:alpine-mimalloc \
.
popd
- name: build
shell: bash
run: |
podman run \
--env RUSTFLAGS="-C target-feature=+crt-static" \
--init \
--network host \
--rm \
--tmpfs /tmp:exec \
--volume $PWD:/workspace \
--workdir /workspace \
rust:alpine-mimalloc \
sh -c 'TARGET=$(rustc -vV | sed -n "s|host: ||p") && exec ./build.sh --target $TARGET'
MIMALLOC_VERBOSE=1 ./bin/wasm-component-ld --help
MIMALLOC_VERBOSE=1 ./bin/wasm-tools --version
MIMALLOC_VERBOSE=1 ./bin/wasmtime --version
MIMALLOC_VERBOSE=1 ./bin/wit-bindgen --version
MIMALLOC_VERBOSE=1 ./bin/wizer --version
file ./bin/wasm-component-ld
file ./bin/wasm-tools
file ./bin/wasmtime
file ./bin/wit-bindgen
file ./bin/wizer
mkdir wasm-tools-${{ github.ref_name }}-${{ matrix.arch }}-linux
mv bin wasm-tools-${{ github.ref_name }}-${{ matrix.arch }}-linux
tar \
--sort=name \
--owner=0 --group=0 --numeric-owner \
--use-compress-program="zstd --ultra -22 --threads=0" \
-cf wasm-tools-${{ github.ref_name }}-${{ matrix.arch }}-linux.tar.zst \
wasm-tools-${{ github.ref_name }}-${{ matrix.arch }}-linux
- name: upload-artifact
uses: actions/upload-artifact@v4
with:
name: wasm-tools-${{ github.ref_name }}-${{ matrix.arch }}-linux
path: wasm-tools-${{ github.ref_name }}-${{ matrix.arch }}-linux.tar.zst
104 changes: 33 additions & 71 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,90 +8,54 @@ on:
workflow_dispatch:

jobs:
linux:
x86_64-linux:
name: linux-${{ matrix.arch }}
runs-on: ubuntu-24.04
runs-on:
- X64
- Linux
- podman
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
sys: x86_64-linux
- arch: arm64/v8
sys: aarch64-linux
arch:
- x86_64
steps:

- name: setup-podman
uses: TerrorJack/setup-podman@master

- name: checkout
uses: actions/checkout@v4

- name: build-image
run: |
pushd "$(mktemp -d)"
curl -f -L --retry 5 https://github.com/tweag/rust-alpine-mimalloc/archive/refs/heads/master.tar.gz | tar xz --strip-components=1
podman build \
--arch ${{ matrix.arch }} \
--network host \
--pull \
--squash-all \
--tag rust:alpine-mimalloc \
.
popd
- name: build
run: |
podman run \
--arch ${{ matrix.arch }} \
--env RUSTFLAGS="-C target-feature=+crt-static" \
--init \
--network host \
--rm \
--tmpfs /tmp:exec \
--volume $PWD:/workspace \
--workdir /workspace \
rust:alpine-mimalloc \
sh -c 'TARGET=$(rustc -vV | sed -n "s|host: ||p") && exec ./build.sh --target $TARGET'
MIMALLOC_VERBOSE=1 ./bin/wasm-component-ld --help
MIMALLOC_VERBOSE=1 ./bin/wasm-tools --version
MIMALLOC_VERBOSE=1 ./bin/wasmtime --version
MIMALLOC_VERBOSE=1 ./bin/wit-bindgen --version
MIMALLOC_VERBOSE=1 ./bin/wizer --version
file ./bin/wasm-component-ld
file ./bin/wasm-tools
file ./bin/wasmtime
file ./bin/wit-bindgen
file ./bin/wizer
- name: build-linux
uses: ./.github/actions/linux

mkdir wasm-tools-${{ github.ref_name }}-${{ matrix.sys }}
mv bin wasm-tools-${{ github.ref_name }}-${{ matrix.sys }}
tar \
--sort=name \
--owner=0 --group=0 --numeric-owner \
--use-compress-program="zstd --ultra -22 --threads=0" \
-cf wasm-tools-${{ github.ref_name }}-${{ matrix.sys }}.tar.zst \
wasm-tools-${{ github.ref_name }}-${{ matrix.sys }}
aarch64-linux:
name: linux-${{ matrix.arch }}
runs-on:
- ARM64
- Linux
- podman
strategy:
fail-fast: false
matrix:
arch:
- aarch64
steps:
- name: checkout
uses: actions/checkout@v4

- name: upload-artifact
uses: actions/upload-artifact@v4
with:
name: wasm-tools-${{ github.ref_name }}-${{ matrix.sys }}
path: wasm-tools-${{ github.ref_name }}-${{ matrix.sys }}.tar.zst
- name: build-linux
uses: ./.github/actions/linux

darwin:
name: darwin-${{ matrix.arch }}
runs-on: macos-latest
runs-on:
- ARM64
- macOS
strategy:
fail-fast: false
matrix:
arch:
- x86_64
- aarch64
steps:

- name: checkout
uses: actions/checkout@v4

Expand All @@ -111,9 +75,7 @@ jobs:
mkdir wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }}
mv bin wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }}
gtar \
--sort=name \
--owner=0 --group=0 --numeric-owner \
tar \
--use-compress-program="zstd --ultra -22 --threads=0" \
-cf wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }}.tar.zst \
wasm-tools-${{ github.ref_name }}-darwin-${{ matrix.arch }}
Expand All @@ -126,15 +88,15 @@ jobs:

windows:
name: windows-${{ matrix.arch }}
runs-on: windows-latest
runs-on:
- X64
- Windows
strategy:
fail-fast: false
matrix:
arch:
- x86_64
- aarch64
steps:

- name: checkout
uses: actions/checkout@v4

Expand All @@ -150,7 +112,7 @@ jobs:
--all-features `
--root wasm-tools-${{ github.ref_name }}-windows-${{ matrix.arch }} `
--target ${{ matrix.arch }}-pc-windows-msvc `
--git https://github.com/TerrorJack/wizer.git `
--git https://github.com/haskell-wasm/wizer.git `
wizer
cargo install `
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Static builds of `wasm-tools`, `wasmtime-cli`, `wizer` for
{x86_64,aarch64}-{linux,darwin,windows}:

- `wasm-component-ld`: `v0.5.8`
- `wasm-tools`: `v1.217.0`
- `wasmtime-cli`: `v25.0.0`
- `wit-bindgen-cli`: `v0.32.0`
- `wasm-component-ld`: `v0.5.10`
- `wasm-tools`: `v1.220.0`
- `wasmtime-cli`: `v27.0.0`
- `wit-bindgen-cli`: `v0.35.0`
- `wizer`: `v7.0.5-git`
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cargo install \
--all-features \
--config 'profile.release.strip = "symbols"' \
--root "$PWD" \
--git https://github.com/TerrorJack/wizer.git \
--git https://github.com/haskell-wasm/wizer.git \
wizer ${1+"$@"}

cargo install \
Expand Down

0 comments on commit 2b45ca9

Please sign in to comment.