fix: resolve baseline profile generation failures#2102
Open
vibhor-kulshrestha wants to merge 4 commits intoandroid:mainfrom
Open
fix: resolve baseline profile generation failures#2102vibhor-kulshrestha wants to merge 4 commits intoandroid:mainfrom
vibhor-kulshrestha wants to merge 4 commits intoandroid:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request modifies the Gradle build configuration to establish a dependency between the app's APK listing task and the benchmark packaging tasks, while also setting the default benchmark rules to BaselineProfile. The review identifies an inefficiency in the task configuration logic that could impact build performance and highlights a potential issue where the global benchmark rule setting might restrict other benchmarks in the module.
3 tasks
… scope enabledRules to nonMinifiedRelease build type
…ks variant resolution
|
Looks solid to me. |
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 #1965
Problem
Two build errors occur when running
generateProdReleaseBaselineProfile:Error 1 — Instrumentation runner not found:
benchmarks/build.gradle.ktswas missingtestInstrumentationRunnerArgumentswithenabledRules=BaselineProfile. Without this, the managed device test runner executed macrobenchmarks alongside baseline profile generators, putting the app in an incorrect state and causing all profile generators to fail with NullPointerException and AssertionError.Error 2 — Gradle 9 implicit task dependency:
Gradle 9 strict validation detected that
:app:createProdNonMinifiedReleaseApkListingFileRedirectconsumed output from:benchmarks:packageProdNonMinifiedReleasewithout declaring an explicit dependency, causing non-deterministic build failures.Fix
testInstrumentationRunnerArguments["androidx.benchmark.enabledRules"] = "BaselineProfile"tobenchmarks/build.gradle.ktsdependsOntask ordering inapp/build.gradle.ktsto satisfy Gradle 9 strict validationTesting
--dry-runAndroidJUnitRunnerwith self-instrumentingtargetPackagebundleProdReleasesucceeds with zero implicit dependency warningsbaseline.prof(10KB) andbaseline.profmconfirmed embedded in AABBookmarksBaselineProfilenow passes (was failing before fix)testDemoDebugunaffected