Repository navigation
Export the baseline profile an AAR ships from aar_import - #577
Open
MarcusChen-Canva wants to merge 1 commit into
Open
MarcusChen-Canva wants to merge 1 commit into
MarcusChen-Canva wants to merge 1 commit into
Conversation
AARs built by the Android Gradle Plugin carry their baseline profile as baseline-prof.txt at the archive root (androidx activity, fragment, lifecycle, Compose and others do). The Gradle plugin merges every library's profile into the app's ART profile; aar_import extracted nothing, so an android_binary built from the same AARs shipped without those rules and only android_library's own baseline_profiles attribute reached BaselineProfileProvider. Extract the file with the existing single-file extractor, falling back to an empty file for AARs without one, and export it through BaselineProfileProvider merged with the deps' and exports' profiles, the same shape android_library uses. Fixes bazelbuild#461 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #461.
AARs built by the Android Gradle Plugin carry their baseline profile as
baseline-prof.txtat the archive root; androidxactivity,fragment,lifecycle-*,startup-runtime, the Compose artifacts andokhttp-androidall ship one. The Gradle plugin merges every library's profile into the app's ART profile.aar_importextracted nothing, so anandroid_binarybuilt from the same AARs shipped without those rules; onlyandroid_library's ownbaseline_profilesattribute reachedBaselineProfileProvider.This extracts the file with the existing
extract_single_filehelper (create_empty_file = True, so an AAR without a profile contributes an empty file) and exports it throughBaselineProfileProvider, merged with the deps' and exports' profiles, the same shapeandroid_libraryuses inrules/android_library/impl.bzl.Verified in our monorepo on rules_android 0.7.3 (the same change rebased onto
mainhere): theMergeBaselineProfilesaction of ourandroid_binarynow receives the profiles of every AAR in its closure (25 of them carry rules) and produces a 3376-rule merged profile; before, nothing from an AAR reached it.No test is added:
test/ruleshas noaar_importcoverage today, and theandroid_binaryprofile tests referenced fromrules/aclsare not in this repository. Happy to add one if you can point me at where anaar_importtest with a checked-in AAR should live.