diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 220db91c3..542fde302 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ env: jobs: test-nightly: - name: Test (${{ contains(matrix.runs-on, 'arm') && 'AArch64' || 'x86_64'}}, ${{ matrix.container }}${{ matrix.test-qemu && ', QEMU' || ''}}) + name: Test Linux (${{ contains(matrix.runs-on, 'arm') && 'AArch64' || 'x86_64'}}, ${{ matrix.container }}${{ matrix.test-qemu && ', QEMU' || ''}}) strategy: matrix: @@ -85,9 +85,10 @@ jobs: - run: cargo test --profile ci --features plugins if: ${{ matrix.test-plugins }} - run: WILD_TEST_CROSS=$WILD_TEST_CROSS cargo test --profile ci --workspace - windows-build: - name: Windows build - runs-on: windows-latest + + riscv-build: + name: Build Linux (RISC-V) + runs-on: ubuntu-24.04 timeout-minutes: 10 steps: - uses: actions/checkout@v6 @@ -95,11 +96,62 @@ jobs: persist-credentials: false - uses: dtolnay/rust-toolchain@stable id: rust-toolchain + with: + targets: riscv64gc-unknown-linux-gnu - uses: Swatinem/rust-cache@v2 - - run: cargo build --profile ci --workspace --no-default-features + - run: sudo apt-get update && sudo apt-get install build-essential lld gcc-riscv64-linux-gnu g++-riscv64-linux-gnu + - run: cp -f .cargo/config.toml.cross-riscv .cargo/config.toml + - run: cargo build --target riscv64gc-unknown-linux-gnu - macos-build: - name: macOS build + loongarch64-build: + name: Build Linux (LoongArch64) + runs-on: ubuntu-24.04 + timeout-minutes: 10 + container: + image: ubuntu:25.10 + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + - run: apt-get update && apt-get install -y build-essential lld gcc gcc-loongarch64-linux-gnu g++-loongarch64-linux-gnu curl + - uses: dtolnay/rust-toolchain@stable + id: rust-toolchain + with: + targets: loongarch64-unknown-linux-gnu + - uses: Swatinem/rust-cache@v2 + - run: cp -f .cargo/config.toml.cross-loongarch64 .cargo/config.toml + - run: cargo build --target loongarch64-unknown-linux-gnu + + wasip1-build: + name: Build wasip1 + runs-on: ubuntu-24.04 + timeout-minutes: 10 + container: + image: ubuntu:25.10 + steps: + - name: Install xz-utils + run: apt-get update && apt-get install -y xz-utils + - name: Setup Wasmtime + uses: bytecodealliance/actions/wasmtime/setup@v1 + with: + version: '43.0.0' + - uses: actions/checkout@v6 + with: + persist-credentials: false + - run: apt-get install --update -y build-essential gcc gcc-multilib clang curl + - uses: dtolnay/rust-toolchain@stable + id: rust-toolchain + with: + targets: wasm32-wasip1 + - uses: Swatinem/rust-cache@v2 + - run: cargo build --target wasm32-wasip1 + - run: cp -f .cargo/config.toml.cross-wasm32p1 .cargo/config.toml + # -p libwild prevents integration tests from running. they depend on + # spawning processes, which isn't supported on wasi. + - run: cargo test --profile ci -p libwild --target wasm32-wasip1 + + macho-build: + name: Test Mach-O (AArch64) runs-on: macos-latest timeout-minutes: 10 steps: @@ -110,6 +162,20 @@ jobs: id: rust-toolchain - uses: Swatinem/rust-cache@v2 - run: cargo build --profile ci --workspace --no-default-features + - run: cargo test --profile ci --workspace + + windows-build: + name: Build Windows (x86_64) + runs-on: windows-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + - uses: dtolnay/rust-toolchain@stable + id: rust-toolchain + - uses: Swatinem/rust-cache@v2 + - run: cargo build --profile ci --workspace --no-default-features minimal-versions: runs-on: ubuntu-24.04 @@ -176,70 +242,6 @@ jobs: - run: echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH" - run: yamlfmt -lint . - riscv-build: - name: RISC-V build - runs-on: ubuntu-24.04 - timeout-minutes: 10 - steps: - - uses: actions/checkout@v6 - with: - persist-credentials: false - - uses: dtolnay/rust-toolchain@stable - id: rust-toolchain - with: - targets: riscv64gc-unknown-linux-gnu - - uses: Swatinem/rust-cache@v2 - - run: sudo apt-get update && sudo apt-get install build-essential lld gcc-riscv64-linux-gnu g++-riscv64-linux-gnu - - run: cp -f .cargo/config.toml.cross-riscv .cargo/config.toml - - run: cargo build --target riscv64gc-unknown-linux-gnu - - loongarch64-build: - name: LoongArch64 build - runs-on: ubuntu-24.04 - timeout-minutes: 10 - container: - image: ubuntu:25.10 - steps: - - uses: actions/checkout@v6 - with: - persist-credentials: false - - run: apt-get update && apt-get install -y build-essential lld gcc gcc-loongarch64-linux-gnu g++-loongarch64-linux-gnu curl - - uses: dtolnay/rust-toolchain@stable - id: rust-toolchain - with: - targets: loongarch64-unknown-linux-gnu - - uses: Swatinem/rust-cache@v2 - - run: cp -f .cargo/config.toml.cross-loongarch64 .cargo/config.toml - - run: cargo build --target loongarch64-unknown-linux-gnu - - wasip1-build: - name: wasip1 build - runs-on: ubuntu-24.04 - timeout-minutes: 10 - container: - image: ubuntu:25.10 - steps: - - name: Install xz-utils - run: apt-get update && apt-get install -y xz-utils - - name: Setup Wasmtime - uses: bytecodealliance/actions/wasmtime/setup@v1 - with: - version: '43.0.0' - - uses: actions/checkout@v6 - with: - persist-credentials: false - - run: apt-get install --update -y build-essential gcc gcc-multilib clang curl - - uses: dtolnay/rust-toolchain@stable - id: rust-toolchain - with: - targets: wasm32-wasip1 - - uses: Swatinem/rust-cache@v2 - - run: cargo build --target wasm32-wasip1 - - run: cp -f .cargo/config.toml.cross-wasm32p1 .cargo/config.toml - # -p libwild prevents integration tests from running. they depend on - # spawning processes, which isn't supported on wasi. - - run: cargo test --profile ci -p libwild --target wasm32-wasip1 - spelling: name: Spell Check with Typos runs-on: ubuntu-24.04 diff --git a/libwild/src/tidy_tests.rs b/libwild/src/tidy_tests.rs index d38cd6aee..038e8f48c 100644 --- a/libwild/src/tidy_tests.rs +++ b/libwild/src/tidy_tests.rs @@ -6,11 +6,13 @@ use crate::error::Result; use std::env; use std::fs::read_dir; use std::path::Path; -use std::process::Command; -use std::process::Stdio; #[test] +#[cfg(target_os = "linux")] fn check_sources_format() -> Result { + use std::process::Command; + use std::process::Stdio; + if std::env::var_os("WILD_TEST_IGNORE_FORMAT").is_some() { return Ok(()); } diff --git a/linker-diff/src/utils.rs b/linker-diff/src/utils.rs index 8be62a248..02a299f96 100644 --- a/linker-diff/src/utils.rs +++ b/linker-diff/src/utils.rs @@ -53,6 +53,7 @@ pub fn decode_insn_with_objdump(insn: &[u8], address: u64, arch: ArchKind) -> Re } #[test] +#[cfg(target_os = "linux")] fn test_align_up() { // Some distributions don't enable the features in objdump required for disassembly of aarch64, // so we only check that we can disassemble if we're running on aarch64 or if test diff --git a/wild/tests/integration_tests.rs b/wild/tests/integration_tests.rs index ddffc4e7e..561458f13 100644 --- a/wild/tests/integration_tests.rs +++ b/wild/tests/integration_tests.rs @@ -284,6 +284,11 @@ fn collect_tests(tests: &mut Vec, filter: &Filter) -> Result { let host_arch = get_host_architecture(); for platform in [PlatformKind::Elf, PlatformKind::MachO] { + // Right now, the Mach-O provided Clang and the ld linker do not support the ELF format. + if platform == PlatformKind::Elf && cfg!(target_os = "macos") { + continue; + } + let linkers = platform.available_linkers()?; let platform_name = platform.to_str(); diff --git a/wild/tests/sources/macho/trivial/trivial.c b/wild/tests/sources/macho/trivial/trivial.c index edc10d7ce..1886d7149 100644 --- a/wild/tests/sources/macho/trivial/trivial.c +++ b/wild/tests/sources/macho/trivial/trivial.c @@ -1,6 +1,7 @@ //#Object:runtime.c //#ExpectSym:_main //#TestUpdateInPlace:true +//#RunEnabled: false #include "../common/runtime.h"