Skip to content

Commit

Permalink
full_ci: Test with various _TIME_BITS settings where relevant
Browse files Browse the repository at this point in the history
In Linux Tier1, run the tests for i686-unknown-linux-gnu with
RUST_LIBC_TIME_BITS set to 32, 64, and default.

In Linux Tier2, run the tests for arm-unknown-linux-gnueabihf and
powerpc-unknown-linux-gnu with RUST_LIBC_TIME_BITS set to 32, 64,
and default.  Use RUST_LIBC_TIME_BITS=defaults for the other
platforms.

In Build Channels Linux, build the relevant platforms with
RUST_LIBC_TIME_BITS unset and set to 32 and 64.
  • Loading branch information
snogge committed Jun 18, 2024
1 parent ff7abed commit 473fcae
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/full_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,22 @@ jobs:
i686-unknown-linux-gnu,
x86_64-unknown-linux-gnu,
]
bits: [
default,
32,
64
]
exclude:
- target: x86_64-unknown-linux-gnu
bits: 32
- target: x86_64-unknown-linux-gnu
bits: 64
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
- name: Execute run-docker.sh
run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }}
run: LIBC_CI=1 RUST_LIBC_TIME_BITS=${{ matrix.bits }} sh ./ci/run-docker.sh ${{ matrix.target }}

macos:
permissions:
Expand Down Expand Up @@ -133,12 +143,22 @@ jobs:
# aren't defined on redox actually.
# x86_64-unknown-redox,
]
include:
- bits: default
- bits: 32
target: arm-unknown-linux-gnueabihf
- bits: 64
target: arm-unknown-linux-gnueabihf
- bits: 32
target: powerpc-unknown-linux-gnu
- bits: 64
target: powerpc-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
- name: Execute run-docker.sh
run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }}
run: LIBC_CI=1 RUST_LIBC_TIME_BITS=${{ matrix.bits }} sh ./ci/run-docker.sh ${{ matrix.target }}

# These targets are tier 3 or otherwise need to have CI build std via -Zbuild-std.
# Because of this, only the nightly compiler can be used on these targets.
Expand Down
23 changes: 23 additions & 0 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,29 @@ test_target() {
TARGET="${2}"
NO_STD="${3}"

if [ "$RUST_LIBC_TIME_BITS" = "" ]; then
while true; do
case "$TARGET" in
arm-unknown-linux-gnueabi);;
arm-unknown-linux-gnueabihf);;
armv7-unknown-linux-gnueabihf);;
i586-unknown-linux-gnu);;
i686-unknown-linux-gnu);;
powerpc-unknown-linux-gnu);;
armv5te-unknown-linux-gnueabi);;
mips-unknown-linux-gnu);;
mipsel-unknown-linux-gnu);;
powerpc-unknown-linux-gnuspe);;
riscv32gc-unknown-linux-gnu);;
sparc-unknown-linux-gnu);;
*) break;
esac
RUST_LIBC_TIME_BITS=32 test_target "$BUILD_CMD" "$TARGET" "$NO_STD"
RUST_LIBC_TIME_BITS=64 test_target "$BUILD_CMD" "$TARGET" "$NO_STD"
break # also build without RUST_LIBC_TIME_BITS set
done
fi

# If there is a std component, fetch it:
if [ "${NO_STD}" != "1" ]; then
# FIXME: rustup often fails to download some artifacts due to network
Expand Down
1 change: 1 addition & 0 deletions ci/run-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ run() {
--env LIBC_CI_ZBUILD_STD \
--env CARGO_HOME=/cargo \
--env CARGO_TARGET_DIR=/checkout/target \
--env RUST_LIBC_TIME_BITS \
--volume "$CARGO_HOME":/cargo \
--volume "$(rustc --print sysroot)":/rust:ro \
--volume "$(pwd)":/checkout:ro \
Expand Down

0 comments on commit 473fcae

Please sign in to comment.