-
Notifications
You must be signed in to change notification settings - Fork 4k
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 execution info instead of hard-coded mnemonics for Java path mapping #21093
Conversation
5831294
to
08333b5
Compare
By removing Java rules from the hard-coded mnemonics allowlist for path mapping, users can rely on `--modify_execution_info` to selectively disable path mapping for them just like for Starlark actions.
08333b5
to
c0a5049
Compare
@hvadehra Could you review this? While the aim is to remove tech debt related to the path mapping feature, the PR almost exclusively touches execution info logic for Java actions. CC @aranguyen |
@bazel-io fork 7.1.0 |
Just FYI, this is being imported in cl/606319644 cc: @bazelbuild/triage @Wyverald @meteorcloudy |
By removing Java rules from the hard-coded mnemonics allowlist for path mapping, users can rely on `--modify_execution_info` to selectively disable path mapping for them just like for Starlark actions. This requires fixing two minor inconsistencies in how execution info is populated for Java actions: * In `JavaCompilationHelper`, `buildKeepingLast` is used instead of `buildOrThrow` to prevent a crash when a target sets `supports-path-mapping` via `tags`. * In `JavaHeaderCompileAction`, `--experimental_inmemory_jdeps_files` no longer causes all other execution info to be lost. Fixes bazelbuild#21092 Closes bazelbuild#21093. PiperOrigin-RevId: 609064092 Change-Id: I6803e34a6861f19d185542e707b00029ee018a0a
…ath mapping (#21461) By removing Java rules from the hard-coded mnemonics allowlist for path mapping, users can rely on `--modify_execution_info` to selectively disable path mapping for them just like for Starlark actions. This requires fixing two minor inconsistencies in how execution info is populated for Java actions: * In `JavaCompilationHelper`, `buildKeepingLast` is used instead of `buildOrThrow` to prevent a crash when a target sets `supports-path-mapping` via `tags`. * In `JavaHeaderCompileAction`, `--experimental_inmemory_jdeps_files` no longer causes all other execution info to be lost. Fixes #21092 Closes #21093. Commit f8337c7 PiperOrigin-RevId: 609064092 Change-Id: I6803e34a6861f19d185542e707b00029ee018a0a Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
I just traced a memory regression to this change. It only shows up in builds that use
The magnitude of the regression is about 0.2% on our benchmark java-heavy build. Given that it's actually a fix, we won't roll this back. Instead, I'll keep in mind a couple idea:
|
Good find, I didn't think of that. I'm not aware of any other execution info entry with a unique value. As a quick win, we could just not inline infos containing this particular key in the Maybe a custom |
I have https://bazel-review.googlesource.com/c/bazel/+/242796 out for review, which reduces memory on the internal benchmark target by 1.0%. So it ends up even better than before your PR. There might be more savings to be had by using something other than a map, but it also might be negligible so long as interning is effective. |
@bazel-io fork 7.1.1 |
@iancha1992 Forking again for the fix in #21093 (comment). |
Memory improvement submitted as e8d844e. |
By removing Java rules from the hard-coded mnemonics allowlist for path mapping, users can rely on
--modify_execution_info
to selectively disable path mapping for them just like for Starlark actions.This requires fixing two minor inconsistencies in how execution info is populated for Java actions:
JavaCompilationHelper
,buildKeepingLast
is used instead ofbuildOrThrow
to prevent a crash when a target setssupports-path-mapping
viatags
.JavaHeaderCompileAction
,--experimental_inmemory_jdeps_files
no longer causes all other execution info to be lost.Fixes #21092