Split googleapis into per-language modules#3472
Conversation
|
Hello @bazelbuild/bcr-maintainers, modules without existing maintainers (googleapis-cc, googleapis-go, googleapis-java, googleapis-python, googleapis) have been updated in this PR. Please review the changes. |
dfcb309 to
0d8947f
Compare
8f7654a to
c54877c
Compare
|
Hello @bazelbuild/bcr-maintainers, modules without existing maintainers (googleapis-cc, googleapis-go, googleapis-grpc-cc, googleapis-grpc-java, googleapis-java, googleapis-python, googleapis) have been updated in this PR. Please review the changes. |
4d80faa to
979ea95
Compare
|
Hello @bazelbuild/bcr-maintainers, modules without existing maintainers (googleapis-cc, googleapis-go, googleapis-grpc-java, googleapis-java, googleapis-python, googleapis) have been updated in this PR. Please review the changes. |
60cfbd8 to
6617794
Compare
2ad8da5 to
432a13e
Compare
|
Another thing which just came to my mind: Uploading new versions will become much more work with this approach. This is especially relevant since we don't have active maintainers for this package and are even further away from release automation. So it will become less likely that people contribute version updates. |
|
We should avoid making updates more complicated, but I don't see why this would make it so. Instead of the patches, there are now a few overlay files, but that's the only change I see. The "flavor" modules only need new versions if the targets generated in googleapis change in a fundamental way. Do you see other downsides to this approach? I'm thinking of adding a tool to the repo that creates a new version of an existing module by symlinking over files that haven't changed and replacing the old version with the new version in module files, URLs and prefixes. That should make it very easy to update googleapis, regardless of which approach is used. What do you think about that? |
d7bf807 to
0398bd8
Compare
I raised everything which was on my mind for now in #3437 and here.
It would be great if such tool would also handle patches (at least in cases where it applies with somewhat larger fuzzing for moved lines and skip already applied patches). It could create a temporary git repo for this for example ( |
|
@meteorcloudy @Wyverald Friendly ping |
|
Looks good to me, but wait for @Wyverald to confirm this is the way to go. |
|
Sorry about the delay -- this slipped my radar and I've been distracted by other work. I'll take a look later today. |
|
While I really like this approach to the extensions, I'm actually wondering if it's better to make a bigger break to simplify things. What I mean by that is not having googleapis provide language-specific targets and only provide The main reason I see for having googleapis provide the language-specific targets at all is to ensure that there's no duplication of generated code. Language-specific proto library rules should all be implemented with aspects though, which inherently avoids the duplication problem. The downside of course is that there's a much bigger change for downstream users. Additionally, it would be best if the above change could be made on googleapis itself rather than having someone maintain that as patches to BCR. |
|
@SanjayVas As much as I would like that, it seems almost impossible without cooperation from upstream and as we have learned, they don't care about Bazel at all. |
|
Hey, I know I promised to take a look today, but this is quite a big change and I'd like to understand the context better before making a call -- I'll continue to read this (and @mering's previous PR) tomorrow. |
Wyverald
left a comment
There was a problem hiding this comment.
I've finally caught up, I think. Overall, I really like this approach -- it strikes the perfect balance between working with what we have (the googleapis source repo) and ensuring future adaptability. Kudos! :D
A few more points I was thinking of:
- First off, just a comment: I had been working on a draft PR that had a similar idea, except that the "registration" of a rule was done by the ruleset itself. This is obviously not great in hindsight, especially compared to this PR :P
rules_javashouldn't need to depend ongoogleapis. On the other hand, this PR suffers a similar (minor) problem to that PR, in that there's no "strict deps" for registration: if my dep has a dependency ongoogleapis-java, I get Java rules for free, which means that a version upgrade of my dep could break me. I don't think this is a solvable problem though, so no sweat. - There's a fair amount of code in this PR, all in overlay files. I think this is the sort of stuff that would benefit from being in an actual repo (easier to review, etc). Probably
bazel-contribcould host this. The repo would contain sources for allgoogleapis-*modules, and even agoogleapis-registrymodule that contains nothing but theregisterextension definition. Then we wouldn't need any overlay in the BCR (except forgoogleapis's MODULE.bazel file itself). - One of the requests from the protobuf team was support for a "nodep"
bazel_dep; that is, specification for the minimal required version of a certain module, without actually introducing a dep on it (so the requesting module cannot use it, even if the dep is present in the dep graph). This would make it more feasible for them to split up theprotobufmodule. Similarly, it could probably help smooth the version requirements here: the "central"googleapis(orgoogleapis-registry) module could have a "nodep" spec for allgoogleapis-*flavors, so that nobody ever has to worry about version skew. Obviously no action required for this PR, but I'm interested to hear your thoughts.
Yes, this is a caveat that is relevant, but I also don't see a way to avoid this.
I'm still not sure what I prefer, but this approach has an important drawback: It gets much harder to contribute new googleapis versions. Since upstream is not going to support this, we would need a dedicated If we keep the sources in the BCR, the users of the module are in more direct control over the module (assuming we always have sufficiently many maintainers). Since the overlays should change only very rarely (essentially someone adds a new
Yes, that's the missing piece to making this design maintainable in the long run - without it, we wouldn't have a way to force new |
To be clear, the |
540aafd to
56d9a90
Compare
|
Hello @bazelbuild/bcr-maintainers, modules without existing maintainers (googleapis-cc, googleapis-go, googleapis-grpc-cc, googleapis-grpc-java, googleapis-java, googleapis-python, googleapis-rules-registry, googleapis) have been updated in this PR. |
|
This is now stacked on #3786, which adds the separate modules. |
56d9a90 to
6d15e80
Compare
|
Hello @bazelbuild/bcr-maintainers, modules without existing maintainers (googleapis) have been updated in this PR. |
Wyverald
left a comment
There was a problem hiding this comment.
thank you again for putting this together! I'm excited to see this finally usable :)
Introduces new
googleapis-*modules that contain the per-language module dependencies needed to support the individual rules used by the maingoogleapismodule. This allows BCR modules to declare dependencies on language-specific rules ingoogleapiswithout requiring that module to depend on every possible language ruleset, which isn't sustainable.This results in a breaking change for root modules that previously used the
switched_rulesextensions. These modules now need to explicitly declare deps on thegoogleapis-*flavors they need, but will be guided through the process by error messages.In the future, new flavors can be added in a backwards compatible way.