Summary
rules_android@0.7.1 triggers large live Coursier resolution (no lock file), causing slow, fragile builds and frequent timeouts:
Error while fetching artifact with coursier: Timed out
Repro
Repo: https://github.com/bc-lee/rules-android-maven-live-resolution-repro
Run:
RJE_VERBOSE=true USE_BAZEL_VERSION=9.0.2 bazelisk build \
@rules_android//src/tools/java/com/google/devtools/build/android/r8:r8
(RJE_VERBOSE=true to expose Coursier behavior)
Root Cause
rules_android_maven defines a large maven.install(...) (50+ artifacts) but does not enable its lock file, forcing:
- large live
coursier fetch
- duplicate resolution (
rules_android_maven, bazel_worker_maven)
- heavy network traffic before actual build
Impact
- slow builds
- network-sensitive / flaky (timeouts)
- problematic in CI or restricted environments
Suggested Fix
Enable the existing lock file:
maven.install(
name = "rules_android_maven",
lock_file = "//:rules_android_maven_install.json",
...
)
Evidence
With only this change:
- # lock_file = "//:rules_android_maven_install.json",
+ lock_file = "//:rules_android_maven_install.json",
the same build succeeds reliably.
Workaround
Downstream patch:
+ lock_file = "//:rules_android_maven_install.json",
(Optionally resolver = "gradle")
Summary
rules_android@0.7.1triggers large live Coursier resolution (no lock file), causing slow, fragile builds and frequent timeouts:Repro
Repo: https://github.com/bc-lee/rules-android-maven-live-resolution-repro
Run:
(
RJE_VERBOSE=trueto expose Coursier behavior)Root Cause
rules_android_mavendefines a largemaven.install(...)(50+ artifacts) but does not enable its lock file, forcing:coursier fetchrules_android_maven,bazel_worker_maven)Impact
Suggested Fix
Enable the existing lock file:
Evidence
With only this change:
the same build succeeds reliably.
Workaround
Downstream patch:
+ lock_file = "//:rules_android_maven_install.json",(Optionally
resolver = "gradle")