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

Start breaking up the codegen backend. #4147

Merged
merged 1 commit into from Dec 27, 2016

Conversation

Projects
None yet
3 participants
@benjyw
Copy link
Contributor

benjyw commented Dec 21, 2016

This is the first in a series of commits that will break up the monolithic
codegen backend into fine-grained backends, so that repos can use
just what they need.

The general structure will be: pants.backend.codegen.<source idl>.<target lang>.
E.g., pants.backend.codegen.thrift.java.

This change includes no new code. It just creates two new backends *:
pants.backend.codegen.thrift.java, pants.backend.codegen.thrift.python
and moves the relevant code to them. It leaves forwarding stubs in the original
location, with deprecation messages.

The idea is that tasks that use the same code generator but output different
languages can share code in, say, pants.backend.codegen.<source idl>.lib,
so that, e.g., thrift generation for Java/Python/Go/etc. can share most of their
implementation.

Future changes will apply this organization to protobuf, antlr, etc. They will also
flesh out pants.backend.codegen.thrift.python so that we can get rid of
the ThriftBuilder in the python backend.

Reviewers: Note that while this commit touches many files, it contains basically
no new logic, and is just some file moves + BUILD dep repointing.

* Technically only the java one has a register.py and can be used as a backend.
The python one has no tasks yet...

@benjyw benjyw force-pushed the benjyw:split_codegen_part1 branch from 46eca19 to bddbcb1 Dec 21, 2016

@benjyw benjyw force-pushed the benjyw:split_codegen_part1 branch from bddbcb1 to 199243e Dec 21, 2016

@benjyw benjyw requested review from jsirois , stuhood , mateor and gmalmquist Dec 21, 2016

@benjyw

This comment has been minimized.

Copy link
Contributor

benjyw commented Dec 21, 2016

Reviewers: Feel free to review the idea itself (of splitting codegen into a bunch of smaller backends). Given that, the actual code change is pretty mechanical.

@benjyw

This comment has been minimized.

Copy link
Contributor

benjyw commented Dec 26, 2016

Reviewers? Anyone not away for the holidays? :)

@wisechengyi
Copy link
Contributor

wisechengyi left a comment

Thanks @benjyw. I like the idea, and it makes the structure more clear.

@mateor

mateor approved these changes Dec 27, 2016

@benjyw benjyw merged commit 38df8fd into pantsbuild:master Dec 27, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@benjyw benjyw deleted the benjyw:split_codegen_part1 branch Dec 27, 2016

JieGhost added a commit that referenced this pull request Jan 12, 2017

add various codegen packages to default backend packages (#4175)
### Problem

#4147 #4155 #4151 refactored codegen backend, and split it into multiple smaller packages.

We used to have codegen as one of the default backend packages, now we want to add these new packages to the default list instead.

### Solution

When registering "--backend-packages" option, add these new packages to the default list and remove codegen package from the list.

lenucksi added a commit to lenucksi/pants that referenced this pull request Apr 25, 2017

Start breaking up the codegen backend. (pantsbuild#4147)
This is the first in a series of commits that will break up the monolithic
codegen backend into fine-grained backends, so that repos can use
just what they need.

The general structure will be: pants.backend.codegen.<source idl>.<target lang>.
E.g., pants.backend.codegen.thrift.java.

This change includes no new code. It just creates two new backends:
pants.backend.codegen.thrift.java, pants.backend.codegen.thrift.python
and moves the relevant code to them. It leaves forwarding stubs in the original
location, with deprecation messages.

The idea is that tasks that use the same code generator but output different
languages can share code in, say, pants.backend.codegen.<source idl>.lib,
so that, e.g., thrift generation for Java/Python/Go/etc. can share most of their
implementation.

Future changes will apply this organization to protobuf, antlr, etc. They will also
flesh out pants.backend.codegen.thrift.python so that we can get rid of
the ThriftBuilder in the python backend.

lenucksi added a commit to lenucksi/pants that referenced this pull request Apr 25, 2017

add various codegen packages to default backend packages (pantsbuild#…
…4175)

### Problem

pantsbuild#4147 pantsbuild#4155 pantsbuild#4151 refactored codegen backend, and split it into multiple smaller packages.

We used to have codegen as one of the default backend packages, now we want to add these new packages to the default list instead.

### Solution

When registering "--backend-packages" option, add these new packages to the default list and remove codegen package from the list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment