uclibc fix kernel constant tests + docker ci build fixes - #5261
Conversation
47c0db9 to
5aa06a0
Compare
This comment has been minimized.
This comment has been minimized.
e689145 to
662559d
Compare
The previous CI script used a prebuilt toolchain from bootlin, but this was based on kernel 5.15, which did not contain many of the kernel constants being tested.
662559d to
2454ca6
Compare
|
@rustbot review |
There was a problem hiding this comment.
What is involved in preparing the SDK that gets downloaded? I think the current setup is fine enough, but if it's not too bad then I feel like the docker container may as well just build it. Or build it as part of run-docker.sh and copy it into the container to make caching easier.
| if [ -n "${TEST_UCLIBC_TIME64:-}" ]; then | ||
| build_args+=("--build-arg=TEST_UCLIBC_TIME64=1") | ||
| export RUSTFLAGS="$RUSTFLAGS --cfg=libc_unstable_uclibc_time64" | ||
| export RUSTFLAGS="${RUSTFLAGS:-} --cfg=libc_unstable_uclibc_time64" |
There was a problem hiding this comment.
"uclibc: move to configurable external prebuilt toolchain": maybe just export RUSTFLAGS="${RUSTFLAGS:-}" at the top of run() so we only need that in one place
| CC_armv7_unknown_linux_uclibceabihf=arm-buildroot-linux-uclibcgnueabihf-gcc \ | ||
| CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABIHF_LINKER=arm-buildroot-linux-uclibcgnueabihf-gcc \ | ||
| CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABIHF_RUNNER="qemu-arm -L /toolchain/arm-buildroot-linux-uclibcgnueabihf/sysroot/" | ||
| CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABIHF_RUNNER="qemu-arm -L /toolchain/arm-buildroot-linux-uclibcgnueabihf/sysroot/" No newline at end of file |
There was a problem hiding this comment.
"uclibc: move to configurable external prebuilt toolchain": missing trailing \n
|
I also think it would be fine to link to your GH URL since libc's frequent CI won't be needing it. But for that, ideally the script should be checked into your repo somewhere (or build+release via GHA?) and the sha could be checked here so it's easy to reproduce. |
|
Also no problem of course but just a heads up, looks like the email you used here isn't linked to your GH account (e.g. https://github.com/rust-lang/libc/commit/3156347e405a3dcb48f1b639ed420681ea897745.patch). |
Description
Today's uClibc builds in CI cannot test many recently-added linux kernel features, as the prebuilt bootlin toolchains they rely on are built against kernel 5.15.
This changes the
ci/install-uclibc.shscript to use a toolchain provided via an environment variable. This allows projects and developers who want to run the uclibc tests to build based on kernel 7.0 headers, and use that toolchain for running the libc build and test in CI.Best way to test is via:
NOTE: the toolchain URL provided above is from my github account and shouldn't be directly included in the source, as I'm sure I would get dinged for bandwidth usage. It's my expectation that developers would build their own or ask nicely to use mine in a responsible way.
Abandoned task: building a toolchain
My first attempt at this PR included building a toolchain from source via buildroot, but that process takes longer than the github action timeout (which seems to be 20 minutes) so I abandoned that approach.
Results
With this change, it's now possible for me to build the libc in a fork of the
libc-downstream-ciexample posted by @tgross35. See here for example.Sources
N/A
Checklist
libc-test/semverhave been updated*LASTor*MAXareincluded (see #3131)
cd libc-test && cargo test --target mytarget);especially relevant for platforms that may not be checked in CI