Compilation of `trash` feature fails on darwin
The compilation of broot on x86_64_darwin fails with
error[E0433]: failed to resolve: could not find `os_limited` in `trash`
--> src/app/panel_state.rs:162:34
|
162 | let res = trash::os_limited::list()
| ^^^^^^^^^^ could not find `os_limited` in `trash`
|
note: found an item that was configured out
--> /private/tmp/nix-build-broot-1.39.0.drv-0/broot-1.39.0-vendor.tar.gz/trash/src/lib.rs:350:9
|
350 | pub mod os_limited {
| ^^^^^^^^^^
error[E0433]: failed to resolve: could not find `os_limited` in `trash`
--> src/app/panel_state.rs:164:32
|
164 | trash::os_limited::purge_all(items)
| ^^^^^^^^^^ could not find `os_limited` in `trash`
|
note: found an item that was configured out
In the readme of trash it says:
The library supports Windows, macOS, and all FreeDesktop Trash compliant environments (including GNOME, KDE, XFCE, and more).
Is there something that can be done about it? I would like to enable trash as the default build Feature in nixpkgs.
This README is misleading IMO: all the interesting features like listing the content of the trash or purging it are implemented only for Linux and Windows. See https://docs.rs/trash/latest/trash/os_limited/index.html
If somebody finds another crate, or implements the missing features, we could make them available in broot but I can't really work on Mac specific things as I don't own a Mac.
I see, thank you for looking into it!
Reopening, because adding trash features on Mac is a valid issue, even if I can't work alone on it
Related https://github.com/Byron/trash-rs/issues/8.
Long story short there seems to be some API limitations on macos that makes implementing trash operations on mac rather difficult.
Is it possible to compile without the trash feature?
Yes. You can exectute cargo install --locked broot. This will install broot without any optional feature.
If you want to try compile broot with the clipboard feature, do cargo install --locked --features clipboard broot.
Self answer: cargo build --release --features "clipboard"