Byron / dua-cli

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

error[E0446]: crate-private type `FilesystemScan` in public interface #226

Closed Cellesti closed 8 months ago

Cellesti commented 8 months ago

Hi, since dua-cli v2.27.0, i receive this error while compiling:

error[E0446]: crate-private type `FilesystemScan` in public interface
  --> src/interactive/app/state.rs:42:5
   |
27 | pub(crate) struct FilesystemScan {
   | -------------------------------- `FilesystemScan` declared as crate-private
...
42 |     pub scan: Option<FilesystemScan>,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak crate-private type

I am on Alpine Linux which is still using Rust 1.72.1 (due to some issues with newer Rust on 32-bit ARM).

I think that is probably the cause of the problem, so may i know if Rust 1.72.1 is still supported by dua-cli?

Thanks.

Byron commented 8 months ago

Thanks for reporting!

As I always build applications with the latest compiler, as is done by CI, these kinds of issues won't be typically noticed. However, please feel free to submit a PR or patch for this once you have confirmed it to be working for you, and it will be merged. Thanks for your help.

Cellesti commented 8 months ago

I don't know Rust, but if anyone else submits a PR, i can help test it.

This issue is currently blocking the upgrade of the dua-cli package in Alpine, so i would appreciate it if a patch can be found, otherwise the upgrade will probably have to wait for newer Rust to become available in Alpine.

I have also asked for help on the Alpine Gitlab, so hopefully some Rust programmer who uses Alpine will be able to help fix this.

Byron commented 8 months ago

Turning pub(crate) struct FilesystemScan { into pub struct FilesystemScan { should already do the trick, in case that's easy for you to try.

Cellesti commented 8 months ago

Thanks, i've just tested that out in Alpine's Gitlab CI, dua-cli now builds successfully, and tests also pass. So, i would say it works for me.

Byron commented 8 months ago

Great! Shouldn't happen in the next release, even though it might happen again.