Canop / broot

A new way to see and navigate directory trees : https://dystroy.org/broot
MIT License
10.35k stars 226 forks source link

Compilation of `trash` feature fails on darwin #887

Open Schweber opened 1 month ago

Schweber commented 1 month ago

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.

Canop commented 1 month ago

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.

Schweber commented 1 month ago

I see, thank you for looking into it!

Canop commented 1 month ago

Reopening, because adding trash features on Mac is a valid issue, even if I can't work alone on it