From 305890541f4777488305bcc154617b9c6f73f60c Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 10 Apr 2025 17:26:25 +0300 Subject: [PATCH] fix fs bug on CI and update ming-check-1 Dockerfile Signed-off-by: onur-ozkan --- src/bootstrap/src/core/build_steps/compile.rs | 8 ++++++++ src/ci/docker/host-x86_64/mingw-check-1/Dockerfile | 1 + 2 files changed, 9 insertions(+) diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index 633e6239f952..f1e0717e39c6 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -788,6 +788,14 @@ impl Step for StdLink { } } else if compiler.stage == 0 { let sysroot = builder.out.join(compiler.host.triple).join("stage0-sysroot"); + + if builder.local_rebuild { + // On local rebuilds this path might be a symlink to the project root, + // which can be read-only (e.g., on CI). So remove it before copying + // the stage0 lib. + let _ = fs::remove_dir_all(sysroot.join("lib/rustlib/src/rust")); + } + builder.cp_link_r(&builder.initial_sysroot.join("lib"), &sysroot.join("lib")); } else { if builder.download_rustc() { diff --git a/src/ci/docker/host-x86_64/mingw-check-1/Dockerfile b/src/ci/docker/host-x86_64/mingw-check-1/Dockerfile index 4608faa7df12..a877de1f7b24 100644 --- a/src/ci/docker/host-x86_64/mingw-check-1/Dockerfile +++ b/src/ci/docker/host-x86_64/mingw-check-1/Dockerfile @@ -47,6 +47,7 @@ COPY host-x86_64/mingw-check-1/validate-error-codes.sh /scripts/ ENV SCRIPT \ /scripts/check-default-config-profiles.sh && \ python3 ../x.py build --stage 0 src/tools/build-manifest && \ + python3 ../x.py test --stage 0 src/tools/compiletest && \ python3 ../x.py check compiletest --set build.compiletest-use-stage0-libtest=true && \ python3 ../x.py check --stage 1 --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu && \ python3 ../x.py check --stage 1 --set build.optimized-compiler-builtins=false core alloc std --target=aarch64-unknown-linux-gnu,i686-pc-windows-msvc,i686-unknown-linux-gnu,x86_64-apple-darwin,x86_64-pc-windows-gnu,x86_64-pc-windows-msvc && \