mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-28 03:07:24 +03:00
Rollup merge of #139609 - jieyouxu:compiletest-path-misc, r=Kobzol
compiletest: don't use stringly paths for `compose_and_run`
Eventually I'd like to fully migrate to `camino`'s `{Utf8Path,Utf8PathBuf}` because compiletest assumes UTF-8 paths all over the place, so this is an precursor change to make the migration diff cleaner.
r? `@Kobzol` (or bootstrap/compiler)
This commit is contained in:
@@ -445,8 +445,8 @@ fn print_source(&self, read_from: ReadFrom, pretty_type: &str) -> ProcRes {
|
||||
|
||||
self.compose_and_run(
|
||||
rustc,
|
||||
self.config.compile_lib_path.to_str().unwrap(),
|
||||
Some(aux_dir.to_str().unwrap()),
|
||||
self.config.compile_lib_path.as_path(),
|
||||
Some(aux_dir.as_path()),
|
||||
src,
|
||||
)
|
||||
}
|
||||
@@ -1020,8 +1020,8 @@ fn exec_compiled_test_general(
|
||||
|
||||
self.compose_and_run(
|
||||
test_client,
|
||||
self.config.run_lib_path.to_str().unwrap(),
|
||||
Some(aux_dir.to_str().unwrap()),
|
||||
self.config.run_lib_path.as_path(),
|
||||
Some(aux_dir.as_path()),
|
||||
None,
|
||||
)
|
||||
}
|
||||
@@ -1035,8 +1035,8 @@ fn exec_compiled_test_general(
|
||||
|
||||
self.compose_and_run(
|
||||
wr_run,
|
||||
self.config.run_lib_path.to_str().unwrap(),
|
||||
Some(aux_dir.to_str().unwrap()),
|
||||
self.config.run_lib_path.as_path(),
|
||||
Some(aux_dir.as_path()),
|
||||
None,
|
||||
)
|
||||
}
|
||||
@@ -1050,8 +1050,8 @@ fn exec_compiled_test_general(
|
||||
|
||||
self.compose_and_run(
|
||||
program,
|
||||
self.config.run_lib_path.to_str().unwrap(),
|
||||
Some(aux_dir.to_str().unwrap()),
|
||||
self.config.run_lib_path.as_path(),
|
||||
Some(aux_dir.as_path()),
|
||||
None,
|
||||
)
|
||||
}
|
||||
@@ -1197,8 +1197,8 @@ fn compose_and_run_compiler(
|
||||
self.props.unset_rustc_env.iter().fold(&mut rustc, Command::env_remove);
|
||||
self.compose_and_run(
|
||||
rustc,
|
||||
self.config.compile_lib_path.to_str().unwrap(),
|
||||
Some(aux_dir.to_str().unwrap()),
|
||||
self.config.compile_lib_path.as_path(),
|
||||
Some(aux_dir.as_path()),
|
||||
input,
|
||||
)
|
||||
}
|
||||
@@ -1219,8 +1219,7 @@ fn build_minicore(&self) -> PathBuf {
|
||||
rustc.args(&["--crate-type", "rlib"]);
|
||||
rustc.arg("-Cpanic=abort");
|
||||
|
||||
let res =
|
||||
self.compose_and_run(rustc, self.config.compile_lib_path.to_str().unwrap(), None, None);
|
||||
let res = self.compose_and_run(rustc, self.config.compile_lib_path.as_path(), None, None);
|
||||
if !res.status.success() {
|
||||
self.fatal_proc_rec(
|
||||
&format!(
|
||||
@@ -1332,8 +1331,8 @@ fn build_auxiliary(
|
||||
|
||||
let auxres = aux_cx.compose_and_run(
|
||||
aux_rustc,
|
||||
aux_cx.config.compile_lib_path.to_str().unwrap(),
|
||||
Some(aux_dir.to_str().unwrap()),
|
||||
aux_cx.config.compile_lib_path.as_path(),
|
||||
Some(aux_dir.as_path()),
|
||||
None,
|
||||
);
|
||||
if !auxres.status.success() {
|
||||
@@ -1373,8 +1372,8 @@ fn read2_abbreviated(&self, child: Child) -> (Output, Truncated) {
|
||||
fn compose_and_run(
|
||||
&self,
|
||||
mut command: Command,
|
||||
lib_path: &str,
|
||||
aux_path: Option<&str>,
|
||||
lib_path: &Path,
|
||||
aux_path: Option<&Path>,
|
||||
input: Option<String>,
|
||||
) -> ProcRes {
|
||||
let cmdline = {
|
||||
@@ -1806,7 +1805,7 @@ fn split_maybe_args(&self, argstr: &Option<String>) -> Vec<OsString> {
|
||||
}
|
||||
}
|
||||
|
||||
fn make_cmdline(&self, command: &Command, libpath: &str) -> String {
|
||||
fn make_cmdline(&self, command: &Command, libpath: &Path) -> String {
|
||||
use crate::util;
|
||||
|
||||
// Linux and mac don't require adjusting the library search path
|
||||
@@ -1819,7 +1818,7 @@ fn lib_path_cmd_prefix(path: &str) -> String {
|
||||
format!("{}=\"{}\"", util::lib_path_env_var(), util::make_new_path(path))
|
||||
}
|
||||
|
||||
format!("{} {:?}", lib_path_cmd_prefix(libpath), command)
|
||||
format!("{} {:?}", lib_path_cmd_prefix(libpath.to_str().unwrap()), command)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1980,7 +1979,8 @@ fn verify_with_filecheck(&self, output: &Path) -> ProcRes {
|
||||
// Add custom flags supplied by the `filecheck-flags:` test header.
|
||||
filecheck.args(&self.props.filecheck_flags);
|
||||
|
||||
self.compose_and_run(filecheck, "", None, None)
|
||||
// FIXME(jieyouxu): don't pass an empty Path
|
||||
self.compose_and_run(filecheck, Path::new(""), None, None)
|
||||
}
|
||||
|
||||
fn charset() -> &'static str {
|
||||
|
||||
@@ -104,7 +104,7 @@ fn run_debuginfo_cdb_test_no_opt(&self) {
|
||||
|
||||
let debugger_run_result = self.compose_and_run(
|
||||
cdb,
|
||||
self.config.run_lib_path.to_str().unwrap(),
|
||||
self.config.run_lib_path.as_path(),
|
||||
None, // aux_path
|
||||
None, // input
|
||||
);
|
||||
@@ -241,7 +241,8 @@ fn run_debuginfo_gdb_test_no_opt(&self) {
|
||||
let cmdline = {
|
||||
let mut gdb = Command::new(&format!("{}-gdb", self.config.target));
|
||||
gdb.args(debugger_opts);
|
||||
let cmdline = self.make_cmdline(&gdb, "");
|
||||
// FIXME(jieyouxu): don't pass an empty Path
|
||||
let cmdline = self.make_cmdline(&gdb, Path::new(""));
|
||||
logv(self.config, format!("executing {}", cmdline));
|
||||
cmdline
|
||||
};
|
||||
@@ -340,7 +341,7 @@ fn run_debuginfo_gdb_test_no_opt(&self) {
|
||||
gdb.args(debugger_opts).env("PYTHONPATH", pythonpath);
|
||||
|
||||
debugger_run_result =
|
||||
self.compose_and_run(gdb, self.config.run_lib_path.to_str().unwrap(), None, None);
|
||||
self.compose_and_run(gdb, self.config.run_lib_path.as_path(), None, None);
|
||||
}
|
||||
|
||||
if !debugger_run_result.status.success() {
|
||||
|
||||
Reference in New Issue
Block a user