Un-remap rustc-dev component paths

This commit is contained in:
Urgau
2025-06-11 18:37:48 +02:00
parent 810d99e7b5
commit 268fbfed47
8 changed files with 108 additions and 0 deletions

View File

@@ -1364,6 +1364,7 @@ impl Default for Options {
cli_forced_local_thinlto_off: false,
remap_path_prefix: Vec::new(),
real_rust_source_base_dir: None,
real_rustc_dev_source_base_dir: None,
edition: DEFAULT_EDITION,
json_artifact_notifications: false,
json_unused_externs: JsonUnusedExterns::No,
@@ -2713,6 +2714,10 @@ pub fn build_session_options(early_dcx: &mut EarlyDiagCtxt, matches: &getopts::M
// This is the location used by the `rust-src` `rustup` component.
real_source_base_dir("lib/rustlib/src/rust", "library/std/src/lib.rs");
let real_rustc_dev_source_base_dir =
// This is the location used by the `rustc-dev` `rustup` component.
real_source_base_dir("lib/rustlib/rustc-src/rust", "compiler/rustc/src/main.rs");
let mut search_paths = vec![];
for s in &matches.opt_strs("L") {
search_paths.push(SearchPath::from_cli_opt(
@@ -2766,6 +2771,7 @@ pub fn build_session_options(early_dcx: &mut EarlyDiagCtxt, matches: &getopts::M
cli_forced_local_thinlto_off: disable_local_thinlto,
remap_path_prefix,
real_rust_source_base_dir,
real_rustc_dev_source_base_dir,
edition,
json_artifact_notifications,
json_unused_externs,

View File

@@ -397,6 +397,15 @@ top_level_options!(
/// (the `rust.remap-debuginfo` option in `bootstrap.toml`).
real_rust_source_base_dir: Option<PathBuf> [TRACKED_NO_CRATE_HASH],
/// Base directory containing the `compiler/` directory for the rustc sources.
/// Right now it's always `$sysroot/lib/rustlib/rustc-src/rust`
/// (i.e. the `rustup` `rustc-dev` component).
///
/// This directory is what the virtual `/rustc-dev/$hash` is translated back to,
/// if Rust was built with path remapping to `/rustc/$hash` enabled
/// (the `rust.remap-debuginfo` option in `bootstrap.toml`).
real_rustc_dev_source_base_dir: Option<PathBuf> [TRACKED_NO_CRATE_HASH],
edition: Edition [TRACKED],
/// `true` if we're emitting JSON blobs about each artifact produced