Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/bootstrap/src/core/builder/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,15 @@ impl Builder<'_> {
let out_dir = self.stage_out(compiler, mode);
cargo.env("CARGO_TARGET_DIR", &out_dir);

// Bootstrap makes a lot of assumptions about the artifacts produced in the target
// directory. If users override the "build directory" using `build-dir`
// (https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-dir), then
// bootstrap couldn't find these artifacts. So we forcefully override that option to our
// target directory here.
// In the future, we could attempt to read the build-dir location from Cargo and actually
// respect it.
cargo.env("CARGO_BUILD_BUILD_DIR", &out_dir);

// Found with `rg "init_env_logger\("`. If anyone uses `init_env_logger`
// from out of tree it shouldn't matter, since x.py is only used for
// building in-tree.
Expand Down
Loading