Rules use entire Android SDK dir as input instead of explicit files which may case poor cache hit

未关闭
#247 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 6 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
android
领域
build-system

调研方向

首先,使用额外的 androidsdk/build-tools/34.0.0/lib/dx.jar 重现报告中的输入列表,然后追踪是哪条 Android SDK 规则创建了 aapt2_binary.runfiles 的输入。当只有必需的 SDK 文件作为输入,并且一个无关的额外文件不再导致本地重建或缓存未命中时,工作就完成了。

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

描述

This is not super common but we've noticed that if someone has extra files in their androidsdk/build-tools/34.0.0/lib/* they will be used an input files to an action which will cause a cache miss and therefore a local rebuild.

Example of unwanted input because a rogue dx.jar file was present :

     "path": "bazel-out/arm64-v8a-fastbuild-android-ST-5084ec102eb5/bin/external/androidsdk/aapt2_binary.runfiles/__main__/external/androidsdk/build-tools/34.0.0/lib/dx.jar",
      "digest": {
        "hash": "5f37023cdab507f4f2ece1c80dabd056254e30cc9f4aef39dd84c4e0a0031615",
        "sizeBytes": "1038021",
        "hashFunctionName": "SHA-256"
      },
      "isTool": false,
      "symlinkTargetPath": ""
    }, {

and

      "path": "bazel-out/arm64-v8a-fastbuild-android-ST-5084ec102eb5/bin/external/androidsdk/aapt2_binary.runfiles/androidsdk/build-tools/34.0.0/lib/dx.jar",
      "digest": {
        "hash": "5f37023cdab507f4f2ece1c80dabd056254e30cc9f4aef39dd84c4e0a0031615",
        "sizeBytes": "1038021",
        "hashFunctionName": "SHA-256"
      },
      "isTool": false,
      "symlinkTargetPath": ""
    }, {
主要语言
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 摘要。