-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 -p removes fingerprints for any package that shares a prefix with the target #10069
Comments
@rustbot claim |
Maybe I'm missing something, but don't filenames in cargo/src/cargo/core/compiler/context/compilation_files.rs Lines 522 to 526 in 0deeea8
I'm not sure how to access this from I understand the codebase enough to do the rest of the refactor here, but I just can't figure out how to go from the semver to the filenames in I think there's a pretty simple solution for the |
Oh, yeah, you're right — matching on semver wouldn't work here. Good catch! I agree, removing explicitly each version from the |
I'm still not sure how to determine a filename from the Even if I get a match between the spec's version and the version of a package I visit in a Resolve walk, there's still no way to map that matching package to the build artifacts in the target directory without a major refactor of I can push a PR that fixes |
Hmm, I see what you mean. I wonder if the way to go here instead then is to use |
Filtering the entries returned by the glob seems like it would be a workable solution. @russweas are you still planning on working on this, or would you mind if I took a stab at it? |
@LovecraftianHorror go for it! I just graduated, moved, and started a new job, won't have time for open-source for a while... |
Problem
cargo clean -p foo
will remove the fingerprint files for all crates that start withfoo-
due to this glob:cargo/src/cargo/ops/cargo_clean.rs
Line 137 in e11cd81
Steps
Possible Solution(s)
This one is trickier to fix than #10068. The "best" option is likely to walk all the versions in the
Resolve
and remove each one explicitly rather than relying on aglob
. This would also allow addressing this TODO:cargo/src/cargo/ops/cargo_clean.rs
Lines 102 to 109 in e11cd81
Barring that, the removal could walk the results of the glob and then do filtering using something that checks for exactly
{pkg.name()}-{semver-pattern}
(maybe with a regex).Notes
No response
Version
The text was updated successfully, but these errors were encountered: