joshuto icon indicating copy to clipboard operation
joshuto copied to clipboard

[Bug Report] could not compile 'trash' (Android Termux)

Open wmdhs12138 opened this issue 1 year ago • 5 comments

I use command 'cargo install joshuto' to compile the project, but unable to finish compile due to the bug: Screenshot_20230529-150558~2.png

wmdhs12138 avatar May 29 '23 07:05 wmdhs12138

After delete all things about 'trash', the project compile and run successfully.

Screenshot_20230529-154508~2.png

wmdhs12138 avatar May 29 '23 07:05 wmdhs12138

Quickly checked the code of "Trash2.1.5", it should be a platform compatibility issue. 屏幕截图 2023-05-29 164736 微信图片_20230529164855

wmdhs12138 avatar May 29 '23 08:05 wmdhs12138

For now, the fix is to disable the feature recycle_bin inside Cargo.toml.

A future solution could be to only allow this feature on platforms that trash supports.

kamiyaa avatar Jul 04 '23 21:07 kamiyaa

For now, the fix is to disable the feature recycle_bin inside Cargo.toml

new error on trying to do exactly this. am i just disabling the feature wrong? i tried, in Cargo.toml:

  • deleting every line with the word "trash" on it
  • deleting the recycle_bin line in [features]
  • setting recycle_bin = []
  • setting default = ["devicons", "mouse", "syntax_highlight"]
  • running cargo build --target aarch64-linux-android --no-default-features --features "devicons,mouse,syntax_highlight" in my shell
  • trying to diagnose the problem with cargo tree -e features -i joshuto

here's the error

error[E0433]: failed to resolve: use of undeclared crate or module `trash`
   --> src/io/io_worker.rs:328:9
    |
328 |         trash::Error::Unknown { description } => {
    |         ^^^^^ use of undeclared crate or module `trash`
    |
help: consider importing one of these items
    |
1   + use ansi_to_tui::Error;
    |
1   + use core::error::Error;
    |
1   + use core::fmt::Error;
    |
1   + use crate::io::io_worker::io::Error;
    |
      and 15 other candidates
help: if you import `Error`, refer to it directly
    |
328 -         trash::Error::Unknown { description } => {
328 +         Error::Unknown { description } => {
    |

error[E0433]: failed to resolve: use of undeclared crate or module `trash`
   --> src/io/io_worker.rs:331:9
    |
331 |         trash::Error::TargetedRoot => {
    |         ^^^^^ use of undeclared crate or module `trash`
    |
help: consider importing one of these items
    |
1   + use ansi_to_tui::Error;
    |
1   + use core::error::Error;
    |
1   + use core::fmt::Error;
    |
1   + use crate::io::io_worker::io::Error;
    |
      and 15 other candidates
help: if you import `Error`, refer to it directly
    |
331 -         trash::Error::TargetedRoot => {
331 +         Error::TargetedRoot => {
    |

error[E0433]: failed to resolve: use of undeclared crate or module `trash`
   --> src/io/io_worker.rs:359:25
    |
359 |         if let Err(e) = trash::delete(path) {
    |                         ^^^^^ use of undeclared crate or module `trash`

error[E0433]: failed to resolve: use of undeclared crate or module `trash`
  --> src/error/error_type.rs:59:11
   |
59 | impl From<trash::Error> for JoshutoError {
   |           ^^^^^ use of undeclared crate or module `trash`

error[E0433]: failed to resolve: use of undeclared crate or module `trash`
  --> src/error/error_type.rs:60:18
   |
60 |     fn from(err: trash::Error) -> Self {
   |                  ^^^^^ use of undeclared crate or module `trash`

error[E0433]: failed to resolve: use of undeclared crate or module `trash`
   --> src/io/io_worker.rs:326:33
    |
326 | fn trash_error_to_io_error(err: trash::Error) -> std::io::Error {
    |                                 ^^^^^ use of undeclared crate or module `trash`

Beethoven-n avatar Jul 15 '23 23:07 Beethoven-n

Should be fixed in 461f09532ca9cb8b104b03927843e48779747d7d by disabling the recycle_bin flag

kamiyaa avatar Jul 23 '23 19:07 kamiyaa