Fixed
Status Update
Comments
as...@google.com <as...@google.com>
am...@gmail.com <am...@gmail.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit e7b4b06e67951ab47157d06ff314a5c8b2e8fdc6
Author: Andrei Shikov <ashikov@google.com>
Date: Mon Jan 08 15:54:51 2024
Count recursive local declarations as captures
Local declarations were already counted as captures for composable lambdas before, but the traversal ordering missed the recursive captures, converting some of them into singletons.
Test: Compiler test
Fixes: 318745941
Change-Id: I9097d1be71fb67b73e5027f723fd187c4272f6b4
M compose/compiler/compiler-hosted/integration-tests/src/androidUnitTest/kotlin/androidx/compose/compiler/plugins/kotlin/ComposeBytecodeCodegenTest.kt
M compose/compiler/compiler-hosted/integration-tests/src/jvmTest/kotlin/androidx/compose/compiler/plugins/kotlin/AbstractCodegenTest.kt
M compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposerLambdaMemoization.kt
https://android-review.googlesource.com/2900890
Branch: androidx-main
commit e7b4b06e67951ab47157d06ff314a5c8b2e8fdc6
Author: Andrei Shikov <ashikov@google.com>
Date: Mon Jan 08 15:54:51 2024
Count recursive local declarations as captures
Local declarations were already counted as captures for composable lambdas before, but the traversal ordering missed the recursive captures, converting some of them into singletons.
Test: Compiler test
Fixes: 318745941
Change-Id: I9097d1be71fb67b73e5027f723fd187c4272f6b4
M compose/compiler/compiler-hosted/integration-tests/src/androidUnitTest/kotlin/androidx/compose/compiler/plugins/kotlin/ComposeBytecodeCodegenTest.kt
M compose/compiler/compiler-hosted/integration-tests/src/jvmTest/kotlin/androidx/compose/compiler/plugins/kotlin/AbstractCodegenTest.kt
M compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposerLambdaMemoization.kt
as...@google.com <as...@google.com> #4
Comment has been deleted.
as...@google.com <as...@google.com> #5
We don't take this path by default in Compose compiler 1.5.6, so it shouldn't affect apps unless intrinsic remember is disabled.
Description
Jetpack Compose compiler version: 1.5.4 Android Studio Build: #AI-223.8836.35.2231.11090377, built on November 13, 2023 Kotlin version: 1.9.20
The change introduced by commit
22421ef1f3aab2bb317e164845bf1630606a099c
usescurrentFile.fileEntry.name
field to generate keys to be passed tostartReplaceableGroup
call. I discovered that this field contains the absolute file path, not just the part relative to the project root.In practice that results in binary different artifacts being produced for binary equivalent sources stored under different paths. E.g. builds under
/tmp/ci-build-42/
will always produce binary equal artifacts for a given source code revision, but these artifacts will be different from the ones produced from the same revision under/tmp/ci-build-43/
.Steps to Reproduce or Code Sample to Reproduce:
./gradlew clean build --no-daemon
, store./app/build/intermediates/compile_app_classes_jar/release/classes.jar
ReproducerComposableKt.class
will be the only file different between the resulting jars. By applyingjavap -c
and comparing the output for these classes, you'll see the only difference there is a value for a constant used instartReplaceableGroup
call.For your convenience I also provide projects for compiler versions 1.5.4 and 1.5.3 I used to verify my findings (see
reproducer.tgz
). Also, thefileName
value I extracted with a debugger from 1.5.4 project looks like this: