-
Notifications
You must be signed in to change notification settings - Fork 278
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
[Api Discussion via docs] Adding a more manual/advanced scalapb rule #763
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@ianoc thanks for taking the time! |
In general I'm not against this if you have concrete use-cases internally you're aware of. |
Very interesting. #751 and #753 indeed sound very very similar to our needs and concerns. Am I missing something? Are these indeed the benefits but you think I'm mistaken about protoc support for this? |
@ittaiz You can with protoc for sure separate out the proto's from having multiple copies. (using the internal function of src to jar thats in there now would do this). The aspects make the whole chain fully automatic which is the big win(to add the aspects to our largest scala repo i had to add the toolchain then strip the per-target options -- so a pretty simple PR, it immediately dropped 6-8 minutes off average our CI times for the repo which was super nice). Aspects make a few things better here though:
I think mostly what I was suggesting here is pretty close to what you were thinking about doing pre-aspects here, just having a rule that wouldn't produce all the classes all the time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I would like to use the with_java
option to be able to gradually migrate over from java protobufs.
@ianoc any plans to pick up work on this PR again? |
No I'm afraid there didn't seem to be a consensus on design to drive it. So I've long since moved onto other things. |
closing as stale, feel free to reopen |
In the change i made to make these rules aspect based previously it has blocked/made difficult some of scalapb's options that don't translate well into aspects (and aren't supported in the java protobuf so don't come up there). This proposes adding another rule which would give full flexibility in invoking the scalapb to cover these use cases.
Using both rules in a repo does pose the risk of classpath conflicts of multiple implementations that are different of the same class name. Though I don't see a way around this issue in general. We could have the direct rule check to ensure none of its dependencies also contain the same class name it is emitting, to ensure it doesn't depend on an aspect for the same protobuf?
Thoughts @ittaiz @simuons @johnynek ?