Open aiuto opened 4 weeks ago
Possible solution:
bazel_dep(min_version="...", [max_version="..."])
max_version
rules_proto only cares about the most backwards portable pieces of rules_pkg, so it would set min_version="0.1.0"
. Then it could pick up either the 0.x series or the 1.x series.
Another solution: Loops in module dependencies that come back to different compatibility levels are allowed, with a warning message.
Or that the compatibilty_level of anything specified in the project MODULE.bazel wins in favor of any explicit versions called out transitively. Maybe that happens in general, but not if the compat level is in the module()
stanza.
- Allow
bazel_dep(min_version="...", [max_version="..."])
We already have this: https://bazel.build/rules/lib/globals/module#bazel_dep.max_compatibility_level
OK. That is half the battle. But the problem remains that I have to modify rules_proto to push my new version of rules_pkg. That is a lot of friction.
Well, yes... I don't know what your expected outcome is. If you upload a version of rules_pkg
which transitively depend on some rules_proto
, you need to at least depend on a rules_proto
that can work with the rules_pkg
you're uploading. That seems reasonable to me.
At the end of the day, incrementing the compatibility level of your module is a big deal. Bazel's default here is to be safe and disallow multiple compatibility levels to coexist -- the other alternatives are bad in their own ways.
What happened?
Trying to add rules_pkg/1.0.0, which bumps compatibility_level. Presubmit fails:
So, the obvious problem with enforcing this
Version
How to reproduce
Any other information?
No response