build_java8_legacy_dex.sh does not set JAVA_RUNFILES for the d8/r8 launchers

未关闭 适合新手
#599 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 6 天内回复

@TrapsterDK 已经在做这个了。

开始于 2026年11月18日。

  • #600 来自 @TrapsterDK —— 未关闭

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
bash, java, shell
领域
build-system

调研方向

先阅读 build_java8_legacy_dex.sh,并将其与 d8_desugar.sh 进行比较,后者已经导出 JAVA_RUNFILES="$0.runfiles"。修复方法是在调用 d8、r8 和 tracereferences 启动器之前添加相同的导出。要验证,构建 //tools/android:java8_legacy_dex,使用 --spawn_strategy=local,同时 JAVA_RUNFILES 指向另一个 runfiles 树;完成意味着启动器从脚本自身的 runfiles 中解析 jar,并且构建成功。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Java
星标
205
派生
113
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

bazelbuild/rules_android 的其他 Issue

查看 bazelbuild/rules_android 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。