Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add path stripping to Java, spawn action keys
This fixes a small incremental build issue with `--experimental_output_paths`: Bazel uses action keys in its local action cache. Before running an action, it looks at: - the action's input paths and digests - the action's output paths and digests - the action key (which identifies the action's semantics) to determine if Bazel already ran that action with the same inputs and outputs already on the filesystem. Without this fix, toggling path stripping won't invalidate the action cache. That means if you have a build that works normally but fails with path stripping, you can incorrectly get success on both builds: ``` $ bazel clean $ bazel build //:MyJavaBinary --strategy Javac=worker,standalone <succeeds as a normal build> $ bazel build //:MyJavaBinary --strategy Javac=worker,standalone --experimental_output_paths=strip <should fail because path stripping doesn't yet support local execution. But still succeeds!> ``` In contrast: ``` $ bazel clean $ bazel build //:MyJavaBinary --strategy Javac=worker,standalone --experimental_output_paths=strip <fails as expected> ``` This second run fails as expected because the local action cache doesn't short-circuit the build. You can test this phenomenon further by building with `--nouse_action_cache`. For #6526. Closes #17208. Change-Id: Id146c6b9bd6b6be6953f2c8024839bca4c09a793 PiperOrigin-RevId: 503132362
- Loading branch information