-
Notifications
You must be signed in to change notification settings - Fork 30
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
Bazel aspects: allow sharing source jars and allow empty sourcejars #757
Conversation
output_dir.append(dir) | ||
|
||
ctx.actions.run_shell( | ||
inputs = javac_action.inputs, | ||
outputs = [dir], | ||
mnemonic = "ExtractSourceJars", | ||
command = """ | ||
unzip {input_file} -d {output_dir} | ||
[ "$(unzip -q -l {input_file} | wc -l)" -eq 0 ] || unzip {input_file} -d {output_dir} |
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.
Inexplicably, unzip returns a 1 exit code if there are any warnings (see Diagnostics on https://linux.die.net/man/1/unzip) with no way to turn it off.
So we just literally count the number of files..
@JohnnyMorganz would you like to build this PR from source and try on your repos? |
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.
If it works, it works. As discussed yesterday :)
Ideally we'd wait with merging until getting positive feedback that it fixes the issue for the customer.
Thanks for checking in! Looking good from our side, but I am seeing one issue with test targets. You can repro this by changing the java_test(
name = "testing",
srcs = [
"Foo.java",
":generated-srcjar",
],
test_class = "Foo",
) Running the indexing gives the following error:
Sorry, unfortunately I do not know of any good public repo using srcjars to test with |
Thanks @JohnnyMorganz, I'll try to address in a separate PR. Will rely on your reproductions then :) |
Closes GRAPH-948
Closes GRAPH-949
Test plan