File tree Expand file tree Collapse file tree 3 files changed +189
-65
lines changed Expand file tree Collapse file tree 3 files changed +189
-65
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,16 @@ fn main() {
179179 }
180180 }
181181
182+ // Here we pass additional paths that essentially act as a sysroot.
183+ // These are used to load rustc crates (e.g. `extern crate rustc_ast;`)
184+ // for rustc_private tools, so that we do not have to copy them into the
185+ // actual sysroot of the compiler that builds the tool.
186+ if let Ok ( dirs) = env:: var ( "RUSTC_ADDITIONAL_SYSROOT_PATHS" ) {
187+ for dir in dirs. split ( "," ) {
188+ cmd. arg ( format ! ( "-L{dir}" ) ) ;
189+ }
190+ }
191+
182192 // Force all crates compiled by this compiler to (a) be unstable and (b)
183193 // allow the `rustc_private` feature to link to other unstable crates
184194 // also in the sysroot. We also do this for host crates, since those
You can’t perform that action at this time.
0 commit comments