Commit 3b9cc81 1 parent 877f845 commit 3b9cc81 Copy full SHA for 3b9cc81
File tree 4 files changed +8
-5
lines changed
main/java/com/google/devtools/build/lib/sandbox
java/com/google/devtools/build/lib/buildtool
4 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -350,12 +350,12 @@ public ImmutableSet<Path> getInaccessiblePaths(FileSystem fs) {
350
350
351
351
@ Option (
352
352
name = "incompatible_sandbox_hermetic_tmp" ,
353
- defaultValue = "false " ,
353
+ defaultValue = "true " ,
354
354
documentationCategory = OptionDocumentationCategory .EXECUTION_STRATEGY ,
355
355
effectTags = {OptionEffectTag .EXECUTION },
356
356
help =
357
357
"If set to true, each Linux sandbox will have its own dedicated empty directory mounted"
358
- + " as /tmp rather thansharing /tmp with the host filesystem. Use"
358
+ + " as /tmp rather than sharing /tmp with the host filesystem. Use"
359
359
+ " --sandbox_add_mount_pair=/tmp to keep seeing the host's /tmp in all sandboxes." )
360
360
public boolean sandboxHermeticTmp ;
361
361
Original file line number Diff line number Diff line change @@ -44,9 +44,8 @@ public void testEditDuringBuild() throws Exception {
44
44
Path in = write ("edit/in" , "line1" );
45
45
in .setLastModifiedTime (123456789 );
46
46
47
- // Make in writable from sandbox (in case sandbox strategy is used).
48
- String absoluteInPath = in .getPathString ();
49
- addOptions ("--sandbox_writable_path=" + absoluteInPath );
47
+ // Modify the actual source file, not a sandboxed copy.
48
+ addOptions ("--spawn_strategy=local" );
50
49
51
50
// The "echo" effects editing of the source file during the build:
52
51
write ("edit/BUILD" ,
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ source ${CURRENT_DIR}/remote_helpers.sh \
36
36
function set_up() {
37
37
add_to_bazelrc " build --spawn_strategy=sandboxed"
38
38
add_to_bazelrc " build --genrule_strategy=sandboxed"
39
+ # Allow the network socket to be seen in the sandbox.
40
+ add_to_bazelrc " build --sandbox_add_mount_pair=/tmp"
39
41
40
42
sed -i.bak ' /sandbox_tmpfs_path/d' $TEST_TMPDIR /bazelrc
41
43
}
Original file line number Diff line number Diff line change 735
735
736
736
touch " ${temp_dir} /file"
737
737
bazel test //pkg:tmp_test \
738
+ --sandbox_add_mount_pair=/tmp \
738
739
--test_output=errors & > $TEST_log || fail " Expected test to pass"
739
740
}
740
741
812
813
chmod +x pkg/tmp_test.sh
813
814
814
815
bazel test //pkg:tmp_test \
816
+ --sandbox_add_mount_pair=/tmp \
815
817
--test_output=errors & > $TEST_log || fail " Expected test to pass"
816
818
[[ -f " ${temp_dir} /file" ]] || fail " Expected ${temp_dir} /file to exist"
817
819
}
You can’t perform that action at this time.
0 commit comments