Skip to content

Commit e743a4d

Browse files
bootstrap: remap OUT_DIR paths to fix build script path leakage in artifacts
1 parent 03c609a commit e743a4d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/bootstrap/src/core/builder/cargo.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,8 @@ impl Builder<'_> {
10821082
// rustc creates absolute paths (in part bc of the `rust-src` unremap
10831083
// and for working directory) so let's remap the build directory as well.
10841084
format!("{}={map_to}", self.build.src.display()),
1085+
// remap OUT_DIR so they don't leak into artifacs.
1086+
format!("{}={map_to}/out", self.build.out.display()),
10851087
]
10861088
.join("\t");
10871089
cargo.env("RUSTC_DEBUGINFO_MAP", map);
@@ -1102,6 +1104,8 @@ impl Builder<'_> {
11021104
// rustc creates absolute paths (in part bc of the `rust-src` unremap
11031105
// and for working directory) so let's remap the build directory as well.
11041106
format!("{}={map_to}", self.build.src.display()),
1107+
// remap OUT_DIR so they don't leak into artifacts.
1108+
format!("{}={map_to}/out", self.build.out.display()),
11051109
]
11061110
.join("\t");
11071111
cargo.env("RUSTC_DEBUGINFO_MAP", map);

0 commit comments

Comments
 (0)