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

Main branch version can prevent Cargo overriding Bevy #6451

Closed
scepea opened this issue Nov 2, 2022 · 5 comments
Closed

Main branch version can prevent Cargo overriding Bevy #6451

scepea opened this issue Nov 2, 2022 · 5 comments
Labels
A-Meta About the project itself C-Bug An unexpected or incorrect behavior C-Usability A targeted quality-of-life change that makes Bevy easier to use

Comments

@scepea
Copy link

scepea commented Nov 2, 2022

Bevy version

0.8.1 / 0.9.0-dev (but would apply to any minor version increment with current release process)

What you did

Attempted to use Cargo's patching feature to override Bevy as a dependency. This was to make use of the recently added ndc_to_world method in Camera.

[dependencies]
bevy = "0.8"
bevy_rapier3d = "0.17.0"

[patch.crates-io]
bevy = { git = "https://github.com/bevyengine/bevy?rev=37860a0" }

What went wrong

Cargo ignores the patch since the minor version is has been incremented by that commit. Cargo only allows dependencies to be overriden where the override's patch number is greater.

Additional information

I fixed this by:

  1. Checking out Bevy to the desired commit.
  2. Changing the version in cargo.toml to 0.8.2.
  3. Using a path override in the patch bevy = { patch = "local/path" }

The initial cargo configuration would patch as expected if the main branch didn't have a higher minor version. Looks like this is done as part of the last release to avoid version confusion in the dev docs (#4230).

I suggest that the release process not increment the minor version number until such a release is imminent. If main currently had a version of 0.8.2-dev then I think this would clear up any dev docs confusion, while still helping users work on the bleeding edge.

So the versioning for this release cycle would be 0.8.2-dev until release day, 0.9.0 for the release, 0.9.1-dev immediately after.

@scepea scepea added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Nov 2, 2022
@scepea scepea changed the title Main branch version can prevent Crargo overriding Bevy Main branch version can prevent Cargo overriding Bevy Nov 2, 2022
@alice-i-cecile alice-i-cecile added C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Meta About the project itself and removed S-Needs-Triage This issue needs to be labelled labels Nov 2, 2022
@alice-i-cecile
Copy link
Member

This would definitely make your use case of cherrypicking commits easier, but I'm also reluctant to change to e.g. 0.9.1-dev because the semantics are wrong: this would be an alpha version of 0.10, and breaking changes should be expected. What if we used e.g. dev-0.10? Does that play nice with cargo?

@mockersf
Copy link
Member

mockersf commented Nov 2, 2022

Cargo ignores the patch since the minor version is has been incremented by that commit. Cargo only allows dependencies to be overriden where the override's patch number is greater.

This is actually be design and why Bevy updates after the release to 0.next.0-dev.
Bevy games tend to use a few third party plugins (like bevy_rapier) and they tend to not work well when mixing their released version with Bevy from the main branch. Updating to a semver incompatible version means that for it to work, the plugin also has to provide a version targeting the in-development version.

@alice-i-cecile
Copy link
Member

Ah right, I'd forgotten that part of the discussion. I'm going to close this as won't fix for now, but feel free to continue debating here if you feel strongly.

@alice-i-cecile alice-i-cecile closed this as not planned Won't fix, can't repro, duplicate, stale Nov 2, 2022
@scepea
Copy link
Author

scepea commented Nov 3, 2022

I don't feel strongly enough to argue the point further but do think it's important to document that currently the release process is making it harder to work on the bleeding edge. If that's by design then that's just something we end users have to accept. The workaround is documented for anyone else following the path.

I have noticed that other projects don't tend to change their version number until they're ready to release though. Perhaps as Bevy's API stabilises with future releases this issue should be reconsidered.

@alice-i-cecile
Copy link
Member

Makes sense. I'd be happy to review and approve a PR documenting the process here: perhaps in the README?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Meta About the project itself C-Bug An unexpected or incorrect behavior C-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

No branches or pull requests

3 participants