Skip to content

Commit e1935cc

Browse files
authored
Rollup merge of #96237 - AlecGoncharow:issue-96011-fix, r=Mark-Simulacrum
compiletest: combine `--*-python` args Since these arguments are now always the same, combine them into a singular `--python` argument. Fixes #96011
2 parents 4724040 + e95bda6 commit e1935cc

File tree

5 files changed

+11
-19
lines changed

5 files changed

+11
-19
lines changed

src/bootstrap/test.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1400,9 +1400,7 @@ note: if you're sure you want to do this, please open an issue as to why. In the
14001400
targetflags.extend(builder.lld_flags(target));
14011401
cmd.arg("--target-rustcflags").arg(targetflags.join(" "));
14021402

1403-
cmd.arg("--docck-python").arg(builder.python());
1404-
1405-
cmd.arg("--lldb-python").arg(builder.python());
1403+
cmd.arg("--python").arg(builder.python());
14061404

14071405
if let Some(ref gdb) = builder.config.gdb {
14081406
cmd.arg("--gdb").arg(gdb);

src/tools/compiletest/src/common.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,8 @@ pub struct Config {
198198
/// The rust-demangler executable.
199199
pub rust_demangler_path: Option<PathBuf>,
200200

201-
/// The Python executable to use for LLDB.
202-
pub lldb_python: String,
203-
204-
/// The Python executable to use for htmldocck.
205-
pub docck_python: String,
201+
/// The Python executable to use for LLDB and htmldocck.
202+
pub python: String,
206203

207204
/// The jsondocck executable.
208205
pub jsondocck_path: Option<String>,

src/tools/compiletest/src/header/tests.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ fn config() -> Config {
4343
"--compile-lib-path=",
4444
"--run-lib-path=",
4545
"--rustc-path=",
46-
"--lldb-python=",
47-
"--docck-python=",
46+
"--python=",
4847
"--jsondocck-path=",
4948
"--src-base=",
5049
"--build-base=",

src/tools/compiletest/src/main.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
6161
.reqopt("", "rustc-path", "path to rustc to use for compiling", "PATH")
6262
.optopt("", "rustdoc-path", "path to rustdoc to use for compiling", "PATH")
6363
.optopt("", "rust-demangler-path", "path to rust-demangler to use in tests", "PATH")
64-
.reqopt("", "lldb-python", "path to python to use for doc tests", "PATH")
65-
.reqopt("", "docck-python", "path to python to use for doc tests", "PATH")
64+
.reqopt("", "python", "path to python to use for doc tests", "PATH")
6665
.optopt("", "jsondocck-path", "path to jsondocck to use for doc tests", "PATH")
6766
.optopt("", "valgrind-path", "path to Valgrind executable for Valgrind tests", "PROGRAM")
6867
.optflag("", "force-valgrind", "fail if Valgrind tests cannot be run under Valgrind")
@@ -222,8 +221,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
222221
rustc_path: opt_path(matches, "rustc-path"),
223222
rustdoc_path: matches.opt_str("rustdoc-path").map(PathBuf::from),
224223
rust_demangler_path: matches.opt_str("rust-demangler-path").map(PathBuf::from),
225-
lldb_python: matches.opt_str("lldb-python").unwrap(),
226-
docck_python: matches.opt_str("docck-python").unwrap(),
224+
python: matches.opt_str("python").unwrap(),
227225
jsondocck_path: matches.opt_str("jsondocck-path"),
228226
valgrind_path: matches.opt_str("valgrind-path"),
229227
force_valgrind: matches.opt_present("force-valgrind"),

src/tools/compiletest/src/runtest.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ pub fn compute_stamp_hash(config: &Config) -> String {
179179
}
180180

181181
Some(Debugger::Lldb) => {
182-
config.lldb_python.hash(&mut hash);
182+
config.python.hash(&mut hash);
183183
config.lldb_python_dir.hash(&mut hash);
184184
env::var_os("PATH").hash(&mut hash);
185185
env::var_os("PYTHONPATH").hash(&mut hash);
@@ -1141,7 +1141,7 @@ impl<'test> TestCx<'test> {
11411141
// Prepare the lldb_batchmode which executes the debugger script
11421142
let lldb_script_path = rust_src_root.join("src/etc/lldb_batchmode.py");
11431143
self.cmd2procres(
1144-
Command::new(&self.config.lldb_python)
1144+
Command::new(&self.config.python)
11451145
.arg(&lldb_script_path)
11461146
.arg(test_executable)
11471147
.arg(debugger_script)
@@ -2256,7 +2256,7 @@ impl<'test> TestCx<'test> {
22562256
self.check_rustdoc_test_option(proc_res);
22572257
} else {
22582258
let root = self.config.find_rust_src_root().unwrap();
2259-
let mut cmd = Command::new(&self.config.docck_python);
2259+
let mut cmd = Command::new(&self.config.python);
22602260
cmd.arg(root.join("src/etc/htmldocck.py")).arg(&out_dir).arg(&self.testpaths.file);
22612261
if self.config.bless {
22622262
cmd.arg("--bless");
@@ -2457,7 +2457,7 @@ impl<'test> TestCx<'test> {
24572457
let mut json_out = out_dir.join(self.testpaths.file.file_stem().unwrap());
24582458
json_out.set_extension("json");
24592459
let res = self.cmd2procres(
2460-
Command::new(&self.config.docck_python)
2460+
Command::new(&self.config.python)
24612461
.arg(root.join("src/etc/check_missing_items.py"))
24622462
.arg(&json_out),
24632463
);
@@ -2852,7 +2852,7 @@ impl<'test> TestCx<'test> {
28522852
.stdout(Stdio::piped())
28532853
.stderr(Stdio::piped())
28542854
.env("TARGET", &self.config.target)
2855-
.env("PYTHON", &self.config.docck_python)
2855+
.env("PYTHON", &self.config.python)
28562856
.env("S", src_root)
28572857
.env("RUST_BUILD_STAGE", &self.config.stage_id)
28582858
.env("RUSTC", cwd.join(&self.config.rustc_path))

0 commit comments

Comments
 (0)