-
Notifications
You must be signed in to change notification settings - Fork 68
Check R8 usage before grabbing proguard outputs from ctx.outputs
#344
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
Check R8 usage before grabbing proguard outputs from ctx.outputs
#344
Conversation
|
Thanks for the fix, but I wonder why this is not getting caught by this test? rules_android/test/rules/android_binary/r8_integration/BUILD Lines 5 to 15 in 75a50ae
which depends on (builds) an android app with R8 and proguard_specs set: rules_android/test/rules/android_binary/r8_integration/java/com/basicapp/BUILD Lines 25 to 37 in 75a50ae
|
|
@ahumesky that is indeed a very good question. I don't have a good answer for you at the moment, as I didn't see that test when I was working on this. I do know that I was able to reproduce that issue consistently with the example app, so it wasn't just limited to our environment. I haven't looked at this logic in a while, and I won't be able to look at it for the next week or so at least, but after that I should be able to take a look and at least see what I find with this test. |
|
@ahumesky I believe I have this figured out, and it results from using selects. Let's start with the following: Here, we look for the ACL (which is true), but also for I'm not entirely sure what the best path forward here is. One of:
|
|
For option 1, I'd want to have an integration test (see //test/rules/android_binary[...]) before we merge this. For option 2, we need the R8 ACL for the forseeable future because we have internal desugar/dex/minification flows that don't use R8 and have a separate proguarding step. For option 3, I'm not 100% sure either, but I think this is related to some of the special glue logic we have in the android_binary wrapper. Remember that when you load android_binary(), you're actually loading the macro wrapper around the rule itself, and there's some extra massaging that happens in the linked file. That massaging happens to ocur on |
d067f7e to
57d28b9
Compare
Fixes bazelbuild#343 stacked-branch: fix-proguard-outputs
57d28b9 to
cdbd9ff
Compare
|
@ted-xie @ahumesky I added a test here that passes in the current branch. If you revert the change to rules/android_binary/impl.bzl, it fails: Then if you apply the change to that file, it succeeds: |
|
I merged this with some small edits for clarity. |
Fixes #343