You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using cargo clean it is currently impossible to only clean the debug artifacts, while keeping the release and documentation artifacts intact. A use case for this is the cargo subcommand cargo-bloat's use of cargo clean for removing artifacts before timing a build, as described in RazrFalcon/cargo-bloat#33.
Describe the solution you'd like
I propose a flag cargo clean --debug to only clean debug artifacts, similar to how cargo clean --release only cleans release artifacts. This doesn't seem too hard to implement for me, so if this is accepted, I'd like to try and implement this myself if that is okay 😄
Notes
The phrasing for the --release flag in the help output is confusing to me. It says "Whether or not to clean release artifacts". To me this suggests that if you don't supply the --release flag, the release artifacts are not cleaned, which is not the case. I had to test out the behavior to see that not providing --release in fact removes the entire target directory. To me the phrasing "Clean only release artifacts" would be much clearer. The same goes for the --doc help output.
The text was updated successfully, but these errors were encountered:
As part of named profiles (#6989), cargo clean will gain a --profile flag to clean just a specific profile. --release will be an alias for --profile=release, and you can specify any profile.
The documentation for the clean command could definitely use some improvement. It's a little tricky since there are a number of problems with how clean works.
Describe the problem you are trying to solve
Using
cargo clean
it is currently impossible to only clean the debug artifacts, while keeping the release and documentation artifacts intact. A use case for this is the cargo subcommandcargo-bloat
's use ofcargo clean
for removing artifacts before timing a build, as described in RazrFalcon/cargo-bloat#33.Describe the solution you'd like
I propose a flag
cargo clean --debug
to only clean debug artifacts, similar to howcargo clean --release
only cleans release artifacts. This doesn't seem too hard to implement for me, so if this is accepted, I'd like to try and implement this myself if that is okay 😄Notes
The phrasing for the
--release
flag in the help output is confusing to me. It says "Whether or not to clean release artifacts". To me this suggests that if you don't supply the--release
flag, the release artifacts are not cleaned, which is not the case. I had to test out the behavior to see that not providing--release
in fact removes the entire target directory. To me the phrasing "Clean only release artifacts" would be much clearer. The same goes for the--doc
help output.The text was updated successfully, but these errors were encountered: