Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build CI #5179

Merged
merged 39 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
686e1a3
disable all except windows
maminrayej Oct 24, 2024
5effb8d
fix syntax
maminrayej Oct 24, 2024
a7a15a1
enable other windows jobs
maminrayej Oct 24, 2024
7bb9599
test new arm runner
maminrayej Oct 24, 2024
7e9495e
export LLVM_SYS for Linux as well
maminrayej Oct 24, 2024
f6d2e66
only build wasmer
maminrayej Oct 24, 2024
ff04ef6
list llvm dir
maminrayej Oct 24, 2024
3dfb2af
use llvm from the package manager
maminrayej Oct 24, 2024
30a69f0
install libpolly
maminrayej Oct 24, 2024
2057393
install zstd
maminrayej Oct 24, 2024
cd42522
install libzstd-dev
maminrayej Oct 24, 2024
967905f
complete setup for arm64
maminrayej Oct 24, 2024
2c7a9d7
re-enable workflows again
maminrayej Oct 24, 2024
be707f3
re-enable other workflows
maminrayej Oct 24, 2024
11381bb
enable musl builds
maminrayej Oct 27, 2024
49049bd
fix ids
maminrayej Oct 27, 2024
31c3b39
fix container
maminrayej Oct 27, 2024
ff2610b
disable capi for now
maminrayej Oct 27, 2024
f3363b2
fix capi
maminrayej Oct 27, 2024
856d5f5
fix issues with build and conditions
maminrayej Oct 27, 2024
de07ac2
fix syntax issue
maminrayej Oct 27, 2024
d6f83e5
fix again
maminrayej Oct 27, 2024
a45a74f
do not build wasmi on alpine for now
maminrayej Oct 27, 2024
5937a9f
add musl-dev
maminrayej Oct 27, 2024
ef91e19
only use static when target is musl
maminrayej Oct 27, 2024
40551dd
update lock file
maminrayej Oct 27, 2024
403914b
enable wasmi on musl again
maminrayej Oct 28, 2024
a6e1bfa
disable others for now
maminrayej Oct 28, 2024
77c34a6
fix deps
maminrayej Oct 28, 2024
f2a9470
fix condition
maminrayej Oct 28, 2024
c9d4457
fix syntax
maminrayej Oct 28, 2024
3075af8
enable other builds
maminrayej Oct 28, 2024
64a1323
enable other workflows
maminrayej Oct 28, 2024
336c5ce
do not build on PR
maminrayej Oct 28, 2024
ac34697
install llvm-config
maminrayej Oct 28, 2024
5d48d77
fix syntax
maminrayej Oct 28, 2024
e79f8c4
update alpine deps
maminrayej Oct 28, 2024
15a7d53
install llvm static
maminrayej Oct 28, 2024
fe43445
correctly expose llvm config
maminrayej Oct 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
304 changes: 155 additions & 149 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ jobs:
fail-fast: false
matrix:
include:
- build: linux-arm64
os: arm64-ubuntu-latest-8-cores
artifact_name: 'wasmer-linux-aarch64'
cross_compilation_artifact_name: 'cross_compiled_from_linux'
use_sccache: false
use_llvm: true
build_wasm: true
- build: linux-x64
os: ubuntu-22.04
artifact_name: 'wasmer-linux-amd64'
Expand Down Expand Up @@ -182,6 +189,20 @@ jobs:
use_sccache: false
use_llvm: false
build_wasm: true
- build: linux-musl-x64-v8
os: ubuntu-latest
artifact_name: 'wasmer-v8-linux-musl-amd64'
container: alpine:latest
use_sccache: false
use_llvm: false
build_wasm: true
- build: linux-musl-x64-wasmi
os: ubuntu-latest
artifact_name: 'wasmer-wasmi-linux-musl-amd64'
container: alpine:latest
use_sccache: false
use_llvm: false
build_wasm: true
container: ${{ matrix.container }}
env:
SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob
Expand All @@ -190,12 +211,18 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up base deps on musl
if: matrix.build == 'linux-musl-x64'
run: ./scripts/alpine-linux-install-deps.sh
if: startsWith(matrix.build, 'linux-musl-x64')
run: |
apk add bash mold make curl cmake ninja clang18 zstd-static llvm18-dev clang18-static llvm18-static ncurses-static zlib-static
ln -s /usr/bin/clang-18 /usr/bin/clang
- name: Install Linux tools
if: startsWith(matrix.build, 'linux-x64')
run: |
sudo apt install mold ninja-build
- name: Install Linux ARM tools
if: startsWith(matrix.build, 'linux-arm64')
run: |
sudo apt install mold ninja-build llvm-18-dev libclang-18-dev clang-18 cmake make libpolly-18-dev libzstd1 zstd libzstd-dev
- name: Install Linux musl tools
if: startsWith(matrix.build, 'linux-musl')
run: |
Expand Down Expand Up @@ -318,13 +345,13 @@ jobs:
- name: Build C API headless
shell: bash
run: |
make package-capi-headless
LLVM_CONFIG_PATH=/usr/bin/llvm-config-18 make package-capi-headless
- name: Build C API
shell: bash
run: |
make build-capi
LLVM_CONFIG_PATH=/usr/bin/llvm-config-18 make build-capi
- name: Build Wasmer binary with LLVM
if: matrix.use_llvm
if: matrix.use_llvm && !endsWith(matrix.build, 'v8') && !endsWith(matrix.build, 'wamr') && !endsWith(matrix.build, 'wasmi')
shell: bash
run: |
make build-wasmer
Expand All @@ -334,21 +361,45 @@ jobs:
if: ${{ endsWith(matrix.build, 'v8') && startsWith(matrix.build, 'linux-x64') }}
run: |
RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold" make build-wasmer-v8
- name: Build Wasmer with v8 backend musl
if: ${{ endsWith(matrix.build, 'v8') && startsWith(matrix.build, 'linux-musl') }}
run: |
echo "#!/bin/bash" >> /usr/bin/llvm-config
echo 'if [ "$1" = "--libs" ]; then' >> /usr/bin/llvm-config
echo 'llvm-config-18 "$@" "--link-static"' >> /usr/bin/llvm-config
echo "else" >> /usr/bin/llvm-config
echo 'llvm-config-18 "$@"' >> /usr/bin/llvm-config
echo 'fi' >> /usr/bin/llvm-config
cat /usr/bin/llvm-config
chmod +x /usr/bin/llvm-config
LLVM_CONFIG_PATH=/usr/bin/llvm-config RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold -lzstd" make build-wasmer-v8
- name: Build Wasmer with v8 backend
if: ${{ endsWith(matrix.build, 'v8') && !startsWith(matrix.build, 'linux-x64') }}
if: ${{ endsWith(matrix.build, 'v8') && !startsWith(matrix.build, 'linux-x64') && !startsWith(matrix.build, 'linux-musl') }}
run: |
echo $LIBCLANG_STATIC_PATH
make build-wasmer-v8
- name: Build Wasmer with wamr backend
if: endsWith(matrix.build, 'wamr')
if: ${{ endsWith(matrix.build, 'wamr') && !startsWith(matrix.build, 'linux-musl') }}
run: |
make build-wasmer-wamr
- name: Build Wasmer with wasmi backend
if: endsWith(matrix.build, 'wasmi')
if: endsWith(matrix.build, 'wasmi') && !startsWith(matrix.build, 'linux-musl')
run: |
make build-wasmer-wasmi
- name: Build Wasmer with wasmi backend musl
if: endsWith(matrix.build, 'wasmi') && startsWith(matrix.build, 'linux-musl')
run: |
echo "#!/bin/bash" >> /usr/bin/llvm-config
echo 'if [ "$1" = "--libs" ]; then' >> /usr/bin/llvm-config
echo 'llvm-config-18 "$@" "--link-static"' >> /usr/bin/llvm-config
echo "else" >> /usr/bin/llvm-config
echo 'llvm-config-18 "$@"' >> /usr/bin/llvm-config
echo 'fi' >> /usr/bin/llvm-config
cat /usr/bin/llvm-config
chmod +x /usr/bin/llvm-config
RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold -lzstd" make build-wasmer-wasmi
- name: Build Wasmer binary without LLVM
if: matrix.use_llvm != true
if: matrix.use_llvm != true && !endsWith(matrix.build, 'v8') && !endsWith(matrix.build, 'wamr') && !endsWith(matrix.build, 'wasmi')
shell: bash
run: |
make build-wasmer
Expand All @@ -358,14 +409,14 @@ jobs:
# run: |
# make build-wasmer-wasm
- name: Install Nightly Rust for Headless
if: matrix.build != 'linux-musl-x64'
if: ${{ !startsWith(matrix.build, 'linux-musl-x64') }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: "nightly-2024-07-05"
target: ${{ matrix.target }}
components: "rust-src"
- name: Build Minimal Wasmer Headless
if: matrix.build != 'linux-musl-x64'
if: ${{ !startsWith(matrix.build, 'linux-musl-x64') }}
run: |
cargo install xargo
echo "" >> Cargo.toml
Expand Down Expand Up @@ -522,135 +573,70 @@ jobs:
if-no-files-found: error
retention-days: 2

linux_aarch64:
name: Linux aarch64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
target: aarch64-unknown-linux-gnu
- name: Build cross image
run: |
docker build -t wasmer/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/
env:
CROSS_DOCKER_IN_DOCKER: true
- name: Build Wasmer binary
run: |
make build-wasmer
env:
CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross
CROSS_DOCKER_IN_DOCKER: true
CARGO_TARGET: aarch64-unknown-linux-gnu
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
PKG_CONFIG_ALLOW_CROSS: true
ENABLE_LLVM: 0
- name: Build C API headless
shell: bash
run: |
make package-capi-headless
env:
CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross
CROSS_DOCKER_IN_DOCKER: true
CARGO_TARGET: aarch64-unknown-linux-gnu
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
PKG_CONFIG_ALLOW_CROSS: true
ENABLE_LLVM: 0
TARGET: aarch64-unknown-linux-gnu
TARGET_DIR: target/aarch64-unknown-linux-gnu/release
- name: Build C API
run: |
make build-capi
env:
CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross
CROSS_DOCKER_IN_DOCKER: true
CARGO_TARGET: aarch64-unknown-linux-gnu
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
PKG_CONFIG_ALLOW_CROSS: true
ENABLE_LLVM: 0
- name: Dist
run: |
make distribution
env:
CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/aarch64 cross
CROSS_DOCKER_IN_DOCKER: true
CARGO_TARGET: aarch64-unknown-linux-gnu
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
PKG_CONFIG_ALLOW_CROSS: true
TARGET: aarch64-unknown-linux-gnu
TARGET_DIR: target/aarch64-unknown-linux-gnu/release
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: wasmer-linux-aarch64
path: dist
if-no-files-found: error
retention-days: 2

linux_riscv64:
name: Linux riscv64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
target: riscv64gc-unknown-linux-gnu
- name: Build cross image
run: |
docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/
env:
CROSS_DOCKER_IN_DOCKER: true
- name: Build Wasmer binary
run: |
make build-wasmer
env:
CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo
CROSS_DOCKER_IN_DOCKER: true
CARGO_TARGET: riscv64gc-unknown-linux-gnu
PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig
PKG_CONFIG_ALLOW_CROSS: true
ENABLE_LLVM: 0
- name: Build C API headless
shell: bash
run: |
make package-capi-headless
env:
CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo
CROSS_DOCKER_IN_DOCKER: true
CARGO_TARGET: riscv64gc-unknown-linux-gnu
PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig
PKG_CONFIG_ALLOW_CROSS: true
ENABLE_LLVM: 0
TARGET: riscv64gc-unknown-linux-gnu
TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release
- name: Build C API
run: |
make build-capi
env:
CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo
CROSS_DOCKER_IN_DOCKER: true
CARGO_TARGET: riscv64gc-unknown-linux-gnu
PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig
PKG_CONFIG_ALLOW_CROSS: true
ENABLE_LLVM: 0
- name: Dist
run: |
make distribution
env:
CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo
CROSS_DOCKER_IN_DOCKER: true
CARGO_TARGET: riscv64gc-unknown-linux-gnu
PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig
PKG_CONFIG_ALLOW_CROSS: true
TARGET: riscv64gc-unknown-linux-gnu
TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: wasmer-linux-riscv64
path: dist
if-no-files-found: error
retention-days: 2
# linux_riscv64:
# name: Linux riscv64
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: dtolnay/rust-toolchain@stable
# with:
# target: riscv64gc-unknown-linux-gnu
# - name: Build cross image
# run: |
# docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/
# env:
# CROSS_DOCKER_IN_DOCKER: true
# - name: Build Wasmer binary
# run: |
# make build-wasmer
# env:
# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo
# CROSS_DOCKER_IN_DOCKER: true
# CARGO_TARGET: riscv64gc-unknown-linux-gnu
# PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig
# PKG_CONFIG_ALLOW_CROSS: true
# ENABLE_LLVM: 0
# - name: Build C API headless
# shell: bash
# run: |
# make package-capi-headless
# env:
# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo
# CROSS_DOCKER_IN_DOCKER: true
# CARGO_TARGET: riscv64gc-unknown-linux-gnu
# PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig
# PKG_CONFIG_ALLOW_CROSS: true
# ENABLE_LLVM: 0
# TARGET: riscv64gc-unknown-linux-gnu
# TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release
# - name: Build C API
# run: |
# make build-capi
# env:
# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo
# CROSS_DOCKER_IN_DOCKER: true
# CARGO_TARGET: riscv64gc-unknown-linux-gnu
# PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig
# PKG_CONFIG_ALLOW_CROSS: true
# ENABLE_LLVM: 0
# - name: Dist
# run: |
# make distribution
# env:
# CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo
# CROSS_DOCKER_IN_DOCKER: true
# CARGO_TARGET: riscv64gc-unknown-linux-gnu
# PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig
# PKG_CONFIG_ALLOW_CROSS: true
# TARGET: riscv64gc-unknown-linux-gnu
# TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release
# - name: Upload Artifacts
# uses: actions/upload-artifact@v4
# with:
# name: wasmer-linux-riscv64
# path: dist
# if-no-files-found: error
# retention-days: 2

release:
# needs: [setup, build, linux_aarch64, windows_gnu, linux_riscv64]
Expand Down Expand Up @@ -753,15 +739,15 @@ jobs:
asset_path: artifacts/wasmer-wasmi-linux-amd64/wasmer.tar.gz
asset_name: wasmer-wasmi-linux-amd64.tar.gz
asset_content_type: application/gzip
# - name: Upload Release Asset Linux aarch64
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: artifacts/wasmer-linux-aarch64/wasmer.tar.gz
# asset_name: wasmer-linux-aarch64.tar.gz
# asset_content_type: application/gzip
- name: Upload Release Asset Linux aarch64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-linux-aarch64/wasmer.tar.gz
asset_name: wasmer-linux-aarch64.tar.gz
asset_content_type: application/gzip
# - name: Upload Release Asset Linux riscv64
# uses: actions/upload-release-asset@v1
# env:
Expand Down Expand Up @@ -790,6 +776,26 @@ jobs:
asset_path: artifacts/wasmer-linux-musl-amd64/wasmer.tar.gz
asset_name: wasmer-linux-musl-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Linux amd64 (musl) With v8
id: upload-release-asset-linux-musl-amd64-v8
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-v8-linux-musl-amd64/wasmer.tar.gz
asset_name: wasmer-v8-linux-musl-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Linux amd64 (musl) With wasmi
id: upload-release-asset-linux-musl-amd64-wasmi
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-wasmi-linux-musl-amd64/wasmer.tar.gz
asset_name: wasmer-wasmi-linux-musl-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Mac amd64
uses: actions/upload-release-asset@v1
env:
Expand Down
Loading
Loading