Skip to content

Do not copy .rmeta files into the sysroot of the build compiler during check #144252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions src/bootstrap/src/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,16 @@ fn main() {
}
}

// Here we pass additional paths that essentially act as a sysroot.
// These are used to load rustc crates (e.g. `extern crate rustc_ast;`)
// for rustc_private tools, so that we do not have to copy them into the
// actual sysroot of the compiler that builds the tool.
if let Ok(dirs) = env::var("RUSTC_ADDITIONAL_SYSROOT_PATHS") {
for dir in dirs.split(",") {
cmd.arg(format!("-L{dir}"));
}
}

// Force all crates compiled by this compiler to (a) be unstable and (b)
// allow the `rustc_private` feature to link to other unstable crates
// also in the sysroot. We also do this for host crates, since those
Expand Down
Loading
Loading