-
-
Notifications
You must be signed in to change notification settings - Fork 287
java_stub_template to use argument file instead of classpath jar #1410
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
java_stub_template to use argument file instead of classpath jar #1410
Conversation
liucijus
left a comment
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.
@ittaiz I think having an attribute as a toggle on the scala toolchain is the easiest way
…ves 1s-1.5s, works java>8)
6d5eaa9 to
c8046cb
Compare
|
@liucijus we're good to go. Build is green. WDYT? |
|
Btw, I think there's something flaky |
| ), | ||
| "use_argument_file_in_runner_for_improved_performance": attr.bool( | ||
| default = False, | ||
| doc = "Changes java binaries scripts (including tests) to use argument files and not classpath jars to improve performance, requires java > 8", |
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.
Did you mean JDK, with java > 8?
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 actually meant the JRE (e.g. the jvm).
Do you want me to change the phrasing? I can also write JDK though it's the JRE part of it that we care about. I don't remember if in the current state of affairs in bazel these concepts are bundled or not
@ittaiz I don't think you should test perf with such tests. The goal of such test should be to understand if everything wires up correctly and does correct build. I don't think we have any easy way to do perf regression here. So we have to trust that you've done your own measurements. |
liucijus
left a comment
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.
In general LGTM, please shorten the name of the attribute
scala/scala_toolchain.bzl
Outdated
| default = True, | ||
| doc = "Enable writing of statsfile", | ||
| ), | ||
| "use_argument_file_in_runner_for_improved_performance": attr.bool( |
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 shorter name is better: "use_argument_file_in_runner". Reasoning is already described in doc.
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.
👍🏽 will change
I think tests got broken with Bazel 6 changes in backwards incompatible way. |
|
Re perf and test- my point is that if you would keep the attribute on the toolchain but stop using it and also of course not pass it to the binary runner script the test still passes. |
I think grepping for the value is useful check |
I'll change the test and assert on that |
|
@liucijus done |
|
I think the macos build is stuck for some reason. Maybe buildkite related. Running for 20m. |
|
@liucijus if you have a way to maybe stop and start the build that would be great. |
|
pushed another commit since that build is stuck |
test/shell/test_scala_binary.sh
Outdated
| test_scala_binary_allows_opt_in_to_use_of_argument_file_in_runner_for_improved_performance() { | ||
|
|
||
| bazel run --extra_toolchains="//test/toolchains:use_argument_file_in_runner" //test/src/main/scala/scalarules/test/large_classpath:largeClasspath | ||
| grep "\"True\" == \"True\"" bazel-bin/test/src/main/scala/scalarules/test/large_classpath/largeClasspath |
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.
Hi @ittaiz, overall looks good to me. I just find this grep pattern non intuitive. Maybe template could render something like test_runner_classpath_mode="argsfile"|"manifest" do an if on that variable and then grep for test_runner_classpath_mode="argsfile" in test? wdyt?
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.
sure. I can do that. I also didn't like the grep. Vaidas wanted the use_argument_file thing and I went with it all the way. Will do the change.
To make sure we're aligned.
The new greps will be:
"argsfile" == "argsfile""manifest" == "argsfile"
Right?
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.
Correct. That would be clearer. Thanks.
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.
@simuons PTAL
|
./test_reproducibility.sh is running for 2h. Probably flaky. |
|
Thanks, @ittaiz! |
|
😊 sure thing. Thank you both for your review! |
|
Oh, I just realized I didn't update the docs :( |
Description
java_stub_template to use argument file instead of classpath jar
This shaves 1s-1.5s when classpath is long.
Requires java > 8 so to properly add it in we'll probably have a toggle or use the toolchain or something
bazelbuild/rules_java#331
Motivation
performance