Add flag --incompatible_symlinked_sandbox_expands_tree_artifacts_in_runfiles_tree.
In the future, Bazel will expand tree artifacts in runfiles, too, which causes the sandbox to link each file individually into the sandbox directory, instead of symlinking
the entire directory.
In #5971 it was shown that this might have user-visible impact, so the flag provides a mechanism to try it out before Bazel turns it on by default and also to temporarily revert to the previous behavior during the migration window.
The flag will be removed once migration has been completed.
RELNOTES: In the future, Bazel will expand tree artifacts in runfiles, too, which causes the sandbox to link each file individually into the sandbox directory, instead of symlinking the entire directory. In this release, the behavior is not enabled by default yet. Please try it out via --incompatible_symlinked_sandbox_expands_tree_artifacts_in_runfiles_tree and let us know if it causes issues. If everything looks good, this behavior will become the default in a following release.
PiperOrigin-RevId: 211354053
diff --git a/src/main/java/com/google/devtools/build/lib/sandbox/SandboxHelpers.java b/src/main/java/com/google/devtools/build/lib/sandbox/SandboxHelpers.java
index ee6a959..289e230 100644
--- a/src/main/java/com/google/devtools/build/lib/sandbox/SandboxHelpers.java
+++ b/src/main/java/com/google/devtools/build/lib/sandbox/SandboxHelpers.java
@@ -48,9 +48,16 @@
* @throws IOException If any files could not be written.
*/
public static Map<PathFragment, Path> processInputFiles(
- Spawn spawn, SpawnExecutionContext context, Path execRoot) throws IOException {
+ Spawn spawn,
+ SpawnExecutionContext context,
+ Path execRoot,
+ boolean expandTreeArtifactsInRunfiles)
+ throws IOException {
return processInputFiles(
- context.getInputMapping(), spawn, context.getArtifactExpander(), execRoot);
+ context.getInputMapping(expandTreeArtifactsInRunfiles),
+ spawn,
+ context.getArtifactExpander(),
+ execRoot);
}
/**