Skip to content
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

use aspects for scrooge / thrift support for scala. #510

Closed
johnynek opened this issue May 30, 2018 · 1 comment · Fixed by #524
Closed

use aspects for scrooge / thrift support for scala. #510

johnynek opened this issue May 30, 2018 · 1 comment · Fixed by #524

Comments

@johnynek
Copy link
Member

we currently implement scrooge by adding a generic mechanism to see all dependencies in with a field called "extra_information" tacked onto the scala rules. By using that, we can see the full transitive dependencies of any target.

https://github.com/bazelbuild/rules_scala/blob/master/twitter_scrooge/twitter_scrooge.bzl#L76

We use this to make sure scrooge is called on a full covering of the thrift graph.

An alternative could be to use aspects to generate the scrooge:
https://docs.bazel.build/versions/master/skylark/aspects.html#advanced-example

in this picture, aspects help us generate 1 scrooge target for each thrift target. This way, we have a 1:1 mapping. This fixes the need to verify that we cover all the thrifts with a scrooge target, and potentially improves performance (but since scrooge parses so slowly, and we may need to parse many times now it could actually slow down performance).

It would be really nice for old code to continue to build, it may not be possible and may need a migration. In any case, using aspects seems like the right direction since this is what they were designed for.

@ittaiz
Copy link
Member

ittaiz commented May 30, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants