diff --git a/Cargo.lock b/Cargo.lock index 4f011a892c8..7f62f596a17 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", 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 diff --git a/crates/cargo-util/src/du.rs b/crates/cargo-util/src/du.rs index 14634c47bc1..251acef0137 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 use 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