Skip to content

Commit 4c67e70

Browse files
alexcrichtonMark-Simulacrum
authored andcommitted
Filter out missing components from manifests
This commit updates our manifest generation for rustup to filter out any components/extensions which are actually missing. This is intended to help mitigate rust-lang#49462 by making the manifests reflect reality, that many targets now are missing a `rust-docs` component rather than requiring it exists.
1 parent a775680 commit 4c67e70

File tree

1 file changed

+22
-0
lines changed
  • src/tools/build-manifest/src

1 file changed

+22
-0
lines changed

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

+22
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,28 @@ impl Builder {
356356
target: "*".to_string(),
357357
});
358358

359+
// If the components/extensions don't actually exist for this
360+
// particular host/target combination then nix it entirely from our
361+
// lists.
362+
{
363+
let has_component = |c: &Component| {
364+
if c.target == "*" {
365+
return true
366+
}
367+
let pkg = match manifest.pkg.get(&c.pkg) {
368+
Some(p) => p,
369+
None => return false,
370+
};
371+
let target = match pkg.target.get(&c.target) {
372+
Some(t) => t,
373+
None => return false,
374+
};
375+
target.available
376+
};
377+
extensions.retain(&has_component);
378+
components.retain(&has_component);
379+
}
380+
359381
pkg.target.insert(host.to_string(), Target {
360382
available: true,
361383
url: Some(self.url(&filename)),

0 commit comments

Comments
 (0)