Skip to content

Commit 9f756b7

Browse files
committed
fix fs bug on CI
Signed-off-by: onur-ozkan <[email protected]>
1 parent e2a3647 commit 9f756b7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/bootstrap/src/core/build_steps/compile.rs

+8
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,14 @@ impl Step for StdLink {
789789
}
790790
} else if compiler.stage == 0 {
791791
let sysroot = builder.out.join(compiler.host.triple).join("stage0-sysroot");
792+
793+
if builder.local_rebuild {
794+
// On local rebuilds this path might be a symlink to the project root,
795+
// which can be read-only (e.g., on CI). So remove it before copying
796+
// the stage0 lib.
797+
let _ = fs::remove_dir_all(&sysroot.join("lib/rustlib/src/rust"));
798+
}
799+
792800
builder.cp_link_r(&builder.initial_sysroot.join("lib"), &sysroot.join("lib"));
793801
} else {
794802
if builder.download_rustc() {

0 commit comments

Comments
 (0)