-
Notifications
You must be signed in to change notification settings - Fork 58
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
Update ScalaPB to 0.10.6 and switch to sandboxed classloader. #202
Conversation
Thanks. I don't do protobuf anymore. I'd like to know what @ahjohannessen thinks, but this seems reasonable to me on the surface. |
This change uses a new functionality of protocbridge which enables code generators to be loaded via a sandboxed classloader. This eliminates the possibility of binary compatibility problems with SBT, protobuf-java or ScalaPB itself. This would also enable moving forward to protobuf-java 3.12.x as it is incompatible with the version of protobuf-java presently shipped with SBT.
@thesamet Looks good to me, but somehow I get this when
However, if I add |
@ahjohannessen It looks like this problem happens in a multi-project setup. The resolver I added here doesn't take effect. I think that a better direction than touching the project's resolvers, would be to split the code generator from the sbt-plugin into a separate library. This way default resolution would work. I'll update this PR. |
Latest commit restructures the project to have the code generator as a separate plugin. This set up also paves the path to using the code generator outside SBT (can be compiled to native, used with maven, etc) |
@thesamet I'll try it out |
@thesamet Now it works :) Great stuff 👍 |
@rossabaker LGTM - would be great to get a 0.7.3 version published when this is merged :) |
Does this change anything for consumers in a way that would justify a bump to 0.8.0? |
I don't think a bump to 0.8.0 is needed as end users should be unaffected, and the Java runtime is the same (so it's binary compatible with earlier versions). However, the SBT plugin (sbt-java-gen) is not binary compatible with earlier versions since I moved things to a new artifact. The only scenario where something might break is if there is some another SBT plugin that depends on sbt-java-gen (which I believe is unlikely) |
Awesome :) Thanks a lot @thesamet |
Released as 0.7.3. |
This change uses a new functionality of protocbridge which enables code generators
to be loaded via a sandboxed classloader. This eliminates the possibility of binary
compatibility problems with SBT, protobuf-java or ScalaPB itself. This
would also enable moving forward to protobuf-java 3.12.x as it is
incompatible with the version of protobuf-java presently shipped with
SBT.