Skip to content

Commit adde928

Browse files
authored
Rollup merge of #102042 - LukeMathWalker:add-rust-json-docs-to-rustup, r=Mark-Simulacrum
Distribute rust-docs-json via rustup. I am not 100% sure on how to treat `rust-json-docs` in `target_host_combination`. I went along with a similar strategy to the one used for `rust-docs`, but looking for guidance there.
2 parents 695b708 + e572d51 commit adde928

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/bootstrap/dist.rs

+4-10
Original file line numberDiff line numberDiff line change
@@ -86,29 +86,23 @@ impl Step for JsonDocs {
8686

8787
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
8888
let default = run.builder.config.docs;
89-
run.alias("rust-json-docs").default_condition(default)
89+
run.alias("rust-docs-json").default_condition(default)
9090
}
9191

9292
fn make_run(run: RunConfig<'_>) {
9393
run.builder.ensure(JsonDocs { host: run.target });
9494
}
9595

96-
/// Builds the `rust-json-docs` installer component.
96+
/// Builds the `rust-docs-json` installer component.
9797
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
98-
// This prevents JSON docs from being built for "dist" or "install"
99-
// on the stable/beta channels. The JSON format is not stable yet and
100-
// should not be included in stable/beta toolchains.
101-
if !builder.build.unstable_features() {
102-
return None;
103-
}
104-
10598
let host = self.host;
10699
builder.ensure(crate::doc::JsonStd { stage: builder.top_stage, target: host });
107100

108101
let dest = "share/doc/rust/json";
109102

110-
let mut tarball = Tarball::new(builder, "rust-json-docs", &host.triple);
103+
let mut tarball = Tarball::new(builder, "rust-docs-json", &host.triple);
111104
tarball.set_product_name("Rust Documentation In JSON Format");
105+
tarball.is_preview(true);
112106
tarball.add_bulk_dir(&builder.json_doc_out(host), dest);
113107
Some(tarball.generate())
114108
}

src/tools/build-manifest/src/main.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static PKG_INSTALLERS: &[&str] = &["x86_64-apple-darwin", "aarch64-apple-darwin"
184184

185185
static MINGW: &[&str] = &["i686-pc-windows-gnu", "x86_64-pc-windows-gnu"];
186186

187-
static NIGHTLY_ONLY_COMPONENTS: &[&str] = &["miri-preview"];
187+
static NIGHTLY_ONLY_COMPONENTS: &[&str] = &["miri-preview", "rust-docs-json-preview"];
188188

189189
macro_rules! t {
190190
($e:expr) => {
@@ -294,6 +294,7 @@ impl Builder {
294294
package!("rust-mingw", MINGW);
295295
package!("rust-std", TARGETS);
296296
self.package("rust-docs", &mut manifest.pkg, HOSTS, DOCS_FALLBACK);
297+
self.package("rust-docs-json-preview", &mut manifest.pkg, HOSTS, DOCS_FALLBACK);
297298
package!("rust-src", &["*"]);
298299
package!("rls-preview", HOSTS);
299300
package!("rust-analyzer-preview", HOSTS);
@@ -379,6 +380,7 @@ impl Builder {
379380
rename("rustfmt", "rustfmt-preview");
380381
rename("clippy", "clippy-preview");
381382
rename("miri", "miri-preview");
383+
rename("rust-docs-json", "rust-docs-json-preview");
382384
rename("rust-analyzer", "rust-analyzer-preview");
383385
}
384386

@@ -435,6 +437,7 @@ impl Builder {
435437
host_component("rustfmt-preview"),
436438
host_component("llvm-tools-preview"),
437439
host_component("rust-analysis"),
440+
host_component("rust-docs-json"),
438441
]);
439442

440443
extensions.extend(

0 commit comments

Comments
 (0)