forked from WebAssembly/binaryen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c62a0c9
commit 5300d6e
Showing
4 changed files
with
113 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: release-musl | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release-musl: | ||
name: release-x86_64-linux-musl | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- 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 \ | ||
--network host \ | ||
--pull \ | ||
--squash-all \ | ||
--tag rust:alpine-mimalloc \ | ||
. | ||
popd | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: checkout-submodules | ||
run: git submodule update --init --depth 1 --jobs 2 | ||
|
||
- name: build & test | ||
run: | | ||
podman run \ | ||
--env GITHUB_REF_NAME=$GITHUB_REF_NAME \ | ||
--init \ | ||
--network host \ | ||
--rm \ | ||
--tmpfs /tmp:exec \ | ||
--volume $PWD:/workspace \ | ||
--workdir /workspace \ | ||
rust:alpine-mimalloc \ | ||
/workspace/build-alpine.sh | ||
- name: upload-artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: binaryen-x86_64-linux-musl | ||
path: binaryen-*-x86_64-linux-musl.tar.zst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
apk upgrade | ||
apk add \ | ||
alpine-sdk \ | ||
clang \ | ||
cmake \ | ||
coreutils \ | ||
git \ | ||
lld \ | ||
llvm \ | ||
nodejs \ | ||
py3-pip \ | ||
samurai \ | ||
zstd | ||
|
||
pip3 install --break-system-packages -r requirements-dev.txt | ||
|
||
cmake \ | ||
-Bbuild \ | ||
-G Ninja \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \ | ||
-DCMAKE_C_COMPILER=clang \ | ||
-DCMAKE_CXX_COMPILER="$PWD/clang++.py" \ | ||
-DCMAKE_INSTALL_PREFIX="/tmp/binaryen-$GITHUB_REF_NAME" \ | ||
-DCMAKE_JOB_POOLS="linking=1" \ | ||
-DCMAKE_JOB_POOL_LINK=linking \ | ||
-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld -Wl,--thinlto-cache-dir=$PWD/build/lto-cache -s -static" \ | ||
-DBUILD_STATIC_LIB=ON \ | ||
-DENABLE_WERROR=OFF \ | ||
-DINSTALL_LIBS=OFF | ||
|
||
cmake --build build --target install -- -v | ||
|
||
CC=clang CXX=clang++ COMPILER_FLAGS="-Wno-unused-command-line-argument -fuse-ld=lld -Wl,--thinlto-cache-dir=$PWD/build/lto-cache -s -static" ./check.py --binaryen-bin build/bin --binaryen-lib build/lib | ||
|
||
tar \ | ||
--sort=name \ | ||
--mtime=1970-01-01T00:00:00Z \ | ||
--owner=0 \ | ||
--group=0 \ | ||
--numeric-owner \ | ||
--use-compress-program="zstd --ultra -22 --threads=0" \ | ||
-cf "binaryen-$GITHUB_REF_NAME-x86_64-linux-musl.tar.zst" \ | ||
-C /tmp \ | ||
"binaryen-$GITHUB_REF_NAME" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
import sys | ||
|
||
if __name__ == "__main__": | ||
args = [arg for arg in sys.argv[1:] if not arg in {"-fcolor-diagnostics"}] | ||
if any(any(arg.endswith(f) for f in {"Precompute.cpp"}) for arg in args): | ||
compiler = "g++" | ||
args = [arg for arg in args if not arg.startswith("-flto")] | ||
else: | ||
compiler = "clang++" | ||
os.execvp(compiler, [compiler] + args) |