about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authoronur-ozkan <work@onurozkan.dev>2025-04-10 17:26:25 +0300
committeronur-ozkan <work@onurozkan.dev>2025-05-30 21:04:25 +0300
commit305890541f4777488305bcc154617b9c6f73f60c (patch)
treead98c2a2e36ca9ab07a5a77dfeb4f40cc920416b /src/bootstrap
parent60394a807d6c37a274bac1b774e53cb6660ed790 (diff)
downloadrust-305890541f4777488305bcc154617b9c6f73f60c.tar.gz
rust-305890541f4777488305bcc154617b9c6f73f60c.zip
fix fs bug on CI and update ming-check-1 Dockerfile
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/src/core/build_steps/compile.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
index 633e6239f95..f1e0717e39c 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() {