Skip to content

Commit bf0de6c

Browse files
committed
fix x clean for cross-compiled artifacts
Signed-off-by: onur-ozkan <[email protected]>
1 parent 9d49eb7 commit bf0de6c

File tree

1 file changed

+8
-2
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+8
-2
lines changed

src/bootstrap/src/core/build_steps/clean.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,14 @@ fn clean_default(build: &Build) {
149149
rm_rf(&build.out.join("bootstrap-shims-dump"));
150150
rm_rf(&build.out.join("rustfmt.stamp"));
151151

152-
for host in &build.hosts {
153-
let entries = match build.out.join(host.triple).read_dir() {
152+
let mut hosts: Vec<_> = build.hosts.iter().map(|t| build.out.join(t.triple)).collect();
153+
// After cross-compilation, artifacts of the host architecture (which may differ from build.host)
154+
// might not get removed.
155+
// Adding its path (linked one for easier accessibility) will solve this problem.
156+
hosts.push(build.out.join("host"));
157+
158+
for host in hosts {
159+
let entries = match host.read_dir() {
154160
Ok(iter) => iter,
155161
Err(_) => continue,
156162
};

0 commit comments

Comments
 (0)