Skip to content

Commit

Permalink
Configure Bazel and Gradle to avoid spurious flakes.
Browse files Browse the repository at this point in the history
This CL updates the global `bazelrc` file to enable `--incompatible_sandbox_hermetic_tmp` to avoid tmp file collision issues between actions.

This CL also updates the `gradle.properties` to give more memory to avoid Java Heap OOM issues.

RELNOTES=N/A
PiperOrigin-RevId: 588547788
  • Loading branch information
bcorso authored and Dagger Team committed Dec 6, 2023
1 parent 75d3cbc commit eb9a034
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 5 deletions.
1 change: 1 addition & 0 deletions javatests/artifacts/dagger-android-ksp/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
android.useAndroidX=true
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx2048m
3 changes: 2 additions & 1 deletion javatests/artifacts/dagger-android/simple/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
android.useAndroidX=true
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx2048m
3 changes: 2 additions & 1 deletion javatests/artifacts/dagger-ksp/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx2048m
3 changes: 2 additions & 1 deletion javatests/artifacts/dagger/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx2048m
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
android.useAndroidX=true
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx2048m
1 change: 1 addition & 0 deletions javatests/artifacts/hilt-android/simple/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ org.gradle.unsafe.configuration-cache-problems=fail
org.gradle.unsafe.configuration-cache.max-problems=0
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx2048m
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ org.gradle.unsafe.configuration-cache-problems=fail
org.gradle.unsafe.configuration-cache.max-problems=0
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx2048m
3 changes: 2 additions & 1 deletion javatests/artifacts/hilt-android/viewmodel/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ android.enableJetifier=true
org.gradle.unsafe.configuration-cache-problems=fail
org.gradle.unsafe.configuration-cache.max-problems=0
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx2048m
11 changes: 11 additions & 0 deletions tools/bazel.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Global bazelrc file (see https://bazel.build/run/bazelrc#global-bazelrc)

# Note: This flag is required to prevent actions from clashing with each when
# reading/writing tmp files. Without this flag we get errors like:
#
# Error: Cannot use file /tmp/hsperfdata_runner/12 because it is locked by
# another process
#
# This flag will be enabled by default in Bazel 7.0.0, but for now we enable it
# manually. For more details: https://github.com/bazelbuild/bazel/issues/3236.
build --incompatible_sandbox_hermetic_tmp

0 comments on commit eb9a034

Please sign in to comment.