Status Update
Comments
xa...@google.com <xa...@google.com> #2
Using the same project, and running gw asDeb --configuration-cache
generates an HTML report (like e.g. file:///usr/local/google/home/gavra/AndroidStudioProjects/agp_r8_issue/build/reports/configuration-cache/71bxgz42iqmeflkzkeiz07rgj/exur7n03273b7z2r0b8e1z25h/configuration-cache-report.html
), which indicates that ShaderCompile
reads app/build/intermediates/merged_shaders/debug/out
at configuration time.
The issue is
@InputFiles
@IgnoreEmptyDirectories
@PathSensitive(PathSensitivity.RELATIVE)
@SkipWhenEmpty
public FileTree getSourceFiles() {
File sourceDirFile = getSourceDir().get().getAsFile();
FileTree src = null;
if (sourceDirFile.isDirectory()) {
src = getProject().files(sourceDirFile).getAsFileTree().matching(PATTERN_SET);
}
return src == null ? getProject().files().getAsFileTree() : src;
}
which should migrate to Provider.map {}
.
xa...@google.com <xa...@google.com> #3
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Giraffe Canary 1 (2022.3.1.1)
- Android Gradle Plugin 8.1.0
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
je...@google.com <je...@google.com> #6
...
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
...>
</application>
bi...@google.com <bi...@google.com>
bi...@google.com <bi...@google.com> #7
To make sure I analyze the "buildOnServer-7.5-rc-2-2022-07-01-shutdown.snapshot" correctly, I attached a screenshot of how I find the concerning point. From the picture, the MergeGeneratedProguardFilesCreationAction takes 1924ms. Is that the right way to check your snapshot file? If so, what is the expected time for that creation action in a config cached build?
au...@google.com <au...@google.com> #8
I think you missed adding an attachment.
bi...@google.com <bi...@google.com> #9
oops, here it is =)
au...@google.com <au...@google.com> #10
From discussions with xav@ that time should almost be non-existent during the run when the configuration cache kicks in.
bi...@google.com <bi...@google.com> #11
I checked out androidx-main, is that the right one? There is no gradlew file under that directory.
bingran@bingran-linux-west:~/androidx-main/tools$ ls
external fetch_artifact metalava repohooks
And have you ever tried building androidx with the dev version of AGP(the one built from studio-main)?
au...@google.com <au...@google.com> #12
I checked out androidx-main, is that the right one? There is no gradlew file under that directory.
Yes, aosp androidx-main is the repo. You'll want to use frameworks/support/gradlew
thats the main repo all the work is done.
And have you ever tried building androidx with the dev version of AGP(the one built from studio-main)?
Yes we have a script for that
namely you can set a number of variables to use the latest AGP (
- GRADLE_PLUGIN_VERSION
- LINT_VERSION
- GRADLE_PLUGIN_REPO
and then run frameworks/support/gradlew
bi...@google.com <bi...@google.com> #13
I believe this issue can be fixed by Jerome'CL ag/19955912. I got 4 snapshots running androidx to verify the fix.
- the first run without the fix
- the second run(config cached) without the fix
- the first run with the fix
- the second run(config cached) with the fix
From the snapshot of secondWithFix_xxx
, if we do a search for MergeGeneratedProguardFilesCreationAction
in the call tree, nothing would show up. However, if we do the same search for secondWithoutFix_xx
, 3612ms is spent inside MergeGeneratedProguardFilesCreationAction
.
The fix also reduce the time spent in non config cached run if we compare the same thing for firstWithoutFix_xxx
and firstWithFix_xxx
je...@google.com <je...@google.com> #14
Great bug Aurimas, very useful to get such bugs filed.
bi...@google.com <bi...@google.com> #15
Verified again for the latest patch of ag/19955912. The snapshot of the config cached run and the screenshot of the search result of the MergeGeneratedProguardFilesCreationAction
are attached. With the fix, the MergeGeneratedProguardFilesCreationAction
would only take a 8 ms which is close to zero.
Description
DESCRIBE THE ISSUE IN DETAIL:
MergeGeneratedProguardFilesCreationAction configuration is slow even running the second time when configuration caching is on.
STEPS TO REPRODUCE:
./gradlew bOS
./gradlew bOS
the second timeExpected
MergeGeneratedProguardFilesCreationAction is fast
Actual
MergeGeneratedProguardFilesCreationAction is not fast
Attaching yourkit trace