Skip to content
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

Move --sysroot argument out of the argument file to fix miri issue #123030

Merged
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: 6 additions & 3 deletions src/librustdoc/doctest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ pub(crate) fn generate_args_file(file_path: &Path, options: &RustdocOptions) ->
}
}

if let Some(sysroot) = &options.maybe_sysroot {
content.push(format!("--sysroot={}", sysroot.display()));
}
for lib_str in &options.lib_strs {
content.push(format!("-L{lib_str}"));
}
Expand Down Expand Up @@ -411,6 +408,10 @@ fn run_test(

compiler.arg(&format!("@{}", rustdoc_options.arg_file.display()));

if let Some(sysroot) = &rustdoc_options.maybe_sysroot {
compiler.arg(format!("--sysroot={}", sysroot.display()));
}

compiler.arg("--edition").arg(&edition.to_string());
compiler.env("UNSTABLE_RUSTDOC_TEST_PATH", path);
compiler.env("UNSTABLE_RUSTDOC_TEST_LINE", format!("{}", line as isize - line_offset as isize));
Expand Down Expand Up @@ -950,6 +951,7 @@ pub(crate) struct IndividualTestOptions {
runtool_args: Vec<String>,
target: TargetTriple,
test_id: String,
maybe_sysroot: Option<PathBuf>,
}

impl IndividualTestOptions {
Expand Down Expand Up @@ -982,6 +984,7 @@ impl IndividualTestOptions {
runtool_args: options.runtool_args.clone(),
target: options.target.clone(),
test_id,
maybe_sysroot: options.maybe_sysroot.clone(),
}
}
}
Expand Down
Loading