Skip to content

Commit b9ff789

Browse files
authored
Rollup merge of #102241 - jyn514:manifest-json-docs, r=Mark-Simulacrum
Package `rust-docs-json` into nightly components (take 3) `dist` creates a `rust-docs-json.tar.xz` tarfile. But build-manifest expected it to be named `rust-docs-json-preview.tar.xz`. Change build-manifest to allow the name without the `-preview` suffix. I haven't actually tested this :( build-manifest is a pain to run locally.
2 parents 02cd79a + d44e142 commit b9ff789

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/bootstrap/dist.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,7 @@ impl Step for Extended {
13671367
}
13681368

13691369
add_component!("rust-docs" => Docs { host: target });
1370+
add_component!("rust-json-docs" => JsonDocs { host: target });
13701371
add_component!("rust-demangler"=> RustDemangler { compiler, target });
13711372
add_component!("cargo" => Cargo { compiler, target });
13721373
add_component!("rustfmt" => Rustfmt { compiler, target });

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

+8-2
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,12 @@ macro_rules! t {
193193
Err(e) => panic!("{} failed with {}", stringify!($e), e),
194194
}
195195
};
196+
($e:expr, $extra:expr) => {
197+
match $e {
198+
Ok(e) => e,
199+
Err(e) => panic!("{} failed with {}: {}", stringify!($e), e, $extra),
200+
}
201+
};
196202
}
197203

198204
struct Builder {
@@ -437,7 +443,7 @@ impl Builder {
437443
host_component("rustfmt-preview"),
438444
host_component("llvm-tools-preview"),
439445
host_component("rust-analysis"),
440-
host_component("rust-docs-json"),
446+
host_component("rust-docs-json-preview"),
441447
]);
442448

443449
extensions.extend(
@@ -584,7 +590,7 @@ impl Builder {
584590
self.shipped_files.insert(name.clone());
585591

586592
let dst = self.output.join(name);
587-
t!(fs::write(&dst, contents));
593+
t!(fs::write(&dst, contents), format!("failed to create manifest {}", dst.display()));
588594
}
589595

590596
fn write_shipped_files(&self, path: &Path) {

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

+8
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub(crate) enum PkgType {
2020
Rustfmt,
2121
LlvmTools,
2222
Miri,
23+
JsonDocs,
2324
Other(String),
2425
}
2526

@@ -36,6 +37,7 @@ impl PkgType {
3637
"rustfmt" | "rustfmt-preview" => PkgType::Rustfmt,
3738
"llvm-tools" | "llvm-tools-preview" => PkgType::LlvmTools,
3839
"miri" | "miri-preview" => PkgType::Miri,
40+
"rust-docs-json" | "rust-docs-json-preview" => PkgType::JsonDocs,
3941
other => PkgType::Other(other.into()),
4042
}
4143
}
@@ -53,6 +55,7 @@ impl PkgType {
5355
PkgType::Rustfmt => "rustfmt",
5456
PkgType::LlvmTools => "llvm-tools",
5557
PkgType::Miri => "miri",
58+
PkgType::JsonDocs => "rust-docs-json",
5659
PkgType::Other(component) => component,
5760
}
5861
}
@@ -72,6 +75,7 @@ impl PkgType {
7275
PkgType::Rust => true,
7376
PkgType::RustSrc => true,
7477
PkgType::Rustc => true,
78+
PkgType::JsonDocs => true,
7579
PkgType::Other(_) => true,
7680
}
7781
}
@@ -113,6 +117,9 @@ impl Versions {
113117
Some(version) => Ok(version.clone()),
114118
None => {
115119
let version_info = self.load_version_from_tarball(package)?;
120+
if *package == PkgType::Rust && version_info.version.is_none() {
121+
panic!("missing version info for toolchain");
122+
}
116123
self.versions.insert(package.clone(), version_info.clone());
117124
Ok(version_info)
118125
}
@@ -127,6 +134,7 @@ impl Versions {
127134
Ok(file) => file,
128135
Err(err) if err.kind() == std::io::ErrorKind::NotFound => {
129136
// Missing tarballs do not return an error, but return empty data.
137+
println!("warning: missing tarball {}", tarball.display());
130138
return Ok(VersionInfo::default());
131139
}
132140
Err(err) => return Err(err.into()),

0 commit comments

Comments
 (0)