-
-
Notifications
You must be signed in to change notification settings - Fork 266
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.lock must be updated too for version #1201
Comments
Is the issue that the Cargo.lock file is not being changed at all or is the issue that Cargo.lock is not being added to the commit? |
The |
I attempted to reproduce this in my Rust project. After creating a commit with cz commit, I executed cz bump to update the version, and both the Cargo.toml and Cargo.lock files correctly reflected the version change. |
Normally if your editor is running, it will pick up changes to the folder, and run cargo commands which automatically update the Fixing this is actually a bit hard because of workspaces, and because you can define workspaces with
so you'd have to use |
Hi @woile and @Lee-W if provider.config.settings.get("version_provider") == "cargo":
cmd.run("cargo generate-lockfile")
files.append("Cargo.lock") # bump's commit files in But things need to clarify are:
References:
Let me know if this workaround is legit maybe I can have a chance to work on it. |
This workaround looks good to me, and we probably need to make this behavior configurable and default to false.
run it without encountering error code or using
a warning should be good enough I think |
I would avoid the dependency with cargo. It won't really work with the GitHub actions and dockerfile's. So it will only create problema for people who run it in their computers and it works and then it won't work in the CI. |
I think that the best approach it's only to modify the cargo.lock with toml lib, not using cargo to recreate the cargo.lock (i think that a change on the version field must not touch anything else on the cargo.lock file). |
Description
In rust when you change the version of the app, the Cargo.lock file must be changed too.
Possible Solution
Using the same toml parser, must change the
package->name = <same that Cargo.toml>->version
Additional context
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: