Byron / dua-cli

View disk space usage and delete unwanted data, fast.
https://lib.rs/crates/dua-cli
MIT License
4.19k stars 113 forks source link

Fails to build on powerpc #99

Closed pkubaj closed 2 years ago

pkubaj commented 3 years ago
     Running `CARGO=/usr/local/bin/cargo CARGO_CRATE_NAME=dua CARGO_MANIFEST_DIR=/wrkdirs/usr/ports/sysutils/dua-cli/work/dua-cli-2.14.2 CARGO_PKG_AUTHORS='Sebastian Thiel <byronimo@gmail.com>' CARGO_PKG_DESCRIPTION='A tool to conveniently learn about the disk usage of directories, fast'\!'' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE=MIT CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=dua-cli CARGO_PKG_REPOSITORY='https://github.com/Byron/dua-cli' CARGO_PKG_VERSION=2.14.2 CARGO_PKG_VERSION_MAJOR=2 CARGO_PKG_VERSION_MINOR=14 CARGO_PKG_VERSION_PATCH=2 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 LD_LIBRARY_PATH='/wrkdirs/usr/ports/sysutils/dua-cli/work/target/release/deps:/usr/local/lib' /usr/local/bin/rustc --crate-name dua --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort -C linker-plugin-lto -C codegen-units=1 --cfg 'feature="crosstermion"' --cfg 'feature="open"' --cfg 'feature="tui"' --cfg 'feature="tui-crossplatform"' --cfg 'feature="tui-react"' --cfg 'feature="tui-shared"' --cfg 'feature="unicode-segmentation"' -C metadata=8e77ad818c1efb78 -C extra-filename=-8e77ad818c1efb78 --out-dir /wrkdirs/usr/ports/sysutils/dua-cli/work/target/release/deps -L dependency=/wrkdirs/usr/ports/sysutils/dua-cli/work/target/release/deps --extern anyhow=/wrkdirs/usr/ports/sysutils/dua-cli/work/target/release/deps/libanyhow-bbb6f89415c51efc.rmeta --extern atty=/wrkdirs/usr/ports/sysutils/dua-cli/work/target/release/deps/libatty-e802f37d66aba940.rmeta --extern byte_unit=/wrkdirs/usr/ports/sysutils/dua-cli/work/target/release/deps/libbyte_unit-cab8261ef7bfae8d.rmeta --extern clap=/wrkdirs/usr/ports/sysutils/dua-cli/work/target/release/deps/libclap-74ab6aba082fc1c2.rmeta --extern colored=/wrkdirs/usr/ports/sysutils/dua-cli/work/target/release/deps/libcolored-ccb6deb0911988ca.rmeta --extern crosstermion=/wrkdirs/usr/ports/sysutils/dua-cli/work/target/release/deps/libcrosstermion-94e83ec96c8555d3.rmeta --extern filesize=/wrkdirs/usr/ports/sysutils/dua-cli/work/target/release/deps/libfilesize-bb98e33f22bc2fb0.rmeta --extern itertools=/wrkdirs/usr/ports/sysutils/dua-cli/work/target/release/deps/libitertools-92e1cbdb87b12e77.rmeta --extern jwalk=/wrkdirs/usr/ports/sysutils/dua-cli/work/target/release/deps/libjwalk-930c238f234a6c0d.rmeta --extern num_cpus=/wrkdirs/usr/ports/sysutils/dua-cli/work/target/release/deps/libnum_cpus-7bfdc87e6db4858d.rmeta --extern open=/wrkdirs/usr/ports/sysutils/dua-cli/work/target/release/deps/libopen-e362b6c678fcf8a0.rmeta --extern petgraph=/wrkdirs/usr/ports/sysutils/dua-cli/work/target/release/deps/libpetgraph-43c9d81153cb63a7.rmeta --extern tui=/wrkdirs/usr/ports/sysutils/dua-cli/work/target/release/deps/libtui-f1d6b5aa5b209ce3.rmeta --extern tui_react=/wrkdirs/usr/ports/sysutils/dua-cli/work/target/release/deps/libtui_react-c04972b17b8af4e5.rmeta --extern unicode_segmentation=/wrkdirs/usr/ports/sysutils/dua-cli/work/target/release/deps/libunicode_segmentation-989a8d636ae0851e.rmeta --extern wild=/wrkdirs/usr/ports/sysutils/dua-cli/work/target/release/deps/libwild-f8dc786536775329.rmeta -C linker=cc -C link-arg=-fstack-protector-strong`
error[E0432]: unresolved import `std::sync::atomic::AtomicU64`
  --> src/aggregate.rs:11:18
   |
11 |         atomic::{AtomicU64, Ordering},
   |                  ^^^^^^^^^
   |                  |
   |                  no `AtomicU64` in `sync::atomic`
   |                  help: a similar name exists in the module: `AtomicU8`

error[E0599]: no method named `load` found for struct `Arc<_>` in the current scope
  --> src/aggregate.rs:50:38
   |
50 |                         shared_count.load(Ordering::Acquire)
   |                                      ^^^^ method not found in `Arc<_>`
   |
   = note: `shared_count` is a function, perhaps you wish to call it

error[E0599]: no method named `fetch_add` found for struct `Arc<_>` in the current scope
  --> src/aggregate.rs:65:26
   |
65 |             shared_count.fetch_add(1, Ordering::Relaxed);
   |                          ^^^^^^^^^ method not found in `Arc<_>`
   |
   = note: `shared_count` is a function, perhaps you wish to call it

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `dua-cli`

This is because there are no 64-bit atomics for powerpc in Rust.

Byron commented 3 years ago

Thanks for reporting. I see that this issue was introduced when the progress display was added. It counts the files seen so far and displays them every 100ms.

A possible solution would be to conditionally compile this feature in, for example if the architecture or platform isn't power-pc. A PR would also be very welcome, I will probably not get to it anytime soon.

pkubaj commented 3 years ago

This issue probably also happens on mips. AFAIK it also doesn't have 64-bit atomics.

Byron commented 3 years ago

@pkubaj There is a new feature toggle which allows to completely remove the scan progress feature. Maybe you can give it a try, I am waiting for your feedback. Cheers