Skip to content

Commit 1506af3

Browse files
Auto merge of #144473 - zeroomega:rustc_inconsistency, r=<try>
Address libunwind.a inconsistency issues in the bootstrap program try-job: dist-ohos-x86_64
2 parents 6bcdcc7 + b3f369d commit 1506af3

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/bootstrap/src/core/build_steps/compile.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2384,15 +2384,19 @@ pub fn run_cargo(
23842384
let mut deps = Vec::new();
23852385
let mut toplevel = Vec::new();
23862386
let ok = stream_cargo(builder, cargo, tail_args, &mut |msg| {
2387-
let (filenames, crate_types) = match msg {
2387+
let (filenames_vec, crate_types) = match msg {
23882388
CargoMessage::CompilerArtifact {
23892389
filenames,
23902390
target: CargoTarget { crate_types },
23912391
..
2392-
} => (filenames, crate_types),
2392+
} => {
2393+
let mut f: Vec<String> = filenames.into_iter().map(|s| s.into_owned()).collect();
2394+
f.sort(); // Sort the filenames
2395+
(f, crate_types)
2396+
}
23932397
_ => return,
23942398
};
2395-
for filename in filenames {
2399+
for filename in filenames_vec {
23962400
// Skip files like executables
23972401
let mut keep = false;
23982402
if filename.ends_with(".lib")

src/bootstrap/src/core/build_steps/llvm.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,8 +1528,12 @@ impl Step for Libunwind {
15281528

15291529
// FIXME: https://github.com/alexcrichton/cc-rs/issues/545#issuecomment-679242845
15301530
let mut count = 0;
1531-
for entry in fs::read_dir(&out_dir).unwrap() {
1532-
let file = entry.unwrap().path().canonicalize().unwrap();
1531+
let mut files = fs::read_dir(&out_dir)
1532+
.unwrap()
1533+
.map(|entry| entry.unwrap().path().canonicalize().unwrap())
1534+
.collect::<Vec<_>>();
1535+
files.sort();
1536+
for file in files {
15331537
if file.is_file() && file.extension() == Some(OsStr::new("o")) {
15341538
// Object file name without the hash prefix is "Unwind-EHABI", "Unwind-seh" or "libunwind".
15351539
let base_name = unhashed_basename(&file);

0 commit comments

Comments
 (0)