rustbuild: fix host-only rules ignoring targets in dist steps

`arr` is the actual list of targets participating in steps construction,
but due to #38468 the hosts array now consists of only the build triple
for the `dist` steps, hence all non-build-triple targets are lost for
the host-only rules.

Fix this by using the original non-shadowed hosts array in `arr`
calculation. This should unbreak the nightly packaging process.

Fixes #38637.
This commit is contained in:
Wang Xuerui 2016-12-28 01:49:25 +08:00
parent 3991046d52
commit cf89453506
No known key found for this signature in database
GPG Key ID: 38544B4E2DE7FAB9

View File

@ -839,14 +839,20 @@ invalid rule dependency graph detected, was a rule added and maybe typo'd?
&self.build.config.target
};
// Determine the actual targets participating in this rule.
// NOTE: We should keep the full projection from build triple to
// the hosts for the dist steps, now that the hosts array above is
// truncated to avoid duplication of work in that case. Therefore
// the original non-shadowed hosts array is used below.
let arr = if rule.host {
// If --target was specified but --host wasn't specified,
// don't run any host-only tests
if self.build.flags.target.len() > 0 &&
self.build.flags.host.len() == 0 {
// don't run any host-only tests. Also, respect any `--host`
// overrides as done for `hosts`.
if self.build.flags.host.len() > 0 {
&self.build.flags.host[..]
} else if self.build.flags.target.len() > 0 {
&[]
} else {
hosts
&self.build.config.host[..]
}
} else {
targets