Comments (17)
Thanks again everyone!
Tests pass on windows now, and I have enabled travis ci windows jobs to make sure future breakage is noticed.
If you find something odd, please open a ticket. :)
from cargo-cache.
what should be tested about this ?
from cargo-cache.
Make sure the output of
cargo cache
cargo cache --autoclean-expensive --dry-run
cargo cache --info
cargo cache --list-dirs
cargo cache --top-cache-items 10
look ok (and there are no panics).
Maybe run tests (I assume this will fail since I have never done this before)
from cargo-cache.
It does show the sizes alright but autoclean
has failed with a permission problem. It fails also in the elevated mode (admin) as well.
Total size: 861.16 MB
Size of 21 installed binaries: 147.52 MB
Size of registry: 668.09 MB
Size of 673 crate archives: 66.05 MB
Size of 673 crate source checkouts: 398.16 MB
Size of git db: 45.56 MB
Size of 4 bare git repos: 20.85 MB
Size of 4 git repo checkouts: 24.71 MB
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 5, kind: PermissionDenied, message: "Access is denied." }', libcore\result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
back trace is not very useful but here it goes:
stack backtrace:
0: <unknown>
1: <unknown>
2: <unknown>
3: <unknown>
4: <unknown>
5: <unknown>
6: <unknown>
7: <unknown>
8: <unknown>
9: git_hashsig_create_fromfile
10: BaseThreadInitThunk
11: RtlUserThreadStart
from cargo-cache.
Err, I would not run this as admin.. :D
It's strange that there is no backtrace.
Is this a release build?
from cargo-cache.
Yes, it was a release build.
I have cloned the repo and run it and here is the stack trace:
d:\repositories\rust\cargo-cache>cargo run --bin cargo-cache -- -a
Finished dev [unoptimized + debuginfo] target(s) in 9.80s
Running `target\debug\cargo-cache.exe -a`
Cargo cache 'C:\Users\Ibrahim.Dursun\.cargo/':
Total size: 308.22 MB
Size of 16 installed binaries: 147.96 MB
Size of registry: 115.65 MB
Size of 129 crate archives: 14.41 MB
Size of 129 crate source checkouts: 75.87 MB
Size of git db: 44.62 MB
Size of 3 bare git repos: 19.92 MB
Size of 4 git repo checkouts: 24.70 MB
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 5, kind: PermissionDenied, message: "Access is denied." }', libcore\result.rs:1009:5
stack backtrace:
0: std::sys::windows::backtrace::set_frames
at /rustc/abe02cefd6cd1916df62ad7dc80161bea50b72e8\src/libstd\sys\windows\backtrace\mod.rs:104
1: std::sys::windows::backtrace::set_frames
at /rustc/abe02cefd6cd1916df62ad7dc80161bea50b72e8\src/libstd\sys\windows\backtrace\mod.rs:104
2: std::sys_common::backtrace::_print
at /rustc/abe02cefd6cd1916df62ad7dc80161bea50b72e8\src/libstd\sys_common\backtrace.rs:71
3: std::sys_common::backtrace::_print
at /rustc/abe02cefd6cd1916df62ad7dc80161bea50b72e8\src/libstd\sys_common\backtrace.rs:71
4: std::panicking::default_hook::{{closure}}
at /rustc/abe02cefd6cd1916df62ad7dc80161bea50b72e8\src/libstd\panicking.rs:211
5: std::panicking::default_hook
at /rustc/abe02cefd6cd1916df62ad7dc80161bea50b72e8\src/libstd\panicking.rs:227
6: std::panicking::rust_panic_with_hook
at /rustc/abe02cefd6cd1916df62ad7dc80161bea50b72e8\src/libstd\panicking.rs:476
7: std::panicking::continue_panic_fmt
at /rustc/abe02cefd6cd1916df62ad7dc80161bea50b72e8\src/libstd\panicking.rs:390
8: std::panicking::rust_begin_panic
at /rustc/abe02cefd6cd1916df62ad7dc80161bea50b72e8\src/libstd\panicking.rs:325
9: core::panicking::panic_fmt
at /rustc/abe02cefd6cd1916df62ad7dc80161bea50b72e8\src/libcore\panicking.rs:77
10: core::result::unwrap_failed<std::io::error::Error>
at \libcore\macros.rs:26
11: core::result::Result<(), std::io::error::Error>::unwrap<(),std::io::error::Error>
at \libcore\result.rs:808
12: cargo_cache::main
at .\src\main.rs:135
13: std::rt::lang_start::{{closure}}<()>
at \libstd\rt.rs:74
14: std::rt::lang_start_internal::{{closure}}
at /rustc/abe02cefd6cd1916df62ad7dc80161bea50b72e8\src/libstd\rt.rs:59
15: std::rt::lang_start_internal::{{closure}}
at /rustc/abe02cefd6cd1916df62ad7dc80161bea50b72e8\src/libstd\rt.rs:59
16: panic_unwind::__rust_maybe_catch_panic
at /rustc/abe02cefd6cd1916df62ad7dc80161bea50b72e8\src/libpanic_unwind\lib.rs:102
17: std::panicking::try
at /rustc/abe02cefd6cd1916df62ad7dc80161bea50b72e8\src/libstd\panicking.rs:289
18: std::panicking::try
at /rustc/abe02cefd6cd1916df62ad7dc80161bea50b72e8\src/libstd\panicking.rs:289
19: std::panicking::try
at /rustc/abe02cefd6cd1916df62ad7dc80161bea50b72e8\src/libstd\panicking.rs:289
20: std::rt::lang_start<()>
at \libstd\rt.rs:74
21: main
22: invoke_main
at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:78
23: invoke_main
at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:78
24: BaseThreadInitThunk
25: RtlUserThreadStart
error: process didn't exit successfully: `target\debug\cargo-cache.exe -a` (exit code: 101)
from cargo-cache.
@matthiaskrgr I have run the command with dry-run to see what directories would be removed and here is the output.
d:\repositories\rust\cargo-cache>cargo run --bin cargo-cache -- -a --dry-run
Finished dev [unoptimized + debuginfo] target(s) in 0.85s
Running `target\debug\cargo-cache.exe -a --dry-run`
Cargo cache 'C:\Users\Ibrahim.Dursun\.cargo/':
Total size: 308.82 MB
Size of 16 installed binaries: 147.96 MB
Size of registry: 116.24 MB
Size of 132 crate archives: 14.64 MB
Size of 132 crate source checkouts: 76.24 MB
Size of git db: 44.62 MB
Size of 3 bare git repos: 19.92 MB
Size of 4 git repo checkouts: 24.70 MB
would remove directory 'C:\Users\Ibrahim.Dursun\.cargo\registry/src/'
would remove directory 'C:\Users\Ibrahim.Dursun\.cargo\git/checkouts/'
I think this is happening because of the mixed up back and forward slashes.
from cargo-cache.
Oooooh, that sounds plausible. I'll have a look
from cargo-cache.
Offending directory is the second one C:\Users\Ibrahim.Dursun\.cargo\git/checkouts/
and back or forward slashes don't cause the problem.
If there are readonly files in the directory then the fs::remove_all_dir
call panicks.
let pf = PathBuf::from("D:\\something\\");
let _ = fs::remove_dir_all(&pf).unwrap();
Create a readonly file inside the something
folder to reproduce.
from cargo-cache.
It might be that git sets its internal files as read-only ( to prevent accidental deletion) and we are choking on those on windows...
from cargo-cache.
@idursun so the crash was happening in --autoclean
when fs::remove_dir::all()
failed to delete a directory.
For now I have added a small debug message that will pop up if that happens (it will still panic though).
3783607
from cargo-cache.
I'm wondering what the best solution would be...
We could
- panic as currently (probably not the best solution)
- print a warning on every file that could not be deleted
- silently ignore failures to delete files
It would help to know what kind of files could not be deleted properly.
from cargo-cache.
I was pleasantly surprised to discover that cargo-sweep does the print a warning on every file that could not be deleted
.
from cargo-cache.
Ok, we should now get a warning on every file that could not be deleted (I hope this is not too spammy) but continue execution if possible.
183ee36
from cargo-cache.
The inconsistent paths should be fixed with 682fbe4
from cargo-cache.
@matthiaskrgr I think it is the most reasonable thing to do at the moment. Thanks for the fix.
from cargo-cache.
Please let me know if there's anything else that seems odd! :)
from cargo-cache.
Related Issues (20)
- check msrv on CI
- crate source verification HOT 4
- path/to/cargo-cache has wrong cmd in --help HOT 1
- 'verify' incorrectly determines paths as missing due to different unicode representations. HOT 1
- Move static git bundling to a (default) feature HOT 7
- clean-unref: documentation & feat suggestion (recursivity) HOT 4
- cargo cache -a on a arm procesor HOT 3
- make sure http registry works
- Build failed with "error: failed to run custom build command for `libgit2-sys v0.12.26+1.3.0`" HOT 4
- cargo-cache toolchain panics HOT 3
- --keep-duplicate-crates seems to be partially broken HOT 4
- --keep-duplicate-crates version sorting not always correct
- cachepot support HOT 2
- Recompressing 'tree-sitter-haskell-74c278e7a2ef8d7d': 262.35 MB => HOT 4
- Odd wording HOT 1
- Date doesn't seem validated HOT 1
- gc: show number of seconds it took
- gc: compress multiple repos at a time (-j) HOT 2
- `cargo audit` issues found in the most recent crates.io release HOT 1
- build fails on Mac with MacPorts, because of libgit2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cargo-cache.