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

Unable to build on android termux #157

Closed flaribbit closed 1 year ago

flaribbit commented 1 year ago

This tool is so cool. I want to use it on android to find out what occupies my storage. But it seems that some dependencies dont support android.

image

   Compiling jwalk v0.8.1
   Compiling atty v0.2.14
   Compiling trash v3.0.1
   Compiling wild v2.1.0
error[E0433]: failed to resolve: use of undeclared crate or module `platform`
  --> /data/data/com.termux/files/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/trash-3.0.1/src/lib.rs:63:24
   |
63 |     platform_specific: platform::PlatformTrashContext,
   |                        ^^^^^^^^ use of undeclared crate or module `platform`

error[E0433]: failed to resolve: use of undeclared crate or module `platform`
  --> /data/data/com.termux/files/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/trash-3.0.1/src/lib.rs:67:35
   |
67 |         Self { platform_specific: platform::PlatformTrashContext::new() }
   |                                   ^^^^^^^^ use of undeclared crate or module `platform`

   Compiling filesize v0.2.0
   Compiling clap_derive v4.1.0
error[E0599]: no method named `delete_all_canonicalized` found for reference `&TrashContext` in the current scope
   --> /data/data/com.termux/files/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/trash-3.0.1/src/lib.rs:112:14
    |
112 |         self.delete_all_canonicalized(full_paths)
    |              ^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `&TrashContext`

Some errors have detailed explanations: E0433, E0599.
For more information about an error, try `rustc --explain E0433`.
error: could not compile `trash` due to 3 previous errors
warning: build failed, waiting for other jobs to finish...
Byron commented 1 year ago

Thanks for making me aware!

trash also happens to be maintained by me, and I definitely appreciate contributions adding Android support.

In the meantime, can you try to compile like this as a workaround?

cargo build --release --no-default-features --features tui-crossplatform
flaribbit commented 1 year ago

Sure. And it works.

~/dua-cli $ cargo build --release --no-default-features --features tui-crossplatform
   Compiling scopeguard v1.1.0
   Compiling clap v4.1.4
   Compiling byte-unit v4.0.18
   Compiling owo-colors v3.5.0
   Compiling crossbeam-epoch v0.9.13
   Compiling lock_api v0.4.9
   Compiling parking_lot v0.12.1
   Compiling crossbeam-deque v0.8.2
   Compiling crossterm v0.25.0
   Compiling rayon-core v1.10.2
   Compiling crossbeam v0.8.2
   Compiling tui v0.19.0
   Compiling rayon v1.6.1
   Compiling tui-react v0.19.0
   Compiling crosstermion v0.10.1
   Compiling jwalk v0.8.1
   Compiling dua-cli v2.19.2 (/data/data/com.termux/files/home/dua-cli)
    Finished release [optimized] target(s) in 1m 27s
~/dua-cli $ cargo r --release --no-default-features --features tui-crossplatform
    Finished release [optimized] target(s) in 0.10s
     Running `target/release/dua`
  4.00 KiB .editorconfig
  4.00 KiB .gitignore
  4.00 KiB Cargo.toml
  4.00 KiB LICENSE
  4.00 KiB Makefile
  4.00 KiB etc
  8.00 KiB README.md
 12.00 KiB ci
 16.00 KiB .github
 28.00 KiB Cargo.lock
168.00 KiB CHANGELOG.md
188.00 KiB src
  1.32 MiB tests
  1.42 MiB .git
174.30 MiB target
177.46 MiB total
~/dua-cli $
flaribbit commented 1 year ago

When I add -- i, interactive terminal ui also works! Thanks

Byron commented 1 year ago

Great. Closing as it does work on Android.

If trash support is required, an issue should be raised over at the trash repository.