-
-
Notifications
You must be signed in to change notification settings - Fork 286
Aspect-based scrooge implementation #524
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
Conversation
ptal @ianoc @ittaiz @andyscott I will try a build of some internal stripe repos with this tomorrow. It does change the semantics slightly, but it makes them more bazel-y I would argue. Also, I think all the current uses at Stripe will either work directly, or will error (but most will work). |
note this is almost a net 0 change in lines: it enables us to remove extra_information and once we get #534 green, we can convert to totally modern providers, which will be nice to finally get there. |
I read through and it looks good. What's the subtle semantic change? It's not apparent from a read through the diff. |
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 went over the non thrift.bzl and twitter_scrooge.bzl part (which is the small part) and it looks good. I'm sorry for not reviewing the whole of it but I'll defer to @ianoc since I'm pretty sure it will be much easier for him with the context. If you need me then I'll make the bandwitdh to thoroughly review
btw, the failures seem to be related to the fact that you're using syntax/constructs from 0.14 while we're running in travis with 0.13 (which explains why buildkite is green) |
visibility = ["//visibility:public"], | ||
) | ||
|
||
java_import( | ||
name = "barejar_java_import", | ||
jars = ["bare-thrift.jar"], | ||
jars = ["bare_jar_thrifts_scrooge.jar"], |
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.
what is thrifts_scrooge
?
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.
it is the compiled scrooge code.
thrift/thrift.bzl
Outdated
@@ -160,6 +165,9 @@ thrift_library = rule( | |||
"absolute_prefix": attr.string(default = '', mandatory = False), | |||
"absolute_prefixes": attr.string_list(), | |||
# This is a list of JARs which only contain Thrift files | |||
# these files will NOT be compiled as part of the current target, | |||
# but the current thrifts do include these. It should also include |
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.
These are external_thrift_jar's right? there isn't a requirement that both the compiled + thrift are in the one jar i think? (you can think of the scenario the thrift is only in a jar with the thrift classifier for instance)
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.
so, I kept it segregated, but now we compile the jars. This allows you to do import style of remote items by using a target with only an external_jar. mixing them with the srcs ultimately seemed confusing to me since I don't think we want to rezip them into the output or apply the prefix rules to them. What do you think about this?
It has the side effect, I think, of making current uses just work, although slower if they include a giant jar over and over.
tools/bazel.rc
Outdated
@@ -1,2 +1,2 @@ | |||
build --experimental_local_disk_cache | |||
build --experimental_local_disk_cache_path=.bazel_cache | |||
#build --experimental_local_disk_cache |
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.
Shouldn't be committed? though after rebase should be gone
twitter_scrooge/twitter_scrooge.bzl
Outdated
paths = path_content, | ||
flags = worker_arg_pad + ':'.join([ | ||
'--with-finagle' if ctx.attr.with_finagle else '', | ||
# '--with-finagle' if ctx.attr.with_finagle else '', |
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.
commented code?
resource_jars = [], | ||
labels = {}, | ||
in_scalacopts = [], | ||
print_compile_time = False, |
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.
not for this PR, but with stats files and other things, we should probably just remove this maybe to clean up/fewer options soon
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 agree. cc @andyscott do we have a ticket to remove this and make sure we can get the data from BEP logs?
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.
Is this used for the stats file target? I believe originally this was just a println I added
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 think this is your println. The statsfile is always emitted I believe.
small questions and such, otherwise i think lgtm when green. Might be worth firing it through an internal build once you get it green? |
with minor expected changes, this builds our giant thrift repo. |
I am mostly building our largest scala repo, which has more complex usage of thrift is somewhat painful, but manageable (maybe 2 hours of modification). The problem was:
|
lgtm |
this fixes #510
It works, but there are a few issues currently:
.
Public aspect attributes are of type string and are called parameters. Parameters must have avalues attribute specified on them. In this case we have a parameter called extension that is allowed to have '*', 'h', or 'cc' as a value.
. I side stepped this by always enabling, but we can revisit by adding a flag on the thrift_library to enable or not if this becomes an issue.I'd appreciate feedback at this point to raise any warning signs.
cc @ittaiz @ianoc