holmgr / cargo-sweep

A cargo subcommand for cleaning up unused build files generated by Cargo
MIT License
694 stars 31 forks source link

`sweep -s` `sweep -f` example doesn't work as expected #105

Open ekwoka opened 1 year ago

ekwoka commented 1 year ago

The docs mention doing

cargo sweep -s
cargo build or whatever
cargo sweep -f

To clean up stuff from before the build.

But the issue is that files that didn't need to be regenerated in the build will still have the old times and then be swept during the -f call despite being necessary as part of the last build. Basically making this only really work every other time it's run (with every other needing to also recreate all the files).

MacOS btw, maybe it works differently on other platforms.

It seems like this also implies that any age based sweeping will sweep currently useful artifacts that haven't needed to be updated since then due to not being changed.

bryanlarsen commented 9 months ago

For me, I believe this is similar to #3. sweep works for me on Linux, but not on Windows or MacOS. The fix in #3 works for me on Windows, but I'm not sure why atime isn't working on MacOS. I'm not mounted with noatime, and my google-fu isn't working.