Replies: 1 comment
-
I think that B really shouldn't bump its compatibility level in this situation:
None of this gets better if B also bumps its compatibility level and the pain that A's bump causes is distributed in the expected fashion: direct dependents of A need to take action specific to A, everyone else "just" needs to keep their direct deps up-to-date. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
From time to time, libraries make breaking changes. Downstream projects can then get broken when all they did was upgrade a dependency on a library to a newer version.
To combat this, Bazel has the
compatibility_level
concept, roughly corresponding to the "major" version of SemVer. Supposedly, a breaking change should be accompanied by an increase of thecompatibility_level
. In practice, however, this field is rarely updated, since Bazel throws an error when multiple versions of a the same module exist in the dep graph, and those versions have mismatching compatibility levels.Nobody likes this situation. People hate it when compatibility levels aren't bumped: breaking changes aren't signaled in any way, so a downstream project gets broken on a simple dependency upgrade. People also hate it when compatibility levels are bumped: it causes a cascading "sweep" of the entire ecosystem, where all transitive dependents of the library have to acknowledge the compatibility level bump one way or another.
If anyone has ideas on how to improve the situation, please share them here!
More color
bazel_dep.max_compatibility_level
helps. This field was added in Bazel 6.2.0, and allows a module to declare its tolerance of a version upgrade up to certain compatibility level skips. It's no panacea, but can lessen the pain if enough modules in the ecosystem diligently specify it.Beta Was this translation helpful? Give feedback.
All reactions