From 4129cad357a75c2312a725c2946b1f80708f6f30 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Thu, 14 Aug 2025 05:38:06 +0300 Subject: [PATCH 1/8] MD5: simplify test to be usable under miri --- src/misc/md5/md5/tests.rs | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/misc/md5/md5/tests.rs b/src/misc/md5/md5/tests.rs index 02a4798..9e5cdd0 100644 --- a/src/misc/md5/md5/tests.rs +++ b/src/misc/md5/md5/tests.rs @@ -293,19 +293,14 @@ fn full_test() { #[test] fn in_parts_test() { - for testcase in TESTCASES { - let rest = testcase.slice; - for len0 in 0..rest.len() { - let (part_0, rest) = rest.split_at(len0); - for len1 in 0..rest.len() { - let (part_1, rest) = rest.split_at(len1); - let mut hasher = MD5::default(); - hasher.extend(part_0); - hasher.extend(part_1); - hasher.extend(rest); - assert_eq!(hasher.flush(), testcase.state); - } - } + let testcase = TESTCASES.iter().max_by_key(|c| c.slice.len()).unwrap(); + let rest = testcase.slice; + for len0 in 0..rest.len() { + let (part_0, rest) = rest.split_at(len0); + let mut hasher = MD5::default(); + hasher.extend(part_0); + hasher.extend(rest); + assert_eq!(hasher.flush(), testcase.state); } } From b34a62051d92182abfc5eb8bdbec0071f081fcf4 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Thu, 14 Aug 2025 05:47:32 +0300 Subject: [PATCH 2/8] variable length load: simplify test to be usable under miri --- src/memory/variable_length_load/variable_length_load/tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/memory/variable_length_load/variable_length_load/tests.rs b/src/memory/variable_length_load/variable_length_load/tests.rs index 5b5ab26..eb8851b 100644 --- a/src/memory/variable_length_load/variable_length_load/tests.rs +++ b/src/memory/variable_length_load/variable_length_load/tests.rs @@ -45,7 +45,7 @@ fn basic_test() { #[test] fn exhaustive_test() { - for input_length in 0..=64_usize { + for input_length in 0..=8_usize { let mut res: Vec = vec![]; for i in 0..input_length { res.push((1 + i).try_into().unwrap()); From 8edf3586e2dd7baef1ea5aec1224c0c22244bb39 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Thu, 14 Aug 2025 05:52:44 +0300 Subject: [PATCH 3/8] extract bits test: make usable with miri --- src/common/common/tests.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/common/tests.rs b/src/common/common/tests.rs index f3fdcbf..53d2f88 100644 --- a/src/common/common/tests.rs +++ b/src/common/common/tests.rs @@ -114,7 +114,7 @@ fn extract_high_bits_allones_input_test() { } #[test] -fn extract_high_bits_input_test() { +fn extract_high_bits_input_exhaustive_test() { macro_rules! test { ($($t:ty)+) => { $( @@ -133,7 +133,7 @@ fn extract_high_bits_input_test() { } test!(u8); - test!(u16); + // test!(u16); // test!(u32); // test!(u64); } @@ -265,7 +265,7 @@ fn extract_low_bits_allones_input_test() { } #[test] -fn extract_low_bits_input_test() { +fn extract_low_bits_input_exhaustive_test() { macro_rules! test { ($($t:ty)+) => { $( @@ -285,7 +285,7 @@ fn extract_low_bits_input_test() { } test!(u8); - test!(u16); + // test!(u16); // test!(u32); // test!(u64); } From f9677b925b8c80462bb8cbb81a0351a2f46991c0 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Thu, 14 Aug 2025 06:53:56 +0300 Subject: [PATCH 4/8] Rewrite test ignore for miri --- src/memory/layoutfulbox/layoutfulbox/tests.rs | 8 ++------ .../nd-slice-procurement/ndsliceprocurement/tests.rs | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/memory/layoutfulbox/layoutfulbox/tests.rs b/src/memory/layoutfulbox/layoutfulbox/tests.rs index 9fdfd76..e6a310c 100644 --- a/src/memory/layoutfulbox/layoutfulbox/tests.rs +++ b/src/memory/layoutfulbox/layoutfulbox/tests.rs @@ -110,12 +110,8 @@ fn usable_0xu8_test() { #[test] #[cfg_attr( - miri, - ignore = "miri fails with: miri resource exhaustion: tried to allocate more memory than available to compiler" -)] -#[cfg_attr( - not(target_pointer_width = "64"), - ignore = "iff isize === i32, allocation of isize::MAX can succeed, we don't want that" + any(not(target_pointer_width = "64"), miri), + ignore = "this test only makes sense for ridiculous allocations sizes (1PB+?), but at the same time requires native compilation (i.e. no interpreters/sanitizers)" )] fn usable_max_test() { assert_eq!( diff --git a/src/memory/nd-slice-procurement/ndsliceprocurement/tests.rs b/src/memory/nd-slice-procurement/ndsliceprocurement/tests.rs index ba259af..9d50e2a 100644 --- a/src/memory/nd-slice-procurement/ndsliceprocurement/tests.rs +++ b/src/memory/nd-slice-procurement/ndsliceprocurement/tests.rs @@ -223,12 +223,8 @@ fn basic_u8_test() { #[test] #[cfg_attr( - miri, - ignore = "miri fails with: miri resource exhaustion: tried to allocate more memory than available to compiler" -)] -#[cfg_attr( - not(target_pointer_width = "64"), - ignore = "iff isize === i32, allocation of isize::MAX can succeed, we don't want that" + any(not(target_pointer_width = "64"), miri), + ignore = "this test only makes sense for ridiculous allocations sizes (1PB+?), but at the same time requires native compilation (i.e. no interpreters/sanitizers)" )] fn usable_max_test() { assert_eq!( From 3c822dedac636a24bbdba71c6f2165f25a229f6f Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Thu, 14 Aug 2025 06:03:30 +0300 Subject: [PATCH 5/8] CI: consolidate rustup stuff --- .github/workflows/CI-linux.yml | 53 ++++++++++++++++++++++++---------- .github/workflows/CI-macOS.yml | 49 ++++++++++++++++++++++--------- 2 files changed, 74 insertions(+), 28 deletions(-) diff --git a/.github/workflows/CI-linux.yml b/.github/workflows/CI-linux.yml index be292e3..8e90dd3 100644 --- a/.github/workflows/CI-linux.yml +++ b/.github/workflows/CI-linux.yml @@ -61,6 +61,8 @@ jobs: timeout-minutes: 1 run: | set -xe + WITH_CODE_COVERAGE=${{ env.CODE_COVERAGE_SUPPORTED == 'true' && (inputs.builder-host == inputs.builder-target || (env.ENDIANNESS == 'big' && inputs.builder-target != 's390x')) && (github.event_name == 'pull_request' || env.CODECOV_TOKEN_EXISTS == 'true') }} + echo "WITH_CODE_COVERAGE=$(echo ${WITH_CODE_COVERAGE})" >> $GITHUB_ENV if [ "${{ inputs.builder-target }}" = "x86_64" ] \ || [ "${{ inputs.builder-target }}" = "aarch64" ] \ || [ "${{ inputs.builder-target }}" = "i686" ] \ @@ -271,32 +273,53 @@ jobs: eatmydata apt install ${{ env.PACKAGES }} eatmydata apt clean rm -rf /var/lib/apt/lists/* - - name: Install Rust toolchain and targets - timeout-minutes: 1 + - name: Install Rust toolchain and targets and crates + timeout-minutes: 3 run: | set -xe + RUST_COMPONENTS="" + RUST_CRATES="" eatmydata curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y . "$HOME/.cargo/env" eatmydata rustup toolchain install ${{ inputs.rust-toolchain-name }} --allow-downgrade --profile minimal eatmydata rustup default ${{ inputs.rust-toolchain-name }} eatmydata rustup target add ${{ env.RUST_TARGET }} if [ "${{ inputs.flavor }}" = "RustFmt" ]; then - eatmydata rustup component add rustfmt + RUST_COMPONENTS="${RUST_COMPONENTS} \ + rustfmt \ + " elif [ "${{ inputs.flavor }}" = "doc" ]; then /bin/true elif [ "${{ inputs.flavor }}" = "dev" ] || [ "${{ inputs.flavor }}" = "release" ]; then - eatmydata rustup component add clippy + RUST_COMPONENTS="${RUST_COMPONENTS} \ + clippy \ + " else exit 1 fi - - name: Install necessary Rust packages for code coverage - if: env.CODE_COVERAGE_SUPPORTED == 'true' && (inputs.builder-host == inputs.builder-target || (env.ENDIANNESS == 'big' && inputs.builder-target != 's390x')) && (github.event_name == 'pull_request' || env.CODECOV_TOKEN_EXISTS == 'true') - timeout-minutes: 2 - run: | - set -xe - . "$HOME/.cargo/env" - eatmydata rustup component add llvm-tools-preview - eatmydata cargo install cargo-llvm-cov + if [ "${{ env.WITH_CODE_COVERAGE }}" = "true" ]; then + RUST_COMPONENTS="${RUST_COMPONENTS} \ + llvm-tools-preview \ + " + RUST_CRATES="${RUST_CRATES} \ + cargo-llvm-cov \ + " + fi + if [ "${{ env.WITH_MIRI }}" = "true" ]; then + RUST_COMPONENTS="${RUST_COMPONENTS} \ + rust-src \ + miri \ + " + RUST_CRATES="${RUST_CRATES} \ + cargo-nextest \ + " + fi + if [ "${RUST_COMPONENTS}" != "" ]; then + eatmydata rustup component add ${RUST_COMPONENTS} + fi + if [ "${RUST_CRATES}" != "" ]; then + eatmydata cargo install ${RUST_CRATES} + fi - name: Fetch/Checkout msvc-wine git repo timeout-minutes: 1 if: inputs.target-os == 'windows' && inputs.rust-toolchain-abi == 'msvc' @@ -400,7 +423,7 @@ jobs: cargo test --target ${{ env.RUST_TARGET }} --profile ${{ inputs.flavor }} - name: Run tests to collect code coverage timeout-minutes: 2 - if: env.CODE_COVERAGE_SUPPORTED == 'true' && (inputs.builder-host == inputs.builder-target || (env.ENDIANNESS == 'big' && inputs.builder-target != 's390x')) && (github.event_name == 'pull_request' || env.CODECOV_TOKEN_EXISTS == 'true') + if: env.WITH_CODE_COVERAGE == 'true' env: RUSTFLAGS: "-C instrument-coverage" run: | @@ -411,7 +434,7 @@ jobs: cargo llvm-cov --no-report --target ${{ env.RUST_TARGET }} --profile ${{ inputs.flavor }} - name: Aggregate code coverage timeout-minutes: 1 - if: env.CODE_COVERAGE_SUPPORTED == 'true' && (inputs.builder-host == inputs.builder-target || (env.ENDIANNESS == 'big' && inputs.builder-target != 's390x')) && (github.event_name == 'pull_request' || env.CODECOV_TOKEN_EXISTS == 'true') + if: env.WITH_CODE_COVERAGE == 'true' run: | set -xe . "$HOME/.cargo/env" @@ -419,7 +442,7 @@ jobs: cargo llvm-cov report --codecov --output-path $SRC_DIR/codecov.json --target ${{ env.RUST_TARGET }} --profile ${{ inputs.flavor }} - name: Upload coverage reports to Codecov timeout-minutes: 1 - if: env.CODE_COVERAGE_SUPPORTED == 'true' && (inputs.builder-host == inputs.builder-target || (env.ENDIANNESS == 'big' && inputs.builder-target != 's390x')) && (github.event_name == 'pull_request' || env.CODECOV_TOKEN_EXISTS == 'true') + if: env.WITH_CODE_COVERAGE == 'true' uses: codecov/codecov-action@v5 env: OS: ${{ inputs.os }} diff --git a/.github/workflows/CI-macOS.yml b/.github/workflows/CI-macOS.yml index 5d12c3a..0a812a8 100644 --- a/.github/workflows/CI-macOS.yml +++ b/.github/workflows/CI-macOS.yml @@ -38,6 +38,12 @@ jobs: name: ${{ inputs.runs-on }}, XCode ${{ inputs.xcode-version }}, Rust ${{ inputs.rust-toolchain-name }}, profile ${{ inputs.flavor }} runs-on: ${{ inputs.runs-on }} steps: + - name: Configure necessary env variables + timeout-minutes: 1 + run: | + set -xe + WITH_CODE_COVERAGE=${{ github.event_name == 'pull_request' || env.CODECOV_TOKEN_EXISTS == 'true' }} + echo "WITH_CODE_COVERAGE=$(echo ${WITH_CODE_COVERAGE})" >> $GITHUB_ENV - name: Fetch/Checkout RawSpeed.RS git repo timeout-minutes: 1 uses: actions/checkout@v4 @@ -54,21 +60,38 @@ jobs: brew autoremove --quiet brew cleanup --quiet --prune=all - name: Install Rust - timeout-minutes: 1 + timeout-minutes: 4 run: | set -xe curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y rustup toolchain install ${{ inputs.rust-toolchain-name }} --allow-downgrade --profile minimal rustup default ${{ inputs.rust-toolchain-name }} - rustup component add clippy - - name: Install necessary packages for code coverage - if: github.event_name == 'pull_request' || env.CODECOV_TOKEN_EXISTS == 'true' - timeout-minutes: 3 - run: | - set -xe - . "$HOME/.cargo/env" - rustup component add llvm-tools-preview - cargo install cargo-llvm-cov + RUST_COMPONENTS="${RUST_COMPONENTS} \ + clippy \ + " + if [ "${{ env.WITH_CODE_COVERAGE }}" = "true" ]; then + RUST_COMPONENTS="${RUST_COMPONENTS} \ + llvm-tools-preview \ + " + RUST_CRATES="${RUST_CRATES} \ + cargo-llvm-cov \ + " + fi + if [ "${{ env.WITH_MIRI }}" = "true" ]; then + RUST_COMPONENTS="${RUST_COMPONENTS} \ + rust-src \ + miri \ + " + RUST_CRATES="${RUST_CRATES} \ + cargo-nextest \ + " + fi + if [ "${RUST_COMPONENTS}" != "" ]; then + rustup component add ${RUST_COMPONENTS} + fi + if [ "${RUST_CRATES}" != "" ]; then + cargo install ${RUST_CRATES} + fi - name: Run cargo check timeout-minutes: 1 run: | @@ -99,7 +122,7 @@ jobs: cargo test --profile ${{ inputs.flavor }} - name: Run tests to collect code coverage timeout-minutes: 1 - if: github.event_name == 'pull_request' || env.CODECOV_TOKEN_EXISTS == 'true' + if: env.WITH_CODE_COVERAGE == 'true' env: RUSTFLAGS: "-C instrument-coverage" run: | @@ -110,7 +133,7 @@ jobs: cargo llvm-cov --no-report --profile ${{ inputs.flavor }} - name: Aggregate code coverage timeout-minutes: 1 - if: github.event_name == 'pull_request' || env.CODECOV_TOKEN_EXISTS == 'true' + if: env.WITH_CODE_COVERAGE == 'true' run: | set -xe . "$HOME/.cargo/env" @@ -118,7 +141,7 @@ jobs: cargo llvm-cov report --codecov --output-path $SRC_DIR/codecov.json --profile ${{ inputs.flavor }} - name: Upload coverage reports to Codecov timeout-minutes: 1 - if: github.event_name == 'pull_request' || env.CODECOV_TOKEN_EXISTS == 'true' + if: env.WITH_CODE_COVERAGE == 'true' uses: codecov/codecov-action@v5 env: OS: ${{ inputs.os }} From 0a437c06bb2f1fb759abfa0586423717d95d69be Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Thu, 14 Aug 2025 18:09:02 +0300 Subject: [PATCH 6/8] CI: run tests under Miri --- .github/workflows/CI-linux.yml | 11 ++++++++++- .github/workflows/CI-macOS.yml | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI-linux.yml b/.github/workflows/CI-linux.yml index 8e90dd3..8f5b4e1 100644 --- a/.github/workflows/CI-linux.yml +++ b/.github/workflows/CI-linux.yml @@ -43,6 +43,7 @@ on: env: DEBIAN_FRONTEND: noninteractive RUSTFLAGS: "-Dwarnings" + WITH_MIRI: ${{ inputs.rust-toolchain-name == 'nightly' && inputs.flavor == 'dev' && inputs.builder-target != 'riscv64' }} SRC_DIR: ${{ github.workspace }}/rawspeed.rs CODECOV_TOKEN_EXISTS: ${{ secrets.CODECOV_TOKEN != '' }} CODE_COVERAGE_SUPPORTED: ${{ inputs.flavor != 'RustFmt' && inputs.flavor != 'doc' && (inputs.target-os != 'windows' || inputs.rust-toolchain-abi == 'msvc') }} @@ -274,7 +275,7 @@ jobs: eatmydata apt clean rm -rf /var/lib/apt/lists/* - name: Install Rust toolchain and targets and crates - timeout-minutes: 3 + timeout-minutes: 4 run: | set -xe RUST_COMPONENTS="" @@ -458,6 +459,14 @@ jobs: files: ${{ env.SRC_DIR }}/codecov.json root_dir: ${{ env.SRC_DIR }} fail_ci_if_error: true + - name: Run tests under Miri + timeout-minutes: 10 + if: env.WITH_MIRI == 'true' + run: | + set -xe + . "$HOME/.cargo/env" + cd "$SRC_DIR" + cargo miri nextest run --target ${{ env.RUST_TARGET }} - name: Build docs timeout-minutes: 1 if: inputs.flavor == 'doc' diff --git a/.github/workflows/CI-macOS.yml b/.github/workflows/CI-macOS.yml index 0a812a8..627a152 100644 --- a/.github/workflows/CI-macOS.yml +++ b/.github/workflows/CI-macOS.yml @@ -30,6 +30,7 @@ on: env: RUSTFLAGS: "-Dwarnings" + WITH_MIRI: ${{ inputs.rust-toolchain-name == 'nightly' && inputs.flavor == 'dev' }} SRC_DIR: ${{ github.workspace }}/rawspeed.rs CODECOV_TOKEN_EXISTS: ${{ secrets.CODECOV_TOKEN != '' }} @@ -60,7 +61,7 @@ jobs: brew autoremove --quiet brew cleanup --quiet --prune=all - name: Install Rust - timeout-minutes: 4 + timeout-minutes: 7 run: | set -xe curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y @@ -158,3 +159,11 @@ jobs: files: ${{ env.SRC_DIR }}/codecov.json root_dir: ${{ env.SRC_DIR }} fail_ci_if_error: true + - name: Run tests under Miri + timeout-minutes: 10 + if: env.WITH_MIRI == 'true' + run: | + set -xe + . "$HOME/.cargo/env" + cd "$SRC_DIR" + cargo miri nextest run From b55ed93905f9e6db32ad55239f3f230c1284b136 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Thu, 14 Aug 2025 18:24:09 +0300 Subject: [PATCH 7/8] CI: reshuffle job order --- .github/workflows/CI.yml | 153 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 141 insertions(+), 12 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 4effafb..926f804 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -11,18 +11,22 @@ concurrency: cancel-in-progress: true jobs: - linux-fast: + linux-fast-native: strategy: fail-fast: false matrix: os: [ linux ] stack: - - { runs-on: "ubuntu-latest", host: "x86_64", target: "x86_64", vendor: "unknown", os: "linux", abi: "gnu" } - - { runs-on: "ubuntu-24.04-arm", host: "aarch64", target: "aarch64", vendor: "unknown", os: "linux", abi: "gnu" } + - { runs-on: "ubuntu-latest", host: "x86_64", target: "x86_64", vendor: "unknown", os: "linux", abi: "gnu" } + - { runs-on: "ubuntu-24.04-arm", host: "aarch64", target: "aarch64", vendor: "unknown", os: "linux", abi: "gnu" } + - { runs-on: "ubuntu-latest", host: "x86_64", target: "i686", vendor: "unknown", os: "linux", abi: "gnu" } distro: - { image: "debian:trixie-slim", LLVM: 19 } rust-toolchain-name: [ stable, nightly ] flavor: [ dev, release ] + exclude: + - rust-toolchain-name: nightly + flavor: dev uses: ./.github/workflows/CI-linux.yml with: os: ${{ matrix.os }} @@ -38,7 +42,41 @@ jobs: flavor: ${{ matrix.flavor }} secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - windows-cross: + linux-fast-cross: + strategy: + fail-fast: false + matrix: + os: [ linux ] + stack: + - { runs-on: "ubuntu-24.04-arm", host: "aarch64", target: "armv6", vendor: "unknown", os: "linux", abi: "gnueabi" } + - { runs-on: "ubuntu-24.04-arm", host: "aarch64", target: "armv7", vendor: "unknown", os: "linux", abi: "gnueabihf" } + - { runs-on: "ubuntu-latest", host: "x86_64", target: "powerpc64", vendor: "unknown", os: "linux", abi: "gnu" } + - { runs-on: "ubuntu-latest", host: "x86_64", target: "powerpc64le", vendor: "unknown", os: "linux", abi: "gnu" } + - { runs-on: "ubuntu-latest", host: "x86_64", target: "s390x", vendor: "unknown", os: "linux", abi: "gnu" } + - { runs-on: "ubuntu-latest", host: "x86_64", target: "riscv64", vendor: "unknown", os: "linux", abi: "gnu" } + distro: + - { image: "debian:trixie-slim", LLVM: 19 } + rust-toolchain-name: [ stable, nightly ] + flavor: [ dev, release ] + exclude: + - rust-toolchain-name: nightly + flavor: dev + uses: ./.github/workflows/CI-linux.yml + with: + os: ${{ matrix.os }} + runs-on: ${{ matrix.stack.runs-on }} + builder-host: ${{ matrix.stack.host }} + builder-target: ${{ matrix.stack.target }} + target-vendor: ${{ matrix.stack.vendor }} + target-os: ${{ matrix.stack.os }} + rust-toolchain-abi: ${{ matrix.stack.abi }} + distro-image: ${{ matrix.distro.image }} + distro-LLVM: ${{ matrix.distro.LLVM }} + rust-toolchain-name: ${{ matrix.rust-toolchain-name }} + flavor: ${{ matrix.flavor }} + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + windows-fast: strategy: fail-fast: false matrix: @@ -53,6 +91,8 @@ jobs: rust-toolchain-name: [ stable, nightly ] flavor: [ dev, release ] exclude: + - rust-toolchain-name: nightly + flavor: dev - stack: { runs-on: "ubuntu-24.04-arm", host: "aarch64", target: "aarch64", vendor: "pc", os: "windows" } abi: gnu - stack: { runs-on: "ubuntu-latest", host: "x86_64", target: "i686", vendor: "pc", os: "windows" } @@ -72,14 +112,66 @@ jobs: flavor: ${{ matrix.flavor }} secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - linux-cross: - needs: [ linux-fast, windows-cross, macOS-fast ] + macOS-fast: + strategy: + fail-fast: false + matrix: + compiler: + - { os: macos, os-ver: 15, host: "aarch64", target: "aarch64", XCode: 16.3, LLVM: 19 } + - { os: macos, os-ver: 13, host: "x86_64", target: "x86_64", XCode: 15.2, LLVM: 16 } + rust-toolchain-name: [ stable, nightly ] + flavor: [ dev, release ] + exclude: + - rust-toolchain-name: nightly + flavor: dev + uses: ./.github/workflows/CI-macOS.yml + with: + os: ${{ matrix.compiler.os }} + runs-on: ${{ matrix.compiler.os }}-${{ matrix.compiler.os-ver }} + builder-host: ${{ matrix.compiler.host }} + builder-target: ${{ matrix.compiler.target }} + xcode-version: ${{ matrix.compiler.XCode }} + LLVM_VER: ${{ matrix.compiler.LLVM }} + rust-toolchain-name: ${{ matrix.rust-toolchain-name }} + flavor: ${{ matrix.flavor }} + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + linux-slow-native: + needs: [ linux-fast-native, linux-fast-cross, windows-fast, macOS-fast ] strategy: fail-fast: false matrix: os: [ linux ] stack: + - { runs-on: "ubuntu-latest", host: "x86_64", target: "x86_64", vendor: "unknown", os: "linux", abi: "gnu" } + - { runs-on: "ubuntu-24.04-arm", host: "aarch64", target: "aarch64", vendor: "unknown", os: "linux", abi: "gnu" } - { runs-on: "ubuntu-latest", host: "x86_64", target: "i686", vendor: "unknown", os: "linux", abi: "gnu" } + distro: + - { image: "debian:trixie-slim", LLVM: 19 } + rust-toolchain-name: [ nightly ] + flavor: [ dev ] + uses: ./.github/workflows/CI-linux.yml + with: + os: ${{ matrix.os }} + runs-on: ${{ matrix.stack.runs-on }} + builder-host: ${{ matrix.stack.host }} + builder-target: ${{ matrix.stack.target }} + target-vendor: ${{ matrix.stack.vendor }} + target-os: ${{ matrix.stack.os }} + rust-toolchain-abi: ${{ matrix.stack.abi }} + distro-image: ${{ matrix.distro.image }} + distro-LLVM: ${{ matrix.distro.LLVM }} + rust-toolchain-name: ${{ matrix.rust-toolchain-name }} + flavor: ${{ matrix.flavor }} + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + linux-slow-cross: + needs: [ linux-fast-native, linux-fast-cross, windows-fast, macOS-fast ] + strategy: + fail-fast: false + matrix: + os: [ linux ] + stack: - { runs-on: "ubuntu-24.04-arm", host: "aarch64", target: "armv6", vendor: "unknown", os: "linux", abi: "gnueabi" } - { runs-on: "ubuntu-24.04-arm", host: "aarch64", target: "armv7", vendor: "unknown", os: "linux", abi: "gnueabihf" } - { runs-on: "ubuntu-latest", host: "x86_64", target: "powerpc64", vendor: "unknown", os: "linux", abi: "gnu" } @@ -88,8 +180,8 @@ jobs: - { runs-on: "ubuntu-latest", host: "x86_64", target: "riscv64", vendor: "unknown", os: "linux", abi: "gnu" } distro: - { image: "debian:trixie-slim", LLVM: 19 } - rust-toolchain-name: [ stable, nightly ] - flavor: [ dev, release ] + rust-toolchain-name: [ nightly ] + flavor: [ dev ] uses: ./.github/workflows/CI-linux.yml with: os: ${{ matrix.os }} @@ -105,15 +197,51 @@ jobs: flavor: ${{ matrix.flavor }} secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - macOS-fast: + windows-slow: + needs: [ linux-fast-native, linux-fast-cross, windows-fast, macOS-fast ] + strategy: + fail-fast: false + matrix: + os: [ linux ] + stack: + - { runs-on: "ubuntu-latest", host: "x86_64", target: "x86_64", vendor: "pc", os: "windows" } + - { runs-on: "ubuntu-latest", host: "x86_64", target: "i686", vendor: "pc", os: "windows" } + - { runs-on: "ubuntu-24.04-arm", host: "aarch64", target: "aarch64", vendor: "pc", os: "windows" } + distro: + - { image: "debian:trixie-slim", LLVM: 19 } + abi: [ gnu, msvc ] + rust-toolchain-name: [ nightly ] + flavor: [ dev ] + exclude: + - stack: { runs-on: "ubuntu-24.04-arm", host: "aarch64", target: "aarch64", vendor: "pc", os: "windows" } + abi: gnu + - stack: { runs-on: "ubuntu-latest", host: "x86_64", target: "i686", vendor: "pc", os: "windows" } + abi: msvc + uses: ./.github/workflows/CI-linux.yml + with: + os: ${{ matrix.os }} + runs-on: ${{ matrix.stack.runs-on }} + builder-host: ${{ matrix.stack.host }} + builder-target: ${{ matrix.stack.target }} + target-vendor: ${{ matrix.stack.vendor }} + target-os: ${{ matrix.stack.os }} + rust-toolchain-abi: ${{ matrix.abi }} + distro-image: ${{ matrix.distro.image }} + distro-LLVM: ${{ matrix.distro.LLVM }} + rust-toolchain-name: ${{ matrix.rust-toolchain-name }} + flavor: ${{ matrix.flavor }} + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + macOS-slow: + needs: [ linux-fast-native, linux-fast-cross, windows-fast, macOS-fast ] strategy: fail-fast: false matrix: compiler: - { os: macos, os-ver: 15, host: "aarch64", target: "aarch64", XCode: 16.3, LLVM: 19 } - { os: macos, os-ver: 13, host: "x86_64", target: "x86_64", XCode: 15.2, LLVM: 16 } - rust-toolchain-name: [ stable, nightly ] - flavor: [ dev, release ] + rust-toolchain-name: [ nightly ] + flavor: [ dev ] uses: ./.github/workflows/CI-macOS.yml with: os: ${{ matrix.compiler.os }} @@ -127,7 +255,8 @@ jobs: secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} build-docs: - needs: [ linux-fast, windows-cross, linux-cross, macOS-fast ] + needs: [ linux-fast-native, linux-fast-cross, windows-fast, macOS-fast, + linux-slow-native, linux-slow-cross, windows-slow, macOS-slow] uses: ./.github/workflows/CI-linux.yml with: os: linux From 45f241b2bedf83f72a55805f02c6bb34165aef27 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Thu, 14 Aug 2025 23:24:49 +0300 Subject: [PATCH 8/8] CI: macos support is best-effort, don't bother with anything special --- .github/workflows/CI-macOS.yml | 20 +----------------- .github/workflows/CI.yml | 37 ++++++---------------------------- 2 files changed, 7 insertions(+), 50 deletions(-) diff --git a/.github/workflows/CI-macOS.yml b/.github/workflows/CI-macOS.yml index 627a152..d62c189 100644 --- a/.github/workflows/CI-macOS.yml +++ b/.github/workflows/CI-macOS.yml @@ -30,7 +30,6 @@ on: env: RUSTFLAGS: "-Dwarnings" - WITH_MIRI: ${{ inputs.rust-toolchain-name == 'nightly' && inputs.flavor == 'dev' }} SRC_DIR: ${{ github.workspace }}/rawspeed.rs CODECOV_TOKEN_EXISTS: ${{ secrets.CODECOV_TOKEN != '' }} @@ -61,7 +60,7 @@ jobs: brew autoremove --quiet brew cleanup --quiet --prune=all - name: Install Rust - timeout-minutes: 7 + timeout-minutes: 4 run: | set -xe curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y @@ -78,15 +77,6 @@ jobs: cargo-llvm-cov \ " fi - if [ "${{ env.WITH_MIRI }}" = "true" ]; then - RUST_COMPONENTS="${RUST_COMPONENTS} \ - rust-src \ - miri \ - " - RUST_CRATES="${RUST_CRATES} \ - cargo-nextest \ - " - fi if [ "${RUST_COMPONENTS}" != "" ]; then rustup component add ${RUST_COMPONENTS} fi @@ -159,11 +149,3 @@ jobs: files: ${{ env.SRC_DIR }}/codecov.json root_dir: ${{ env.SRC_DIR }} fail_ci_if_error: true - - name: Run tests under Miri - timeout-minutes: 10 - if: env.WITH_MIRI == 'true' - run: | - set -xe - . "$HOME/.cargo/env" - cd "$SRC_DIR" - cargo miri nextest run diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 926f804..dbb651a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -112,7 +112,7 @@ jobs: flavor: ${{ matrix.flavor }} secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - macOS-fast: + macOS: strategy: fail-fast: false matrix: @@ -121,9 +121,6 @@ jobs: - { os: macos, os-ver: 13, host: "x86_64", target: "x86_64", XCode: 15.2, LLVM: 16 } rust-toolchain-name: [ stable, nightly ] flavor: [ dev, release ] - exclude: - - rust-toolchain-name: nightly - flavor: dev uses: ./.github/workflows/CI-macOS.yml with: os: ${{ matrix.compiler.os }} @@ -137,7 +134,7 @@ jobs: secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} linux-slow-native: - needs: [ linux-fast-native, linux-fast-cross, windows-fast, macOS-fast ] + needs: [ linux-fast-native, linux-fast-cross, windows-fast, macOS ] strategy: fail-fast: false matrix: @@ -166,7 +163,7 @@ jobs: secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} linux-slow-cross: - needs: [ linux-fast-native, linux-fast-cross, windows-fast, macOS-fast ] + needs: [ linux-fast-native, linux-fast-cross, windows-fast, macOS ] strategy: fail-fast: false matrix: @@ -198,7 +195,7 @@ jobs: secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} windows-slow: - needs: [ linux-fast-native, linux-fast-cross, windows-fast, macOS-fast ] + needs: [ linux-fast-native, linux-fast-cross, windows-fast, macOS ] strategy: fail-fast: false matrix: @@ -232,31 +229,9 @@ jobs: flavor: ${{ matrix.flavor }} secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - macOS-slow: - needs: [ linux-fast-native, linux-fast-cross, windows-fast, macOS-fast ] - strategy: - fail-fast: false - matrix: - compiler: - - { os: macos, os-ver: 15, host: "aarch64", target: "aarch64", XCode: 16.3, LLVM: 19 } - - { os: macos, os-ver: 13, host: "x86_64", target: "x86_64", XCode: 15.2, LLVM: 16 } - rust-toolchain-name: [ nightly ] - flavor: [ dev ] - uses: ./.github/workflows/CI-macOS.yml - with: - os: ${{ matrix.compiler.os }} - runs-on: ${{ matrix.compiler.os }}-${{ matrix.compiler.os-ver }} - builder-host: ${{ matrix.compiler.host }} - builder-target: ${{ matrix.compiler.target }} - xcode-version: ${{ matrix.compiler.XCode }} - LLVM_VER: ${{ matrix.compiler.LLVM }} - rust-toolchain-name: ${{ matrix.rust-toolchain-name }} - flavor: ${{ matrix.flavor }} - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} build-docs: - needs: [ linux-fast-native, linux-fast-cross, windows-fast, macOS-fast, - linux-slow-native, linux-slow-cross, windows-slow, macOS-slow] + needs: [ linux-fast-native, linux-fast-cross, windows-fast, macOS, + linux-slow-native, linux-slow-cross, windows-slow] uses: ./.github/workflows/CI-linux.yml with: os: linux