Skip to content

Commit e572d51

Browse files
author
Luca Palmieri
committed
Distribute rust-json-docs via rustup.
1 parent acb8934 commit e572d51

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
@@ -98,29 +98,23 @@ impl Step for JsonDocs {
9898

9999
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
100100
let default = run.builder.config.docs;
101-
run.alias("rust-json-docs").default_condition(default)
101+
run.alias("rust-docs-json").default_condition(default)
102102
}
103103

104104
fn make_run(run: RunConfig<'_>) {
105105
run.builder.ensure(JsonDocs { host: run.target });
106106
}
107107

108-
/// Builds the `rust-json-docs` installer component.
108+
/// Builds the `rust-docs-json` installer component.
109109
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
110-
// This prevents JSON docs from being built for "dist" or "install"
111-
// on the stable/beta channels. The JSON format is not stable yet and
112-
// should not be included in stable/beta toolchains.
113-
if !builder.build.unstable_features() {
114-
return None;
115-
}
116-
117110
let host = self.host;
118111
builder.ensure(crate::doc::JsonStd { stage: builder.top_stage, target: host });
119112

120113
let dest = "share/doc/rust/json";
121114

122-
let mut tarball = Tarball::new(builder, "rust-json-docs", &host.triple);
115+
let mut tarball = Tarball::new(builder, "rust-docs-json", &host.triple);
123116
tarball.set_product_name("Rust Documentation In JSON Format");
117+
tarball.is_preview(true);
124118
tarball.add_bulk_dir(&builder.json_doc_out(host), dest);
125119
Some(tarball.generate())
126120
}

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) => {
@@ -318,6 +318,7 @@ impl Builder {
318318
package!("rust-mingw", MINGW);
319319
package!("rust-std", TARGETS);
320320
self.package("rust-docs", &mut manifest.pkg, HOSTS, DOCS_FALLBACK);
321+
self.package("rust-docs-json-preview", &mut manifest.pkg, HOSTS, DOCS_FALLBACK);
321322
package!("rust-src", &["*"]);
322323
package!("rls-preview", HOSTS);
323324
package!("rust-analyzer-preview", HOSTS);
@@ -403,6 +404,7 @@ impl Builder {
403404
rename("rustfmt", "rustfmt-preview");
404405
rename("clippy", "clippy-preview");
405406
rename("miri", "miri-preview");
407+
rename("rust-docs-json", "rust-docs-json-preview");
406408
rename("rust-analyzer", "rust-analyzer-preview");
407409
}
408410

@@ -459,6 +461,7 @@ impl Builder {
459461
host_component("rustfmt-preview"),
460462
host_component("llvm-tools-preview"),
461463
host_component("rust-analysis"),
464+
host_component("rust-docs-json"),
462465
]);
463466

464467
extensions.extend(

0 commit comments

Comments
 (0)