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

Do not override / crash if baseline.prof already exists in assets/dexopt #317

Open
benjaminRomano opened this issue Feb 17, 2023 · 1 comment

Comments

@benjaminRomano
Copy link

benjaminRomano commented Feb 17, 2023

Describe the bug
There was a time where AGP + Bundletool did not work correctly when appending baseline profile data into an App Bundle.

Bundletool did not yet support the legacy bundle metadata assets.dexopt which AGP was using. We worked around this by manually inserting our baseline.prof file into the assets/dexopt directory ourselves. Circumventing the non-existent bundletool logic and broken logic in AGP (ref: https://partnerissuetracker.corp.google.com/issues/230361284).

This has been fixed now in newer versions of Bundletool; however, we were still using our same logic to directly insert baseline profiles into assets/dexopt/baseline.prof. This eventually broke when we upgraded to AGP 7.2 which will automatically generate baseline profile into the new com.android.tools.build.profiles metadata path.

Effectively, this default baseline profile metadata has been overriding our actual baseline profiles.

Ask

In BinaryArtProfilesInjector, there should be a check to see if a assets/dexopt/baseline.prof file already exists and either skip or fail as a correctness issue.

In the meantime, we will be fixing our logic to insert the baseline profile into the correct spot.

Bundletool version(s) affected
Version: 14.0.0

@ymakhno
Copy link
Collaborator

ymakhno commented Aug 9, 2023

We will add validation to ensure assets/dexopt/baseline.prof is not placed in its APK location in one of next bundletool releases.

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