Status Update
Comments
ku...@gmail.com <ku...@gmail.com> #2
ku...@gmail.com <ku...@gmail.com> #3
Hey Clement, do you have any ideas on producing different dex files from build to build?
ku...@gmail.com <ku...@gmail.com> #4
The example shown above matches a non deterministic issue we had in L8 for classes ending with $-EL. This issue should be fixed on tip of tree. If you can reproduce on ToT let us know, I'll work on another fix. If the changes include something else than ordering inside the $-EL methods, let us know too, that would need to be fixed.
km...@google.com <km...@google.com> #5
How do I use this "tip of tree"?
ku...@gmail.com <ku...@gmail.com>
sm...@google.com <sm...@google.com>
pe...@google.com <pe...@google.com> #6
I'd also be interesting in seeing the fix. Could you link the relevant commit?
ku...@gmail.com <ku...@gmail.com> #7
I will try it out with tip of the tree.
pe...@google.com <pe...@google.com> #8
Before BumbleBee, you can try the latest version 3.1.16-dev by adding to your gradle script:
repositories {
maven {
url 'https://storage.googleapis.com/r8-releases/raw'
}
}
dependencies {
classpath 'com.android.tools:r8:3.1.16-dev' // Must be before the Gradle Plugin for Android.
classpath 'com.android.tools.build:gradle:X.Y.Z' // Your current AGP version.
}
Since BumbleBee, the syntax is
repositories {
google()
mavenCentral()
maven {url 'https://storage.googleapis.com/r8-releases/raw'}
}
dependencies {
classpath 'com.android.tools:r8:3.1.16-dev'
}
You can also try ToT directly but using the latest dev version that we release once a week is safest (ToT may be quite unstable sometimes)
ku...@gmail.com <ku...@gmail.com> #9
Thanks for sharing the instructions on how to testing with dev version of r8, Clement!
To reporter, could you try it out with dev version of r8 and see if you still see the difference? I didn't find where you enable core library desugaring in you sample project(debug_reproducible_builds branch) and you are using Android Gradle Plugin 4.2.2 instead of 7.0.
an...@google.com <an...@google.com>
gh...@google.com <gh...@google.com> #10
In order to eventually remove the unstable version of r8 again. What software release should we looking out for? build-tools? AGP?
gh...@google.com <gh...@google.com> #11
Looking at the diffoscope output from the APKs linked in the salsa issue by OP, that seems like a different issue than the "classes ending with $-EL"; I mostly see things like this there:
├── smali_classes4/de/rki/coronawarnapp/util/encoding/Base45Decoder.smali
│┄ Ordering differences only
│ @@ -50,17 +50,17 @@
│ "(Ljava/math/BigInteger;I)J",
│ "",
│ "encode",
│ "([B)Ljava/lang/String;",
│ "decode",
│ "(Ljava/lang/String;)[B",
│ "kotlin.jvm.PlatformType",
│ - "int45",
│ - "Ljava/math/BigInteger;",
│ "int256",
│ + "Ljava/math/BigInteger;",
│ + "int45",
│ "alphabet",
│ "Ljava/lang/String;",
│ "<init>",
│ "()V",
│ "Corona-Warn-App_deviceRelease"
│ }
│ k = 0x1
ku...@gmail.com <ku...@gmail.com> #12
@bingran unless you've found a reason why the issue would come from gradle, I now suspect that this issue comes from R8 and you can assign it to me. I will investigate tomorrow.
ku...@gmail.com <ku...@gmail.com> #13
Clement, I am going to re-assign it to you, if you need any additional info from AGP, I am more than happy to help. As Daniel mentioned(#10), upgrading r8 version fixes the problem, do you know which r8 version contains that fix? If so, we could let users know which AGP version they should upgrade to.
Re #10, you could try AGP 7.1 alpha08 which is latest one.(without using r8 dev version)
an...@google.com <an...@google.com> #14
Re #6 the fix for $-EL dispatch seems to be
an...@google.com <an...@google.com> #15
We tried with latest r8 version 3.1.16-dev and the problem persists.
I've pushed a branch for this test, it can be found here:
Also attaching 2 apks that were produced in runnign ./gradlew clean assembleDeviceRelease
twice on that branch. It's hard to really get a feeling for the differences here as they are soooo many. diffoscope produces somewhat readable output but takes ages and the output size is huge. maybe it still helps someone figuring out what's going on.
an...@google.com <an...@google.com> #16
Re #2: the issue with the ordering differences in "classes ending with $-EL" seems to go away when using classpath 'com.android.tools:r8:2.2.64'
.
Re #11: the issue with the ordering differences in compiled kotlin code seems to go away when setting minSdkVersion
to 24 (instead of 23 in this case); would be nice to know the cause, not just the fix (if that is indeed the fix).
Re #14: I seems to be 2.2.41 instead of 2.2.39.
NB: I use "seems", since it's easy to prove something is not deterministic and hard/impossible to prove something is deterministic; I've run 7 (#2) and 9 (#11) builds respectively, all identical, whereas before there would be a non-identical build within 3 builds (#2) and every build was different (#11).
NB: I've only tested the reproducibility of the builds, not whether the changes break anything (I do get some warnings during build when updating r8).
NB: both apps I tested use com.android.tools.build:gradle:4.1.3
.
an...@google.com <an...@google.com> #17
OK, I'm assuming the $-EL issues are gone on recent versions, we actually have an internal test for it, so I would be very surprised if tip of tree can reproduce.
It's unclear to me however if the kotlin code on API < 23 non determinism issue is present on tip of tree, so I will investigate that now from the apks provided in #15.
Description
####################################################
Please provide all of the following information, otherwise we may not be able to route your bug report.
####################################################
1. Describe the bug or issue that you're seeing.
After installing the update of windows 11, every time starting to edit files in Android Studio hangs the program, which can only be killed through task manager.
Android Studio started working normally after uninstalling said update.
2. Attach log files from Android Studio
2A. In the IDE, select the Help..Collect Logs and Diagnostic Data menu option.
2B. Create a diagnostic report and save it to your local computer.
2C. Attach the report to this bug using the Add attachments button.
3. If you know what they are, write the steps to reproduce:
3A.
3B.
3C.
In addition to logs, please attach a screenshot or recording that illustrates the problem.
For more information on how to get your bug routed quickly, see
Build: AI-223.8836.35.2231.10406996, 202306291237
AI-223.8836.35.2231.10406996, JRE 17.0.6+0-b2043.56-10027231x64 JetBrains s.r.o., OS Windows 11(amd64) v10.0 , screens 2560.0x1440.0, 1920.0x1080.0
AS: Giraffe | 2022.3.1
Kotlin plugin: 223-1.8.0-release-345-AS8836.35.2231.10406996
Android Gradle Plugin: 8.1.0
Gradle: 8.0
Gradle JDK: JetBrains Runtime version 17.0.6
NDK: from local.properties: (not specified), latest from SDK: (not found)
CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
```