-
Notifications
You must be signed in to change notification settings - Fork 353
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
Improve googleapis use_languages extension tag #3437
Conversation
Hello @bazelbuild/bcr-maintainers, modules without existing maintainers (googleapis) have been updated in this PR. Please review the changes. |
@bazel-io skip_check unstable_url |
947450d
to
6c7eb25
Compare
@meteorcloudy @fmeum @keith could you PTAL? Thanks! |
modules/googleapis/0.0.0-20240819-fe8ba054a.bcr.1/presubmit.yml
Outdated
Show resolved
Hide resolved
This obeys requested bindings from any module.
6c7eb25
to
5bda46c
Compare
Require module maintainers' approval for newly pushed changes.
@fmeum Tests also succeeded for Bazel 8.x. |
Having thought more about this, I do have some concerns about this. By allowing BCR modules to start using @meteorcloudy @Wyverald Is official Bzlmod support for |
There are already various BCR modules using googleapis. This basically just allows us to test these targets in the BCR CI as well. If you prefer modules using googleapis without tests on BCR in the meantime please let me know. |
As far as I understand the module extension logic in the current version, only the root module can enable languages. For languages such as C#, even the root module likely can't do that since Presumably this means that any user of a module that transitively uses The problem with module extensions that do something for non-root modules is that they very quickly form public API that is very difficult to change - there is no way to have |
How can I tell the BCR CI to add a call to
Where is the difference to requiring this in the root module? In both cases, one needs to configure the extension. Let's assume in the future the call to |
It's quite possible that the new "API" will be that there are separate I'm not fully against making this change, but I would like to give the maintainers of the upstream repo a say in this. |
This would also break transitive modules with the current version as they require the targets to exist. When they are moved to separate modules, those transitive dependency modules would equally break. |
That's not necessarily the case: We could arrange this in a way where users depending on You are right that the module extension could become a noop in the future. I don't enough about |
I don't know what exactly it is used for but I know that a depending module doesn't need the |
I just want to clarify that this change:
|
Sorry for the late reply.
Unfortunately not. The googleapis team at Google aren't very interested in the Bazel use case.
Nobody should use The short version of my opinion on this PR is that it's in the right direction. The long version follows. The only parts of the I had tried before to write an "injection" mechanism, where the targets for e.g. the Java API aren't generated if rules_java hasn't "injected" itself into googleapis, but that has several problems: 1) core rulesets like rules_java would need to add a dependency on googleapis to perform injecion (this wasn't really a problem pre-Bazel 8); 2) the various more exotic APIs (Ruby, TypeScript, etc) named in the current googleapis module are only used by itself, so they're "dev deps" that would never really be "injected"; 3) point 2 means that we could simply just always generate all the core language bindings and have googleapis always depend on the core rulesets, but this becomes slightly more of a problem in Bazel 8+. So the solution depends on how bad we think 3) is. If it's not a big deal for googleapis to always depend on rules_go, then we could just make the Curious to hear what y'all think. @mering, if we could hold this PR for one more day for thoughts on this, you might end up with an even simpler PR (if we decide to make the extension no-op). |
Can we have modules like |
IIUC consumers would have to adapt to the new modules as a breaking change. The current extension could create these repositories or opt as a noop for the course of the migration. So I don't see any conflicts with this PR. |
I think that there is a simpler solution: We can extend the module extension in this PR to accept not just tags with Each module will be able to get e.g. @mering What do you think of this approach? It's not much more effort than your current PR, which could serve as the base.
That's the crucial part for me here: While the PR does not add new API that's hard to maintain, it adds API expectations that we won't be able to meet longterm. It creates the expectation that root modules no longer need to manually configure the |
I still think that the root module should not need to take care of its transitive dependencies. Isn't this the whole point of Bzlmod?
I have no experience with repository rules or module extensions and I don't have capacity to work on more than this PR. |
No problem. If we end up agreeing on an approach along the lines of #3437 (comment), I can implement it.
Is it clear that this will remain so? As soon as there is a |
As this PR doesn't seem to follow a desired approach, I am going to close it. Feel free to continue the discussion about a more preferable approach here. |
#3472 implements the approach I described in #3437 (comment). @mering I hope that this addresses all your use cases. After your PR #3470, I could also add support for |
Thanks for going ahead and put your suggestion into code to make it more understandable. IIUC one would still use the targets from |
That's correct. My favorite setup for googleapis would be separate modules per language where each module
This is also correct. I don't think that there is a way to realize "strict deps checking" without moving targets to other repos.
The crucial difference is that the multi-module design ensures that the transitive module dependencies are only those actually needed by the root module and its transitive deps that need googleapis. If you and your deps don't need This is particularly important as we may need to extend the scope of googleapis in the future (think PHP/ruby/rust/...). We could easily add |
This obeys requested bindings from any module.