Skip to content

Commit 46d74ea

Browse files
committed
rustbuild: only plan from build triple for dist
We only want to package each host/target once for `dist`. The obvious solution takes the form of step dependency, which is implemented at least for the `dist-rustc` step. Unfortunately since the steps are created from `hosts x targets` during planning and *not* de-duplicated afterwards, the problem still persists. We therefore move the check inside `plan()` instead, to avoid creating the duplicate steps in the first place.
1 parent 0102127 commit 46d74ea

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/bootstrap/step.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,16 @@ invalid rule dependency graph detected, was a rule added and maybe typo'd?
822822
let hosts = if self.build.flags.host.len() > 0 {
823823
&self.build.flags.host
824824
} else {
825-
&self.build.config.host
825+
if kind == Kind::Dist {
826+
// For 'dist' steps we only distribute artifacts built from
827+
// the build platform, so only consider that in the hosts
828+
// array.
829+
// NOTE: This relies on the fact that the build triple is
830+
// always placed first, as done in `config.rs`.
831+
&self.build.config.host[..1]
832+
} else {
833+
&self.build.config.host
834+
}
826835
};
827836
let targets = if self.build.flags.target.len() > 0 {
828837
&self.build.flags.target

0 commit comments

Comments
 (0)