Skip to content

Various CI and Testing enhancements #1776

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

Merged
merged 12 commits into from
Apr 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
92 changes: 50 additions & 42 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,6 @@ jobs:
run: rustup update nightly --no-self-update && rustup default nightly
- run: cargo test --manifest-path crates/stdarch-verify/Cargo.toml

env_override:
name: Env Override
needs: [style]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly --no-self-update && rustup default nightly
- run: RUST_STD_DETECT_UNSTABLE=avx cargo test --features=std_detect_env_override --manifest-path crates/std_detect/Cargo.toml env_override_no_avx
shell: bash

test:
needs: [style]
name: Test
Expand All @@ -64,8 +50,6 @@ jobs:
os: ubuntu-latest
- tuple: x86_64-unknown-linux-gnu
os: ubuntu-latest
- tuple: x86_64-unknown-linux-gnu-emulated
os: ubuntu-latest
- tuple: arm-unknown-linux-gnueabihf
os: ubuntu-latest
- tuple: armv7-unknown-linux-gnueabihf
Expand All @@ -76,6 +60,8 @@ jobs:
os: ubuntu-latest
- tuple: powerpc-unknown-linux-gnu
os: ubuntu-latest
- tuple: powerpc64-unknown-linux-gnu
os: ubuntu-latest
- tuple: powerpc64le-unknown-linux-gnu
os: ubuntu-latest
# MIPS targets disabled since they are dropped to tier 3.
Expand Down Expand Up @@ -109,36 +95,71 @@ jobs:

# macOS targets
- tuple: x86_64-apple-darwin
os: macos-13
os: macos-15-large
- tuple: x86_64-apple-ios-macabi
os: macos-13
os: macos-15-large
- tuple: aarch64-apple-darwin
os: macos-latest
os: macos-15
- tuple: aarch64-apple-ios-macabi
os: macos-latest
os: macos-15
# FIXME: gh-actions build environment doesn't have linker support
# - tuple: i686-apple-darwin
# os: macos-13

# Windows targets
- tuple: x86_64-pc-windows-msvc
os: windows-latest
os: windows-2025
- tuple: i686-pc-windows-msvc
os: windows-latest
os: windows-2025
- tuple: aarch64-pc-windows-msvc
os: windows-latest
os: windows-2025
- tuple: x86_64-pc-windows-gnu
os: windows-latest
os: windows-2025
# - tuple: i686-pc-windows-gnu
# os: windows-latest

# Add additional variables to the matrix variations generated above using `include`:
include:
# `TEST_EVERYTHING` setups - there should be at least 1 for each architecture
- target:
tuple: x86_64-unknown-linux-gnu-emulated
tuple: aarch64-unknown-linux-gnu
os: ubuntu-latest
test_everything: true
- target:
tuple: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
test_everything: true
- target:
tuple: loongarch64-unknown-linux-gnu
os: ubuntu-latest
test_everything: true
- target:
tuple: powerpc-unknown-linux-gnu
os: ubuntu-latest
disable_assert_instr: true
test_everything: true
- target:
tuple: powerpc64-unknown-linux-gnu
os: ubuntu-latest
disable_assert_instr: true
test_everything: true
- target:
tuple: powerpc64le-unknown-linux-gnu
os: ubuntu-latest
disable_assert_instr: true
test_everything: true
- target:
tuple: riscv64gc-unknown-linux-gnu
os: ubuntu-latest
test_everything: true
- target:
tuple: s390x-unknown-linux-gnu
os: ubuntu-latest
test_everything: true
- target:
tuple: x86_64-unknown-linux-gnu
os: ubuntu-latest
test_everything: true
rustflags: --cfg stdarch_intel_sde
# MIPS targets disabled since they are dropped to tier 3.
# See https://github.com/rust-lang/compiler-team/issues/648
#- target:
Expand All @@ -157,25 +178,17 @@ jobs:
# tuple: mipsel-unknown-linux-musl
# os: ubuntu-latest
# norun: true
- target:
tuple: powerpc-unknown-linux-gnu
os: ubuntu-latest
disable_assert_instr: true
- target:
tuple: powerpc64le-unknown-linux-gnu
os: ubuntu-latest
disable_assert_instr: true
- target:
tuple: aarch64-apple-darwin
os: macos-latest
os: macos-15
norun: true # https://github.com/rust-lang/stdarch/issues/1206
- target:
tuple: aarch64-apple-ios-macabi
os: macos-latest
os: macos-15
norun: true # https://github.com/rust-lang/stdarch/issues/1206
- target:
tuple: aarch64-pc-windows-msvc
os: windows-latest
os: windows-2025
norun: true

steps:
Expand All @@ -187,7 +200,6 @@ jobs:
rustup update nightly --no-self-update
rustup default nightly
- run: rustup target add ${{ matrix.target.tuple }}
if: "!endsWith(matrix.target.tuple, 'emulated')"
- run: cargo generate-lockfile

# Configure some env vars based on matrix configuration
Expand All @@ -199,9 +211,6 @@ jobs:
- run: echo "STDARCH_TEST_EVERYTHING=1" >> $GITHUB_ENV
shell: bash
if: matrix.test_everything != ''
- run: echo "RUSTFLAGS=${{ matrix.rustflags }}" >> $GITHUB_ENV
shell: bash
if: matrix.rustflags != ''
- run: echo "STDARCH_DISABLE_ASSERT_INSTR=1" >> $GITHUB_ENV
shell: bash
if: matrix.disable_assert_instr != ''
Expand Down Expand Up @@ -237,7 +246,6 @@ jobs:
needs:
- docs
- verify
- env_override
- test
- build-std-detect
runs-on: ubuntu-latest
Expand Down
7 changes: 4 additions & 3 deletions ci/docker/aarch64-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:24.04
FROM ubuntu:25.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
g++ \
Expand All @@ -14,5 +14,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
lld

ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER="qemu-aarch64 -L /usr/aarch64-linux-gnu" \
OBJDUMP=aarch64-linux-gnu-objdump
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER="qemu-aarch64 -cpu max -L /usr/aarch64-linux-gnu" \
OBJDUMP=aarch64-linux-gnu-objdump \
STDARCH_TEST_SKIP_FEATURE=tme
5 changes: 3 additions & 2 deletions ci/docker/aarch64_be-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:24.04
FROM ubuntu:25.04

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
Expand All @@ -25,5 +25,6 @@ ENV AARCH64_BE_TOOLCHAIN="/toolchains/${TOOLCHAIN}"
ENV AARCH64_BE_LIBC="${AARCH64_BE_TOOLCHAIN}/aarch64_be-none-linux-gnu/libc"

ENV CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_LINKER="${AARCH64_BE_TOOLCHAIN}/bin/aarch64_be-none-linux-gnu-gcc"
ENV CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_RUNNER="qemu-aarch64_be -L ${AARCH64_BE_LIBC}"
ENV CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_RUNNER="qemu-aarch64_be -cpu max -L ${AARCH64_BE_LIBC}"
ENV OBJDUMP="${AARCH64_BE_TOOLCHAIN}/bin/bin/aarch64-none-linux-gnu-objdump"
ENV STDARCH_TEST_SKIP_FEATURE=tme
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment for each skipped test/feature explaining why it is skipped and when the exclusion can be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still not sure why the tme feature is not available. Is it something like tsx/rtm, i.e. is a higher privilege level required for these?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's just because it is not being supported by qemu.

4 changes: 2 additions & 2 deletions ci/docker/arm-unknown-linux-gnueabihf/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:24.04
FROM ubuntu:25.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
ca-certificates \
Expand All @@ -9,5 +9,5 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
make \
file
ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -L /usr/arm-linux-gnueabihf" \
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -cpu max -L /usr/arm-linux-gnueabihf" \
OBJDUMP=arm-linux-gnueabihf-objdump
2 changes: 1 addition & 1 deletion ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
clang-19 \
lld
ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -L /usr/arm-linux-gnueabihf" \
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -cpu max -L /usr/arm-linux-gnueabihf" \
OBJDUMP=arm-linux-gnueabihf-objdump
2 changes: 1 addition & 1 deletion ci/docker/i586-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:24.04
FROM ubuntu:25.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc-multilib \
libc6-dev \
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/i686-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:24.04
FROM ubuntu:25.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc-multilib \
libc6-dev \
Expand Down
7 changes: 4 additions & 3 deletions ci/docker/loongarch64-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:24.04
FROM ubuntu:25.04

RUN apt-get update && \
apt-get install -y --no-install-recommends \
Expand All @@ -7,5 +7,6 @@ RUN apt-get update && \


ENV CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_LINKER=loongarch64-linux-gnu-gcc-14 \
CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_RUNNER="qemu-loongarch64-static -L /usr/loongarch64-linux-gnu" \
OBJDUMP=loongarch64-linux-gnu-objdump
CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_RUNNER="qemu-loongarch64-static -cpu max -L /usr/loongarch64-linux-gnu" \
OBJDUMP=loongarch64-linux-gnu-objdump \
STDARCH_TEST_SKIP_FEATURE=frecipe
2 changes: 1 addition & 1 deletion ci/docker/mips-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:24.04
FROM ubuntu:25.04

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:24.04
FROM ubuntu:25.04

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:24.04
FROM ubuntu:25.04

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/mipsel-unknown-linux-musl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:24.04
FROM ubuntu:25.04

RUN apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/nvptx64-nvidia-cuda/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:24.04
FROM ubuntu:25.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libc6-dev \
Expand Down
7 changes: 4 additions & 3 deletions ci/docker/powerpc-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM ubuntu:24.04
FROM ubuntu:25.04

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
gcc-powerpc-linux-gnu libc6-dev-powerpc-cross \
qemu-system-ppc make file

ENV CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_LINKER=powerpc-linux-gnu-gcc \
CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc -cpu Vger -L /usr/powerpc-linux-gnu" \
CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc -cpu mpc8610 -L /usr/powerpc-linux-gnu" \
CC=powerpc-linux-gnu-gcc \
OBJDUMP=powerpc-linux-gnu-objdump
OBJDUMP=powerpc-linux-gnu-objdump \
STDARCH_TEST_SKIP_FEATURE=vsx
9 changes: 6 additions & 3 deletions ci/docker/powerpc64-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
FROM ubuntu:24.04
FROM ubuntu:25.04

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
gcc-powerpc64-linux-gnu libc6-dev-ppc64-cross \
file make

ENV CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_LINKER=powerpc64-linux-gnu-gcc \
CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc64 -cpu power10 -L /usr/powerpc64-linux-gnu" \
CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc64 -cpu power11 -L /usr/powerpc64-linux-gnu" \
CC=powerpc64-linux-gnu-gcc \
OBJDUMP=powerpc64-linux-gnu-objdump
OBJDUMP=powerpc64-linux-gnu-objdump \
STDARCH_TEST_SKIP_FEATURE=vsx \
# These 2 tests have erratic behaviour with qemu, see https://gitlab.com/qemu-project/qemu/-/issues/1623#note_2449012173
STDARCH_TEST_SKIP_FUNCTION=vec_lde_u16,vec_lde_u32
4 changes: 2 additions & 2 deletions ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:24.04
FROM ubuntu:25.04

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
Expand All @@ -7,6 +7,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \

# Work around qemu triggering a sigill on vec_subs if the cpu target is not defined.
ENV CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_LINKER=powerpc64le-linux-gnu-gcc \
CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc64le -cpu power10 -L /usr/powerpc64le-linux-gnu" \
CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc64le -cpu power11 -L /usr/powerpc64le-linux-gnu" \
CC=powerpc64le-linux-gnu-gcc \
OBJDUMP=powerpc64le-linux-gnu-objdump
7 changes: 2 additions & 5 deletions ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
FROM ubuntu:24.04
FROM ubuntu:25.04

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
gcc-riscv64-linux-gnu libc6-dev-riscv64-cross \
llvm

ENV CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER=riscv64-linux-gnu-gcc \
CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_RUNNER="qemu-riscv64 \
-L /usr/riscv64-linux-gnu \
-cpu rv64,zk=true,zks=true,zbb=true,zbc=true \
" \
CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_RUNNER="qemu-riscv64 -cpu max -L /usr/riscv64-linux-gnu" \
OBJDUMP=llvm-objdump
4 changes: 2 additions & 2 deletions ci/docker/s390x-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:24.04
FROM ubuntu:25.04

RUN apt-get update && apt-get install -y --no-install-recommends \
curl ca-certificates \
Expand All @@ -10,5 +10,5 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
file

ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc \
CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="qemu-s390x -L /usr/s390x-linux-gnu" \
CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="qemu-s390x -cpu max -L /usr/s390x-linux-gnu" \
OBJDUMP=s390x-linux-gnu-objdump
2 changes: 1 addition & 1 deletion ci/docker/wasm32-wasip1/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:24.04
FROM ubuntu:25.04

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && apt-get install -y --no-install-recommends \
Expand Down
16 changes: 0 additions & 16 deletions ci/docker/x86_64-unknown-linux-gnu-emulated/Dockerfile

This file was deleted.

Loading