Skip to content

Commit ba6803e

Browse files
committed
No longer require unstable for jsondocck, only build it for json tests
1 parent 728ffc8 commit ba6803e

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

src/bootstrap/test.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,13 @@ note: if you're sure you want to do this, please open an issue as to why. In the
10111011
cmd.arg("--rustdoc-path").arg(builder.rustdoc(compiler));
10121012
}
10131013

1014+
if mode == "rustdoc-json" {
1015+
// Use the beta compiler for jsondocck
1016+
let json_compiler = compiler.with_stage(0);
1017+
cmd.arg("--jsondocck-path")
1018+
.arg(builder.ensure(tool::JsonDocCk { compiler: json_compiler, target }));
1019+
}
1020+
10141021
if mode == "run-make" && suite.ends_with("fulldeps") {
10151022
cmd.arg("--rust-demangler-path").arg(builder.tool_exe(Tool::RustDemangler));
10161023
}
@@ -1072,8 +1079,6 @@ note: if you're sure you want to do this, please open an issue as to why. In the
10721079

10731080
cmd.arg("--docck-python").arg(builder.python());
10741081

1075-
cmd.arg("--jsondocck-path").arg(builder.ensure(tool::JsonDocCk { compiler, target }));
1076-
10771082
if builder.config.build.ends_with("apple-darwin") {
10781083
// Force /usr/bin/python3 on macOS for LLDB tests because we're loading the
10791084
// LLDB plugin's compiled module which only works with the system python

src/bootstrap/tool.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ bootstrap_tool!(
367367
RustdocTheme, "src/tools/rustdoc-themes", "rustdoc-themes";
368368
ExpandYamlAnchors, "src/tools/expand-yaml-anchors", "expand-yaml-anchors";
369369
LintDocs, "src/tools/lint-docs", "lint-docs";
370-
JsonDocCk, "src/tools/jsondocck", "jsondocck", is_unstable_tool = true;
370+
JsonDocCk, "src/tools/jsondocck", "jsondocck";
371371
);
372372

373373
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Ord, PartialOrd)]

src/tools/compiletest/src/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ pub struct Config {
199199
pub docck_python: String,
200200

201201
/// The jsondocck executable.
202-
pub jsondocck_path: String,
202+
pub jsondocck_path: Option<String>,
203203

204204
/// The LLVM `FileCheck` binary path.
205205
pub llvm_filecheck: Option<PathBuf>,

src/tools/compiletest/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
6060
.optopt("", "rust-demangler-path", "path to rust-demangler to use in tests", "PATH")
6161
.reqopt("", "lldb-python", "path to python to use for doc tests", "PATH")
6262
.reqopt("", "docck-python", "path to python to use for doc tests", "PATH")
63-
.reqopt("", "jsondocck-path", "path to jsondocck to use for doc tests", "PATH")
63+
.optopt("", "jsondocck-path", "path to jsondocck to use for doc tests", "PATH")
6464
.optopt("", "valgrind-path", "path to Valgrind executable for Valgrind tests", "PROGRAM")
6565
.optflag("", "force-valgrind", "fail if Valgrind tests cannot be run under Valgrind")
6666
.optopt("", "run-clang-based-tests-with", "path to Clang executable", "PATH")
@@ -208,7 +208,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
208208
rust_demangler_path: matches.opt_str("rust-demangler-path").map(PathBuf::from),
209209
lldb_python: matches.opt_str("lldb-python").unwrap(),
210210
docck_python: matches.opt_str("docck-python").unwrap(),
211-
jsondocck_path: matches.opt_str("jsondocck-path").unwrap(),
211+
jsondocck_path: matches.opt_str("jsondocck-path"),
212212
valgrind_path: matches.opt_str("valgrind-path"),
213213
force_valgrind: matches.opt_present("force-valgrind"),
214214
run_clang_based_tests_with: matches.opt_str("run-clang-based-tests-with"),

src/tools/compiletest/src/runtest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2490,7 +2490,7 @@ impl<'test> TestCx<'test> {
24902490
let mut json_out = out_dir.join(self.testpaths.file.file_stem().unwrap());
24912491
json_out.set_extension("json");
24922492
let res = self.cmd2procres(
2493-
Command::new(&self.config.jsondocck_path)
2493+
Command::new(self.config.jsondocck_path.as_ref().unwrap())
24942494
.arg("--doc-dir")
24952495
.arg(root.join(&out_dir))
24962496
.arg("--template")

0 commit comments

Comments
 (0)