Skip to content

Opt-in busywait mode for futexes (#562) #1419

Opt-in busywait mode for futexes (#562)

Opt-in busywait mode for futexes (#562) #1419

Workflow file for this run

name: CI
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
buildlibc:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env: ${{ matrix.env || fromJSON('{}') }}
strategy:
fail-fast: false
matrix:
include:
# Test a number of operating systems and architectures to make sure
# wasi-libc builds on these platforms by default.
- name: Build on Linux x86_64
os: ubuntu-24.04
clang_version: 16
upload: linux-x86_64-clang-16
- name: Build on Linux aarch64
os: ubuntu-24.04-arm
clang_version: 16
upload: linux-aarch64-clang-16
- name: Build on macOS aarch64
os: macos-15
clang_version: 15.0.7
llvm_asset_suffix: arm64-apple-darwin22.0
upload: macos-clang-15
- name: Build on Windows x86_64
os: windows-2025
clang_version: 16.0.0
upload: windows-clang-16
# Historical versions of LLVM (11.0.0 currently)
- name: Build with LLVM 11
os: ubuntu-22.04
clang_version: 11
upload: linux-x86_64-clang-11
env:
BUILD_LIBSETJMP: no
# Test various combinations of targets triples.
#
# Configuration here can happen through `env` which is inherited to
# jobs below. For now this only runs tests on Linux with Clang 16,
# but that can be expanded as necessary in the future too. Note that
# some targets run the build for the `libc_so` makefile target to
# ensure the PIC build works.
- name: Test wasm32-wasi
os: ubuntu-24.04
clang_version: 16
test: true
upload: wasm32-wasi
env:
TARGET_TRIPLE: wasm32-wasi
MAKE_TARGETS: "default libc_so"
- name: Test wasm32-wasip1
os: ubuntu-24.04
clang_version: 16
test: true
upload: wasm32-wasip1
env:
TARGET_TRIPLE: wasm32-wasip1
MAKE_TARGETS: "default libc_so"
- name: Test wasm32-wasip2
os: ubuntu-24.04
clang_version: 16
test: true
upload: wasm32-wasip2
env:
TARGET_TRIPLE: wasm32-wasip2
WASI_SNAPSHOT: p2
MAKE_TARGETS: "default libc_so"
- name: Test wasm32-wasi-threads
os: ubuntu-24.04
clang_version: 16
test: true
upload: wasm32-wasi-threads
env:
TARGET_TRIPLE: wasm32-wasi-threads
THREAD_MODEL: posix
- name: Test wasm32-wasip1-threads
os: ubuntu-24.04
clang_version: 16
test: true
upload: wasm32-wasip1-threads
env:
TARGET_TRIPLE: wasm32-wasip1-threads
THREAD_MODEL: posix
- name: Test wasm32-wasip1 in V8
os: ubuntu-24.04
clang_version: 16
test: true
test_with_v8: true
env:
TARGET_TRIPLE: wasm32-wasip1
- name: Test wasm32-wasip1-threads in V8
os: ubuntu-24.04
clang_version: 16
test: true
test_with_v8: true
env:
TARGET_TRIPLE: wasm32-wasip1-threads
THREAD_MODEL: posix
steps:
- uses: actions/checkout@v4.1.7
with:
submodules: true
- uses: ./.github/actions/setup
with:
clang_version: ${{ matrix.clang_version }}
llvm_asset_suffix: ${{ matrix.llvm_asset_suffix }}
- name: Build libc
run: make -j4 $MAKE_TARGETS
- name: Download Test dependencies
if: matrix.test
run: cd test && make download
- name: Install V8 dependencies
if: matrix.test_with_v8
run: |
npm -C test/scripts/browser-test install
npx -C test/scripts/browser-test playwright install chromium-headless-shell
echo ENGINE="$PWD/test/scripts/browser-test/harness.mjs" >> $GITHUB_ENV
- name: Test
if: matrix.test
# For Clang linking to work correctly, we need to place Clang's runtime
# library for `wasm32-wasi` in the right location (i.e., the `mkdir` and
# `cp` below).
run: |
cd test
mkdir resource-dir
export WASI_DIR=./resource-dir/lib/wasi/
export WASIP1_DIR=./resource-dir/lib/wasip1/
export WASIP2_DIR=./resource-dir/lib/wasip2/
mkdir -p $WASI_DIR $WASIP1_DIR $WASIP2_DIR
cp build/download/libclang_rt.builtins-wasm32.a $WASI_DIR
cp build/download/libclang_rt.builtins-wasm32.a $WASIP1_DIR
cp build/download/libclang_rt.builtins-wasm32.a $WASIP2_DIR
export LDFLAGS="-resource-dir $(pwd)/resource-dir"
make test
- uses: actions/upload-artifact@v4.4.0
if: matrix.upload
with:
name: ${{ format( 'sysroot-{0}.tgz', matrix.upload) }}
path: sysroot
# Disable the headerstest job for now, while WASI transitions from the
# witx snapshots to wit proposals, and we have a few manual edits to the
# generated header to make life easier for folks.
headerstest:
if: ${{ false }} # Disable the headers test for now.
name: wasi-headers test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-15, windows-2025]
steps:
- uses: actions/checkout@v4.1.7
with:
submodules: true
- name: Install Rust (rustup)
run: rustup update stable --no-self-update && rustup default stable
if: matrix.os != 'macos-15'
- name: Install Rust (macos)
run: |
curl https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
if: matrix.os == 'macos-15'
- run: cargo fetch
working-directory: tools/wasi-headers
- run: cargo build
working-directory: tools/wasi-headers
- run: cargo test
working-directory: tools/wasi-headers
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.7
with:
submodules: true
- name: Install Rust
run: rustup update stable && rustup default stable && rustup component add rustfmt
- run: cargo fmt -- --check
working-directory: tools/wasi-headers