From cb024edad55483d2eb3f44e5e37fd6fd1b0e8d06 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Sat, 25 Oct 2025 20:54:30 -0400 Subject: [PATCH 1/2] ci: Run gnu env tests as part of the main job Since glibc supports both 32- and 64-bit time_t and off_t without different setup (just a header define in libc-test), these don't have any need to be standalone jobs. Switch glibc config variants to be checked as part of `run.sh`, which means we are now covering all 32-bit platforms by default. --- .github/workflows/ci.yaml | 18 ------------------ ci/run.sh | 12 ++++++++++++ 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a717b805ffa4..5a79c10a016c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -122,12 +122,6 @@ jobs: - target: i686-pc-windows-msvc os: windows-2025 - target: i686-unknown-linux-gnu - - target: i686-unknown-linux-gnu - artifact-tag: offset-bits64 - env: { RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS: 64 } - - target: i686-unknown-linux-gnu - artifact-tag: time-bits64 - env: { RUST_LIBC_UNSTABLE_GNU_TIME_BITS: 64 } - target: x86_64-pc-windows-gnu os: windows-2025 env: { ARCH_BITS: 64, ARCH: x86_64 } @@ -189,12 +183,6 @@ jobs: artifact-tag: new-musl - target: arm-linux-androideabi - target: arm-unknown-linux-gnueabihf - - target: arm-unknown-linux-gnueabihf - env: { RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS: 64 } - artifact-tag: offset-bits64 - - target: arm-unknown-linux-gnueabihf - env: { RUST_LIBC_UNSTABLE_GNU_TIME_BITS: 64 } - artifact-tag: time-bits64 - target: arm-unknown-linux-musleabihf - target: arm-unknown-linux-musleabihf env: { RUST_LIBC_UNSTABLE_MUSL_V1_2_3: 1 } @@ -236,12 +224,6 @@ jobs: # FIXME(ppc): SIGILL running tests, see # https://github.com/rust-lang/libc/pull/4254#issuecomment-2636288713 # - target: powerpc-unknown-linux-gnu - # - target: powerpc-unknown-linux-gnu - # env: { RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS: 64 } - # artifact-tag: offset-bits64 - # - target: powerpc-unknown-linux-gnu - # env: { RUST_LIBC_UNSTABLE_GNU_TIME_BITS: 64 } - # artifact-tag: time-bits64 runs-on: ${{ matrix.os && matrix.os || 'ubuntu-24.04' }} timeout-minutes: 25 env: diff --git a/ci/run.sh b/ci/run.sh index 8bb4af01f570..70d8570df29c 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -32,9 +32,21 @@ case "$target" in *loongarch*) cmd="$cmd --exclude ctest --exclude ctest-test --exclude ctest-next" ;; esac +env="$(rustc --print cfg --target "$target" | sed -n 's/target_env="\(.*\)"/\1/p')" +bits="$(rustc --print cfg --target "$target" | sed -n 's/target_pointer_width="\(.*\)"/\1/p')" + # shellcheck disable=SC2086 $cmd --no-default-features -- $test_flags # shellcheck disable=SC2086 $cmd -- $test_flags # shellcheck disable=SC2086 $cmd --features extra_traits -- $test_flags + +# On relevant platforms, also test with our optional settings + +if [ "$env" = "gnu" ] && [ "$bits" = "32" ]; then + # shellcheck disable=SC2086 + RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS=64 $cmd -- $test_flags + # shellcheck disable=SC2086 + RUST_LIBC_UNSTABLE_GNU_TIME_BITS=64 $cmd -- $test_flags +fi From 5d36662bb5089363ebaa64bb14ad5e669060291b Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Mon, 27 Oct 2025 04:19:19 -0400 Subject: [PATCH 2/2] ci: Unskip the powerpc32 job The mentioned issue seems to have been resolved. --- .github/workflows/ci.yaml | 5 +---- libc-test/build.rs | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5a79c10a016c..aecadfdd9dd0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -198,6 +198,7 @@ jobs: - target: loongarch64-unknown-linux-musl env: { RUST_LIBC_UNSTABLE_MUSL_V1_2_3: 1 } artifact-tag: new-musl + - target: powerpc-unknown-linux-gnu - target: powerpc64-unknown-linux-gnu - target: powerpc64le-unknown-linux-gnu - target: powerpc64le-unknown-linux-musl @@ -220,10 +221,6 @@ jobs: artifact-tag: new-musl # FIXME: It seems some items in `src/unix/mod.rs` aren't defined on redox actually. # - target: x86_64-unknown-redox - - # FIXME(ppc): SIGILL running tests, see - # https://github.com/rust-lang/libc/pull/4254#issuecomment-2636288713 - # - target: powerpc-unknown-linux-gnu runs-on: ${{ matrix.os && matrix.os || 'ubuntu-24.04' }} timeout-minutes: 25 env: diff --git a/libc-test/build.rs b/libc-test/build.rs index bf6abab6a068..232a6daf1c9e 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -3499,6 +3499,7 @@ fn test_linux(target: &str) { let aarch64 = target.contains("aarch64"); let i686 = target.contains("i686"); let ppc = target.contains("powerpc"); + let ppc32 = target.contains("powerpc-"); let ppc64 = target.contains("powerpc64"); let s390x = target.contains("s390x"); let sparc64 = target.contains("sparc64"); @@ -4213,7 +4214,7 @@ fn test_linux(target: &str) { "XDP_USE_SG" | "XDP_PKT_CONTD" => true, // FIXME(linux): Missing only on this platform for some reason - "PR_MDWE_NO_INHERIT" if gnueabihf => true, + "PR_MDWE_NO_INHERIT" if gnueabihf || ppc32 => true, // FIXME(linux): Requires >= 6.8 kernel headers. "XDP_UMEM_TX_SW_CSUM"