Fix s390x-musl sysroot nested directory structure#213
Conversation
…std.sh Co-authored-by: messense <1556054+messense@users.noreply.github.com>
|
@copilot That's not working, see For more information about this error, try Can you build and test run the docker image? |
Co-authored-by: messense <1556054+messense@users.noreply.github.com>
I've identified and fixed the root cause. The issue was a path mismatch - the Rust target is Fixed in commit 4886afe by:
The fix should now allow the Docker image to build with a complete sysroot and pass the cargo build test. |
|
@copilot The sysroot location seems wrong, compared to normal one |
Co-authored-by: messense <1556054+messense@users.noreply.github.com>
…root changes Co-authored-by: messense <1556054+messense@users.noreply.github.com>
... Fixed the nested sysroot structure in commit c9913d0. The issue was in the build-sysroot tool - it was passing the target-specific path to SysrootBuilder, which then created another nested structure inside it. Changed it to pass just the sysroot base directory, so libraries are now installed at the correct path: Also reverted the Dockerfile and build-std.sh changes, keeping only the Build.yml change (adding MUSL_TARGET) and the build-sysroot fix. |
Removed MUSL_TARGET for s390x and updated test condition.
cf9bfc9 to
c7fcc41
Compare
The s390x-musl image fails to compile with
error[E0463]: can't find crate for 'std'because the sysroot was installed in a nested directory structure where rustc couldn't find it.Root Cause
s390x-unknown-linux-muslis a Tier 3 target without prebuilt std. Thebuild-sysroottool builds a custom sysroot from source, but it was passing the target-specific path (/root/.rustup/toolchains/$TOOLCHAIN-$HOST/lib/rustlib/$TARGET) toSysrootBuilder::new(). The SysrootBuilder then created its ownlib/rustlib/$target/libstructure inside that directory, resulting in a nested structure:Instead of the expected:
This caused rustc to fail finding the standard library crates.
Changes
build-sysroot/src/main.rs:SysrootBuilder::new()lib/rustlib/$target/libstructureThis ensures the sysroot is installed at the correct location where rustc expects to find it.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.