[9.3.0] Use no-op path mapper when output paths collide with inputs#30467
Open
Silic0nS0ldier wants to merge 1 commit into
bazelbuild:release-9.3.0bazelbuild/bazel:release-9.3.0from
Silic0nS0ldier:9.3.0_path-mapping-io-collision-fixSilic0nS0ldier/bazel:9.3.0_path-mapping-io-collision-fixCopy head branch name to clipboard
Open
[9.3.0] Use no-op path mapper when output paths collide with inputs#30467Silic0nS0ldier wants to merge 1 commit intobazelbuild:release-9.3.0bazelbuild/bazel:release-9.3.0from Silic0nS0ldier:9.3.0_path-mapping-io-collision-fixSilic0nS0ldier/bazel:9.3.0_path-mapping-io-collision-fixCopy head branch name to clipboard
Silic0nS0ldier wants to merge 1 commit into
bazelbuild:release-9.3.0bazelbuild/bazel:release-9.3.0from
Silic0nS0ldier:9.3.0_path-mapping-io-collision-fixSilic0nS0ldier/bazel:9.3.0_path-mapping-io-collision-fixCopy head branch name to clipboard
Conversation
### Description Prevents the path mapper (bazelbuild#6526, `--experimental_output_paths=strip`) from applying when a collision occurs between mapped input and output paths. ### Motivation Fixes a discovered edge case where a globally applied Java annotation processor had dependent `.jar` collide when building that same `.jar` under the default configuration, leading to a `AccessDeniedException`. e.g. ``` $ bazel cquery 'somepath(//product_platform/libs/protogen:protogen, config(//product_platform/libs/protogen:protogen, d373329))' ... //product_platform/libs/protogen:protogen (e3ee988) @bazel_tools//tools/jdk:java_plugins_flag_alias (e3ee988) //tools/error_prone/global_bug_patterns:global_bug_patterns (d373329) //tools/error_prone/global_bug_patterns/unproducible_value:unproducible_value (d373329) //product_platform/libs/protogen:protogen (d373329) $ bazel build //product_platform/libs/protogen:protogen ... ERROR: /___/product_platform/libs/protogen/BUILD.bazel:7:13: Building product_platform/libs/protogen/libprotogen.jar (18 source files) failed: (Exit 1): java failed: error executing Javac command (from java_library rule target //product_platform/libs/protogen:protogen) external/+java_repositories+openjdk21_linux_x86_64/bin/java '--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED' ... (remaining 20 arguments skipped) Remote server execution message: Execution result: ___ java.nio.file.AccessDeniedException: bazel-out/cfg/bin/product_platform/libs/protogen/libprotogen.jar at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:261) at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:482) at java.base/java.nio.file.Files.newOutputStream(Files.java:228) at com.google.devtools.build.buildjar.jarhelper.JarCreator.execute(JarCreator.java:279) at com.google.devtools.build.buildjar.SimpleJavaLibraryBuilder.buildJar(SimpleJavaLibraryBuilder.java:152) at com.google.devtools.build.buildjar.SimpleJavaLibraryBuilder.run(SimpleJavaLibraryBuilder.java:119) at com.google.devtools.build.buildjar.BazelJavaBuilder.build(BazelJavaBuilder.java:111) at com.google.devtools.build.buildjar.BazelJavaBuilder.parseAndBuild(BazelJavaBuilder.java:91) at com.google.devtools.build.buildjar.BazelJavaBuilder.lambda$main$0(BazelJavaBuilder.java:52) at com.google.devtools.build.lib.worker.WorkRequestHandler$WorkRequestCallback.apply(WorkRequestHandler.java:252) at com.google.devtools.build.lib.worker.WorkRequestHandler.respondToRequest(WorkRequestHandler.java:481) at com.google.devtools.build.lib.worker.WorkRequestHandler.lambda$startResponseThread$0(WorkRequestHandler.java:433) at java.base/java.lang.Thread.run(Thread.java:1583)Use --verbose_failures to see the command lines of failed build steps. ``` ### Build API Changes No ### Checklist - [x] I have added tests for the new use cases (if any). - [x] I have updated the documentation (if applicable). ### Release Notes RELNOTES: None Closes bazelbuild#30440.
Contributor
Author
|
CI errors look to be unrelated. Flakes or existing breakages. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Prevents the path mapper (#6526,
--experimental_output_paths=strip) from applying when a collision occurs between mapped input and output paths.Motivation
Fixes a discovered edge case where a globally applied Java annotation processor had dependent
.jarcollide when building that same.jarunder the default configuration, leading to aAccessDeniedException.e.g.
Build API Changes
No
Checklist
Release Notes
RELNOTES: None
Closes #30440.