From 4da5444bb7197f9dd714e448823154f433645006 Mon Sep 17 00:00:00 2001 From: BD103 <59022059+BD103@users.noreply.github.com> Date: Tue, 9 Jan 2024 12:01:03 -0500 Subject: [PATCH 1/4] chore: document why du function uses mutex --- crates/cargo-util/src/du.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/cargo-util/src/du.rs b/crates/cargo-util/src/du.rs index 14634c47bc1..c284650b5d9 100644 --- a/crates/cargo-util/src/du.rs +++ b/crates/cargo-util/src/du.rs @@ -39,7 +39,14 @@ fn du_inner(path: &Path, patterns: &[&str]) -> Result { .git_ignore(false) .git_exclude(false); let walker = builder.build_parallel(); + + // Platforms like PowerPC don't support AtomicU64, so we a Mutex instead. + // + // See: + // - https://github.com/rust-lang/cargo/pull/12981 + // - https://github.com/rust-lang/rust/pull/117916#issuecomment-1812635848 let total = Arc::new(Mutex::new(0u64)); + // A slot used to indicate there was an error while walking. // // It is possible that more than one error happens (such as in different From 529130fe54d0194ab1315ce11d4e3ac537d8c4d8 Mon Sep 17 00:00:00 2001 From: BD103 <59022059+BD103@users.noreply.github.com> Date: Tue, 9 Jan 2024 12:50:49 -0500 Subject: [PATCH 2/4] fix: missing word in comment Co-authored-by: Weihang Lo --- crates/cargo-util/src/du.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cargo-util/src/du.rs b/crates/cargo-util/src/du.rs index c284650b5d9..251acef0137 100644 --- a/crates/cargo-util/src/du.rs +++ b/crates/cargo-util/src/du.rs @@ -40,7 +40,7 @@ fn du_inner(path: &Path, patterns: &[&str]) -> Result { .git_exclude(false); let walker = builder.build_parallel(); - // Platforms like PowerPC don't support AtomicU64, so we a Mutex instead. + // Platforms like PowerPC don't support AtomicU64, so we use a Mutex instead. // // See: // - https://github.com/rust-lang/cargo/pull/12981 From c832cdf0683536c2c214284d70eb090f1132e880 Mon Sep 17 00:00:00 2001 From: BD103 <59022059+BD103@users.noreply.github.com> Date: Wed, 10 Jan 2024 08:01:47 -0500 Subject: [PATCH 3/4] bump: cargo-util to 0.2.10 --- crates/cargo-util/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cargo-util/Cargo.toml b/crates/cargo-util/Cargo.toml index aa54e93c348..fa554309da4 100644 --- a/crates/cargo-util/Cargo.toml +++ b/crates/cargo-util/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-util" -version = "0.2.9" +version = "0.2.10" rust-version.workspace = true edition.workspace = true license.workspace = true From 0a6fe230d6bebb67a682083f4beb99200b7e4d05 Mon Sep 17 00:00:00 2001 From: BD103 <59022059+BD103@users.noreply.github.com> Date: Wed, 10 Jan 2024 08:09:55 -0500 Subject: [PATCH 4/4] fix: update lockfile --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index e65871e4dcf..bd4324ab69f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -414,7 +414,7 @@ dependencies = [ [[package]] name = "cargo-util" -version = "0.2.9" +version = "0.2.10" dependencies = [ "anyhow", "core-foundation",