Skip to content

Commit cf89453

Browse files
committed
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.
1 parent 3991046 commit cf89453

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/bootstrap/step.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -839,14 +839,20 @@ invalid rule dependency graph detected, was a rule added and maybe typo'd?
839839
&self.build.config.target
840840
};
841841
// Determine the actual targets participating in this rule.
842+
// NOTE: We should keep the full projection from build triple to
843+
// the hosts for the dist steps, now that the hosts array above is
844+
// truncated to avoid duplication of work in that case. Therefore
845+
// the original non-shadowed hosts array is used below.
842846
let arr = if rule.host {
843847
// If --target was specified but --host wasn't specified,
844-
// don't run any host-only tests
845-
if self.build.flags.target.len() > 0 &&
846-
self.build.flags.host.len() == 0 {
848+
// don't run any host-only tests. Also, respect any `--host`
849+
// overrides as done for `hosts`.
850+
if self.build.flags.host.len() > 0 {
851+
&self.build.flags.host[..]
852+
} else if self.build.flags.target.len() > 0 {
847853
&[]
848854
} else {
849-
hosts
855+
&self.build.config.host[..]
850856
}
851857
} else {
852858
targets

0 commit comments

Comments
 (0)