Skip to content
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

Using pre-release version #311

Open
xofyarg opened this issue May 2, 2024 · 4 comments
Open

Using pre-release version #311

xofyarg opened this issue May 2, 2024 · 4 comments

Comments

@xofyarg
Copy link
Contributor

xofyarg commented May 2, 2024

Hi,

The version is bumped to a pre-release version after each release, which I found is tricky to patch. Here's my use case: I'm currently put domain = "0.10.0" in Cargo.toml, then want to upstream something with a PR. While waiting for the new release, I can drop a patch in Cargo.toml to use my branch. But the source is now on version 0.10.1-dev, so I cannot just simply patch the version from crates-io, as pre-release won't be selected. I have several crates that depends on domain, those will be included in the final binary, so it's cumbersome to update each of them, comparing to set a single patch section in the binary.

I wonder how do you handle the pre-release number in your workflow, any chance to avoid using pre-release ones?

@partim
Copy link
Member

partim commented May 3, 2024

I currently always change the actual dependency to a git dependency (or even a local path) instead of patching. Admittedly, the main reason is that I can’t remember how all this patching works, but it has the advantage that CI and later cargo package catch any accidentally left in change. But I can see how this is annoying if you have to do it in lots of places.

I had a quick lock at some repositories of other projects and it seems people generally leave the version number alone until it is time to release. I suppose we can do that. Not sure if there will be issues after we merge a PR with a breaking change, though?

@xofyarg
Copy link
Contributor Author

xofyarg commented May 3, 2024

Not sure if there will be issues after we merge a PR with a breaking change, though?

I guess for people who use crates.io, it doesn't matter. And for those put a git URI, they are safe if they pin to a rev. It will become tricky if they pin to a branch and don't keep Cargo.lock, but I doubt it can be counted as a proper use case.

The risk of bumping to a non-exist version number, is that it can be released by accident, although could be yanked later if noticed. So as you said, lots of people just leave the version number alone, as the current version already exists on crates.io, further attempt to release the same thing will result an error.

@ximon18
Copy link
Member

ximon18 commented May 6, 2024

The problem I have (if I understand correctly, and apologies if I get anything wrong here as I'm writing this from memory on a phone) with the version number remaining unchanged on main post release is that any commits made to main then cause there to exist two different versions of the application with the same version number.

Any build against main will report itself incorrectly as being the same version as the last release tag.

For example for our Docker images this will mean that the image published from main to the latest tag will report itself as having the same version number as the tagged release version for example.

@partim
Copy link
Member

partim commented May 6, 2024

The approach will be problematic for repositories that produce binary packages for sure. But those are very unlikely to be used as external dependencies, so the current approach should be okay for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants