-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Only register .jdeps caching ActionContext when used
#21290
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
By registering `JavaCompileActionContext` (renamed to `JdepsCachingActionContext` in this change to better reflect its only purpose) only when using `--java_classpath=bazel`, the `insertDependencies` field of `JavaHeaderCompileAction` becomes obsolete. Combined with the existing 3 bytes of padding, this makes room for a new 4-byte field that will be used in a rollforward of fd196bf.
.jdeps cache ActionContext when used.jdeps caching ActionContext when used
|
Additional context is provided in #19872 (comment). |
| BuildRequest buildRequest) { | ||
| registryBuilder.register(JavaCompileActionContext.class, new JavaCompileActionContext()); | ||
| JavaOptions javaOptions = env.getOptions().getOptions(JavaOptions.class); | ||
| if (javaOptions != null |
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.
The Blaze analogue of this setup would also have to gate adding the context behind this condition.
|
@bazel-io fork 7.1.0 |
|
@hvadehra Btw, does Google use all three modes of |
|
|
Thanks for sharing more numbers, I agree that this particular change is less important in this case. I will look into the more pressing problem first. Could you link to the lines you referred to as |
I'd meant to do that but forgot, sorry about that: https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileAction.java#L373-L377 |
|
Thanks, now I fully understand your comment. This logic does make it difficult to replace the field, assuming it is needed at all. I will close this PR for now and think about how to prevent the large part of the regression. I will also look into submitting a PR to flip the default classpath mode for Bazel. |
By registering
JavaCompileActionContext(renamed toJdepsCachingActionContextin this change to better reflect its only purpose) only when using--java_classpath=bazel, theinsertDependenciesfield ofJavaHeaderCompileActionbecomes obsolete. Combined with the existing 3 bytes of padding, this makes room for a new 4-byte field that will be used in a rollforward of f5d76b1.Along the way, skip the unnecessary work of reading the
.jdepsinJavaHeaderCompilerAction#afterExecuteif neither using the.jdepscache nor path mapping.Work towards #21091