-
-
Notifications
You must be signed in to change notification settings - Fork 78
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 semver checks ignores my lockfile #675
Comments
Thanks! What would be an alternative to what we're doing today? Could c-s-c somehow ask cargo to reuse the dependency versions of another lockfile while generating the baseline rustdoc JSON? While what we're doing today could be argued to be a hack, any alternative seems like an even worse hack.
Could you say more about this, or point me to an issue where I can learn about it? We defer dependency version selection to cargo so of course if cargo does the wrong thing then c-s-c will as well. |
Updated the title to avoid potential confusion. cargo-semver-checks would never delete your lockfile, it merely ignores it. |
I disagree with changing the title and reverted it back. It doesn't just ignore it, it changes my repo. My experience with a lot of developers is that they see a change in the repo and assume its intentional and commit it, making this another source of problems. A general rule of well-formed cargo commands is they should only modify the lockfile when there is a mismatch with |
Could you provide a repro where running The current implementation is designed to create its own lockfile in a separate directory inside the |
Thanks for the clarification that it only ignores and doesn't modify my repo. I've reverted the title back to you version. |
Thanks! If you have a sec, I'd love your thoughts on this earlier comment as well 👇
|
I'll re-phrase my earlier comment: well-formed cargo commands should respect the existing lockfile. When running with a git baseline, there is no problem as a lockfile is present if its intended to be. Yes, there are questions on what to do with registry baselines. I don't have a magical end-all answer. This is something that will likely take exploration. Possible ideas
I was vague because I haven't been touching those projects in a well. The rough idea is that cargo resolves dependencies maximally so if you have two paths to a dependency with |
Thanks, that makes sense! I subscribed to the issue you linked as well — I didn't know cargo heuristically decided whether to include the lockfile in the crate.
To generate rustdoc for the current code, we create a new project and declare a path dependency on the crate being checked. As pseudocode, we do more or less the equivalent of:
Would copying over the existing project's lockfile and letting Cargo fill in the pieces work here? That sounds ideal, but my prior assumption was that it wouldn't work since the lockfile is for a completely different project. I'd love to be pleasantly surprised about that. |
See
For more context, see also zulip
According to the zulip thread, this is done because
The problems with doing this
The text was updated successfully, but these errors were encountered: