Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nkoroste opened this issue Jul 10, 2024 · 1 comment

Comments

@nkoroste
Copy link
Contributor

nkoroste commented Jul 10, 2024

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": ""
    }, {
@ahumesky
Copy link
Collaborator

This is from the glob here:

"build-tools/%s/lib/**" % build_tools_directory,

This is all very imprecise:
https://github.com/bazelbuild/rules_android/blob/main/rules/android_sdk_repository/helper.bzl#L279-L315
I don't think any of those tools (aapt2 etc) need anything in lib because lib just had d8.jar and apksigner.jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants