Skip to content

Commit

Permalink
Enable --incompatible_sandbox_hermetic_tmp by default
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Oct 25, 2023
1 parent 877f845 commit 92ec681
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ public ImmutableSet<Path> getInaccessiblePaths(FileSystem fs) {

@Option(
name = "incompatible_sandbox_hermetic_tmp",
defaultValue = "false",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.EXECUTION_STRATEGY,
effectTags = {OptionEffectTag.EXECUTION},
help =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ public void testEditDuringBuild() throws Exception {
Path in = write("edit/in", "line1");
in.setLastModifiedTime(123456789);

// Make in writable from sandbox (in case sandbox strategy is used).
String absoluteInPath = in.getPathString();
addOptions("--sandbox_writable_path=" + absoluteInPath);
// Modify the actual source file, not a sandboxed copy.
addOptions("--spawn_strategy=local");

// The "echo" effects editing of the source file during the build:
write("edit/BUILD",
Expand Down
2 changes: 2 additions & 0 deletions src/test/shell/integration/sandboxing_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ EOF

touch "${temp_dir}/file"
bazel test //pkg:tmp_test \
--sandbox_add_mount_pair=/tmp \
--test_output=errors &>$TEST_log || fail "Expected test to pass"
}

Expand Down Expand Up @@ -812,6 +813,7 @@ EOF
chmod +x pkg/tmp_test.sh

bazel test //pkg:tmp_test \
--sandbox_add_mount_pair=/tmp \
--test_output=errors &>$TEST_log || fail "Expected test to pass"
[[ -f "${temp_dir}/file" ]] || fail "Expected ${temp_dir}/file to exist"
}
Expand Down

0 comments on commit 92ec681

Please sign in to comment.