Skip to content

Commit

Permalink
Filter out missing components from manifests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexcrichton authored and Mark-Simulacrum committed May 24, 2018
1 parent a775680 commit 4c67e70
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/tools/build-manifest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,28 @@ impl Builder {
target: "*".to_string(),
});

// If the components/extensions don't actually exist for this
// particular host/target combination then nix it entirely from our
// lists.
{
let has_component = |c: &Component| {
if c.target == "*" {
return true
}
let pkg = match manifest.pkg.get(&c.pkg) {
Some(p) => p,
None => return false,
};
let target = match pkg.target.get(&c.target) {
Some(t) => t,
None => return false,
};
target.available
};
extensions.retain(&has_component);
components.retain(&has_component);
}

pkg.target.insert(host.to_string(), Target {
available: true,
url: Some(self.url(&filename)),
Expand Down

0 comments on commit 4c67e70

Please sign in to comment.