Replies: 4 comments 12 replies
-
What are the cases where this has occured? Obviously, we've had the notify issue most recently, but that was because we were depending on a pre-release version, so semver isn't applicable. I'm slightly surprised cargo lifted the version up for us in that one, to be honest. I think we should always ensure that we're locked into semver compatible versions. So we should pin for notify, but for crates with other releases we should be good players in the ecosystem and allow updates. |
Beta Was this translation helpful? Give feedback.
-
Fixing all dependencies will prevent users from deliberately using newer versions of said dependencies or adding dependencies that specify a dependency on a newer, but still semver compatible, version of those dependencies. Cargo allows multiple non-semver compatible versions of a crate, but when two versions are semver compatible, cargo will force one of those versions to be used. If one of them is pinned and the other is newer or pinned, cargo will give an error message that it couldn't resolve the versions. This error message is confusing to pretty much everyone who doesn't know about this rule and is only fixable by patching the crate that pinned the dependency version to no longer pin the dependency version. |
Beta Was this translation helpful? Give feedback.
-
I an not a fan of fixing versions inside a library or framework (and that is what Bevy is for now). Several other projects also share this opinion, for example in NPM it is impossible to publish a package-lock file for modules, which fixes the versions used. That would leave option 3. I'd say that such breakages do not happen too often. For "notify" there was no guarantee to begin with, so mentioning it does not help at all. Bevy should build on released dependencies or encourage authors to do a stable release and follow semver - maybe providing help if necessary to complete missing pieces. The fourth one if I have the same one in mind as you (I don't remember which one it was either) afair followed an external version scheme (of a spec or something?) and changed to use it's own versioning by now. So there are two incidents, which can be caught by running CI regularly. I'd welcome a versioning, which usually allows for semver compatibility, but has the ability to prevent bad versions (using ranges with "multiple requirements"). That would allow Bevy to prevent known bad versions from being used, while also keeping the ability for users to depend on a newer version. As far as that error message is concerned, maybe the Bevy CLI could include tooling to make sure that the correct versions are installed by following best practices for checking dependencies? |
Beta Was this translation helpful? Give feedback.
-
Just to be clear: the latest breakage isn't an isolated incident. I don't have links off the top of my head, but "dependencies breaking semver" has broken us 5-ish times in Bevy's short lifespan. We have a relatively large dependency tree (which unlike some people, I am proud of ... I don't want to live in a world where everyone reinvents the wheel or where projects pretend they can write literally everything better than "the commons" as a whole). However this means that we are at the whims of our dependencies not breaking semver for every released version of bevy for the rest of time. If we don't lock our dependencies, that means that some crate in Bevy 0.3's tree could break semver years down the line. That means that unless you are on a current version of Bevy, your projects might just stop working one day. To me that is completely unacceptable. If you build something in Bevy, it should continue to work in perpetuity. Therefore we either need to commit to fixing all dependency semver issues for all bevy releases for the rest of time (and have a good way of detecting this proactively), or we need to lock our dependencies to a specific version on each release. Additionally, for teams developing a product on the current Bevy releases, this creates a situation where a "stable" bevy release could be broken by sloppiness in another project we don't control. Imagine you have a team crunching to release a game within the next day or so, and suddenly you can't build your game anymore because |
Beta Was this translation helpful? Give feedback.
-
It happened several times: a dependency breaks semver (as understood by Cargo), and this breaks Bevy main, and sometimes the released version. When this happens, we have basically two ways forward:
To avoid getting into this situation, we could:
Fix all dependencies on main
Fix all dependencies to be exact versions. Dependabot will open PRs to update for every dependency update.
Currently, Dependabot runs weekly and can have a maximum of 5 PRs ongoing at the same time.
Pros:
Cons:
Fix all dependencies in released versions
Before a release, setup a branch, fix all dependencies in that branch, then release from the branch.
Pros:
Cons:
Keep as is
Keep as it is currently, handle issues as they happens.
Pros:
Cons:
So... what do people think?
Beta Was this translation helpful? Give feedback.
All reactions