build_java8_legacy_dex.sh does not set JAVA_RUNFILES for the d8/r8 launchers
Maintainers usually reply within 6 days
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- build-system
Research direction
Start by reading build_java8_legacy_dex.sh and comparing it with d8_desugar.sh, which already exports JAVA_RUNFILES="$0.runfiles". The fix is to add the same export before the d8, r8 and tracereferences launchers are invoked. To verify, build //tools/android:java8_legacy_dex with --spawn_strategy=local while JAVA_RUNFILES points at another runfiles tree; done means the launchers resolve jars from the script's own runfiles and the build succeeds.
Written by the indexing model from the issue text.
Description
build_java8_legacy_dex.sh runs the d8, r8 and tracereferences Java launchers, but it does not set JAVA_RUNFILES. d8_desugar.sh already does (export JAVA_RUNFILES="$0.runfiles").
A Bazel Java launcher uses JAVA_RUNFILES from the environment when it is set. When the java8_legacy_dex genrule runs unsandboxed, the variable can point at another target's runfiles tree, so the launchers look for their jars in the wrong place and the build fails.
How to reproduce: build //tools/android:java8_legacy_dex unsandboxed (--spawn_strategy=local) from an environment where JAVA_RUNFILES points to a different runfiles tree.
Fix: export JAVA_RUNFILES="$0.runfiles" in build_java8_legacy_dex.sh, the same as d8_desugar.sh. I will send a PR with a test that checks the launchers see the script's own runfiles.
Assisted by Claude.
- Dominant language
- Java
- Stars
- 205
- Forks
- 113
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bazelbuild/rules_android
-
`Desugar` actions don't run on multiplex workersPossibly taken @lukaciko claimed this 46 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bazelbuild/rules_android#539 · 2 comments ·
Maintainers usually reply within 6 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bazelbuild/rules_android#535 · 2 reactions ·
Maintainers usually reply within 6 days
-
desugar_globals output is not reproducible (zip entry order varies)Possibly taken @TrapsterDK claimed this 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
bazelbuild/rules_android#610 ·
Maintainers usually reply within 6 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
bazelbuild/rules_android#602 ·
Maintainers usually reply within 6 days
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
bazelbuild/rules_android#598 · 1 comment ·
Maintainers usually reply within 6 days
All issues in bazelbuild/rules_android
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Lincoln-cn/JAiRouter#1473 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
exercism/java-analyzer#379 ·
-
area: ui bug priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
tetsuji16/microProject#1893 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
liberation-data/fornax4j#325 ·
Maintainers usually reply within 1 day
-
[Bug]: FE and Kinesis extraction pipes render flow starting at the centre and scroll the source arm backwardsPossibly taken @chonkzillaofficial claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
BCCE-team/BuildCraft#85 ·