-
-
Notifications
You must be signed in to change notification settings - Fork 636
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
[internal] refactor scrooge codegen to allow for multiple languages #14030
Conversation
[ci skip-rust] [ci skip-build-wheels]
[ci skip-rust]
How will this interact with Apache Thrift for Java? Users must opt-in to whichever generators they want, so it's easy for them to choose between Apache Thrift vs. Scrooge. But does it ever make sense to generate both? I wonder if they use the same file name scheme, such that it would cause a merge conflict with |
The Scrooge Java code generator actually aims to replicate what the Apache Thrift Java generator does. Users should never activate them both at the same time. |
Cool. I wonder how we could reduce the risk users do this...Right now, you'll get a confusing engine error about Docs should probably mention the assumption. Maybe we introduce the concept of mutually exclusive backends? Our generic A quick-and-dirty solution would be for each backend to use (This discussion isn't blocking, but probably worth at least figuring out our direction.) |
"src/python/pants/backend/experimental/codegen/thrift/apache/java", | ||
"src/python/pants/backend/experimental/codegen/thrift/apache/python", | ||
"src/python/pants/backend/experimental/codegen/thrift/scrooge", | ||
"src/python/pants/backend/experimental/codegen/thrift/scrooge/scala", |
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.
I really like how you organize these backends :)
It's worth noting that the acid test for the engine experiment in 2015 was in fact supporting both at the same time in one codebase and being able to select which was desired per target. That test was driven by real Twitter use / needs at one point in time. It would be great to be able to support this sort of tortured codebase eventually, maybe. |
Good to know! It would be easy to support. Register a plugin field on |
Wrote up the discussion at #14041. |
And that eventually evolved into "variants", which became "multiple |
The Scrooge Thrift generator supports multiple languages. Refactor the Scrooge backend so it is structured in a similar manner to the Apache Thrift where each language is its own backend. This will open the way for introducing the Java and Android Scrooge backends.