Status Update
Comments
cc...@google.com <cc...@google.com>
ja...@gmail.com <ja...@gmail.com> #2
Thanks for your detailed post.
However, benchmark build type is under configured: at least isProfileable is not set to true for existing build type, probably there's more.
We should set isProfileable = true
by default when overriding an existing benchmark build type.
This issue is not about some specific configuration flag, but the general approach of dealing with external configuration. As a developer adopting baseline profiles, it seems extremely risky to me using a custom configuration due to how it's applied under the hood and the fact it may break default configuration.
I agree that is not great but this is a little tricky to do. For custom baseline profile build types we override all the properties. For benchmark I left it open to configure but it's mostly about these 2 properties:
isMinifyEnabled
isShrinkResources
I don't have a way to see if the user is setting them before overriding, so for this reason, I'd prefer not to. I agree with you that some other properties could be set by default to make this easier, i.e.:
isJniDebuggable = false
isDebuggable = false
isProfileable = true
The reason why I mentioned the release signing config in the beginning is because I want to use debug signing config.
In the specific of your issue, i.e. using a debug certificate can you override the benchmark and baseline profile setting? You should be able to do something like:
android {
buildTypes {
release { ... }
debug { ... }
benchmarkRelease {
...
signingConfig signingConfigs.debug
}
nonMinifiedRelease {
...
signingConfig signingConfigs.debug
}
}
}
ja...@gmail.com <ja...@gmail.com> #3
Project: platform/frameworks/support
Branch: androidx-main
Author: Marcello Albano <
Link:
Added override for debuggable and profileable for benchmark builds in bpgp
Expand for full commit details
Added override for debuggable and profileable for benchmark builds in bpgp
Test: ./gradlew :benchmark:benchmark-baseline-profile-gradle-plugin:test
Bug: 369213505
Relnote: "isProfileable is always overridden in benchmark builds,
and isDebuggable is also now always overridden in both benchmark and
nonMinified (baseline profile capture) builds."
Change-Id: I487fa71083921682173f04fcbb477be5baf165f8
Files:
- M
benchmark/baseline-profile-gradle-plugin/src/main/kotlin/androidx/baselineprofile/gradle/apptarget/BaselineProfileAppTargetPlugin.kt
- M
benchmark/baseline-profile-gradle-plugin/src/test/kotlin/androidx/baselineprofile/gradle/apptarget/BaselineProfileAppTargetPluginTest.kt
Hash: 1906bbe52ba7ccb9ca0e1c1d6de33e7c91b5c6f0
Date: Fri Oct 11 10:07:06 2024
ma...@google.com <ma...@google.com> #4
I've landed a change that will set the following properties also when the benchmark build type already exists:
isJniDebuggable = false
isDebuggable = false
isProfileable = true
As well as the following for agp 8.0:
isDebuggable = false
I'm going ahead and closing this - if you've further questions please answer here and will reopen. Thanks.
ja...@gmail.com <ja...@gmail.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.benchmark:benchmark-baseline-profile-gradle-plugin:1.4.0-alpha04
ma...@google.com <ma...@google.com> #6
Since release signing config is used by default instead of debug
is not mentioned in release notes - maybe this is a bug?
Cause the last time I found it mentioned in the release notes was in version 1.1
signingConfig.debug is used as the default signing config (
) b/153583269
So, if the switch to the release one indeed happened - maybe it's an issue?
ch...@google.com <ch...@google.com> #8
AS does hide these variants, but the Android Gradle Plugin needs to be 8.6.0.alpha01
or higher. We use variant's experimental properties as a flag to hide these variants and 8.6.0.alpha01
is the AGP version our model recognizes those flags.
Could you try bumping the AGP version? The attached project uses 8.5.2.
ja...@gmail.com <ja...@gmail.com> #9
I've just tried AGP 8.6.0
and 8.7.0-beta01
with the sample project I attached and both still display the redundant variants in AS Koala Feature Drop | 2024.1.2 and AS Ladybug | 2024.2.1 Beta 1.
Also, the ./gradlew tasks --all
command for both mentioned AGP versions displays all the usual tasks for each of these variants. In turn, simple command like ./gradlew :app:assemble
will assemble even the redundant variants.
The 'variant's experimental properties' were mentioned. Are they applied automatically by BP plugin or should they be specified manually somewhere?
ma...@google.com <ma...@google.com> #10
For this bug we're looking at 2 things: -
- the additional build types that are created to generate baseline profiles and benchmark
- the build types that are visible in AS
There is a bug that should be fixed by aosp/3260794 about build types that should not be created. The AS part was to check that these wouldn't be visible. Will add this to version 1.3.1.
Thanks
ap...@google.com <ap...@google.com> #11
Branch: androidx-main
commit e75f0a518d11e27d4862ef903a9b29e64c0d6625
Author: Marcello Albano <maralb@google.com>
Date: Mon Sep 09 14:00:46 2024
Don't create nonMinified and benchmark build types if existing
Bug: 361370179
Test: ./gradlew :benchmark:benchmark-baseline-profile-gradle-plugin:test
Relnote: "Due to a bug even if nonMinified and
benchmark build types existed, they were going to
be recreated."
Change-Id: Ia8934fdf3ff51d993f4fef8195821d72315026e2
M benchmark/baseline-profile-gradle-plugin/src/main/kotlin/androidx/baselineprofile/gradle/apptarget/BaselineProfileAppTargetPlugin.kt
M benchmark/baseline-profile-gradle-plugin/src/test/kotlin/androidx/baselineprofile/gradle/apptarget/BaselineProfileAppTargetPluginTest.kt
M benchmark/baseline-profile-gradle-plugin/src/test/kotlin/androidx/baselineprofile/gradle/utils/TestUtils.kt
na...@google.com <na...@google.com> #13
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.benchmark:benchmark-baseline-profile-gradle-plugin:1.3.1
Description
Component used: Baseline Profile Gradle Plugin
Version used: 1.3.0
Devices/Android versions reproduced on: Android Studio Jellyfish/AGP 8.4.2 and Koala/AGP 8.5.2
I want to customize the generatedhttps://developer.android.com/topic/performance/baselineprofiles/configure-baselineprofiles#variant-specific-dependencies
benchmarkRelease
andnonMinifiedRelease
build variants, which are generated by the Baseline Profile Gradle Plugin. So I follow the documentation:If (as per the docs) I add
benchmarkRelease {}
andnonMinifiedRelease {}
blocks in Groovy script, I gain a bloated list of build variants. The list goes really wild havingnonMinifiedBenchmarkRelease
variant and some others. See attached screenshots. Same happens to Kotlin script, if I usecreate("benchmarkRelease") {}
, as equivalent to Groovy's code.Please fix the creating of the redundant build variants.
I have no sample project attached, as the issue is reproducible on a newly generated Android project with a freshly generated Baseline Profile Generator module. Also, the version of the latter should be bumped to 1.3.0, as the default one is 1.2.3 in AS Koala.