From e743a4db62336027dcc1f1a755f4ca35f56b67df Mon Sep 17 00:00:00 2001 From: paradoxicalguy Date: Tue, 28 Apr 2026 14:59:04 +0000 Subject: [PATCH 1/2] bootstrap: remap OUT_DIR paths to fix build script path leakage in artifacts --- src/bootstrap/src/core/builder/cargo.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs index e9659f0176fc5..bfc2da6514dbb 100644 --- a/src/bootstrap/src/core/builder/cargo.rs +++ b/src/bootstrap/src/core/builder/cargo.rs @@ -1082,6 +1082,8 @@ impl Builder<'_> { // rustc creates absolute paths (in part bc of the `rust-src` unremap // and for working directory) so let's remap the build directory as well. format!("{}={map_to}", self.build.src.display()), + // remap OUT_DIR so they don't leak into artifacs. + format!("{}={map_to}/out", self.build.out.display()), ] .join("\t"); cargo.env("RUSTC_DEBUGINFO_MAP", map); @@ -1102,6 +1104,8 @@ impl Builder<'_> { // rustc creates absolute paths (in part bc of the `rust-src` unremap // and for working directory) so let's remap the build directory as well. format!("{}={map_to}", self.build.src.display()), + // remap OUT_DIR so they don't leak into artifacts. + format!("{}={map_to}/out", self.build.out.display()), ] .join("\t"); cargo.env("RUSTC_DEBUGINFO_MAP", map); From 26ce8a9d5c397356d4d351c36b1f579104c9fb40 Mon Sep 17 00:00:00 2001 From: abhinav srivastav <136164196+paradoxicalguy@users.noreply.github.com> Date: Tue, 28 Apr 2026 22:35:17 +0530 Subject: [PATCH 2/2] Apply suggestion from @bjorn3 Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com> --- src/bootstrap/src/core/builder/cargo.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs index bfc2da6514dbb..e6f52c790e422 100644 --- a/src/bootstrap/src/core/builder/cargo.rs +++ b/src/bootstrap/src/core/builder/cargo.rs @@ -1082,7 +1082,7 @@ impl Builder<'_> { // rustc creates absolute paths (in part bc of the `rust-src` unremap // and for working directory) so let's remap the build directory as well. format!("{}={map_to}", self.build.src.display()), - // remap OUT_DIR so they don't leak into artifacs. + // remap OUT_DIR so they don't leak into artifacts. format!("{}={map_to}/out", self.build.out.display()), ] .join("\t");