-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cargo clean --release removes entire target directory without warning #6339
Comments
I'm not sure why |
Having taken a quick look at the tests, it seems |
Yep, I can reproduce this too: 21:39:38 $ cargo new foo
Created binary (application) `foo` project
21:39:42 $ cd $_
21:39:44 $ cargo build
Compiling foo v0.1.0 (/s/foo)
Finished dev [unoptimized + debuginfo] target(s) in 0.80s
21:39:56 $ cargo build --release
Compiling foo v0.1.0 (/s/foo)
Finished release [optimized] target(s) in 0.35s
21:39:59 $ ls -l target
total 0
drwxr-xr-x@ 12 dnw staff 384 20 Nov 21:39 debug/
drwxr-xr-x@ 11 dnw staff 352 20 Nov 21:39 release/
21:40:03 $ cargo clean --release
21:40:11 $ ls -l target
ls: target: No such file or directory
21:40:13 ! cargo -Vv
cargo 1.30.0 (a1a4ad372 2018-11-02)
release: 1.30.0
commit-hash: a1a4ad37271b61209cd55d21f2c83f2773cbe113
commit-date: 2018-11-02 |
leaves you with a |
Only if fully fixing it isn't possible, sure! |
Clean only release artifacts if --release option is set Fixes #6339
Problem
Running
$ cargo clean --release
seems to silently remove the entire target directory. I would expect at least a warning that this would happen when passing the '--release' flag since the intention was to only clean the release build.The text was updated successfully, but these errors were encountered: