Status Update
Comments
mi...@google.com <mi...@google.com> #2
when you say
depending on which system it runs on
what exactly do you mean? what are the two sources of this diff from?
just want to understand the exact issue alittle bit better.
ja...@gmail.com <ja...@gmail.com> #3
The task gathers locales by looking at the directories with the java function listFiles(). This isn't guaranteed to return the directories in a stable order. Typically on Unix systems the order is related to inode allocation, so that differs if you, e.g., check out the git repo twice. The standard solution to this is to just sort the files.
mi...@google.com <mi...@google.com>
di...@google.com <di...@google.com>
ja...@gmail.com <ja...@gmail.com> #4
Or maybe the right place to sort it is in writeSupportedLocales
, so that it still keeps the default locale first.
Instead of:
fun writeSupportedLocales(output: File, locales: Collection<String>, defaultLocale: String?) {
if (defaultLocale.isNullOrEmpty()) {
output.writeText(listOf(*(locales.toTypedArray())).joinToString("\n"))
} else {
output.writeText(
listOf(defaultLocale, *(locales.toTypedArray())).joinToString("\n")
)
}
}
, write:
fun writeSupportedLocales(output: File, locales: Collection<String>, defaultLocale: String?) {
if (defaultLocale.isNullOrEmpty()) {
output.writeText(listOf(*(locales.toTypedArray())).sorted().joinToString("\n"))
} else {
output.writeText(
listOf(defaultLocale, *(locales.toTypedArray()).sorted()).joinToString("\n")
)
}
}
mi...@google.com <mi...@google.com>
mi...@google.com <mi...@google.com>
ja...@gmail.com <ja...@gmail.com> #6
Thanks. Is that fix in Gerrit or in a git repo somewhere?
mi...@google.com <mi...@google.com> #7
It is in gerrit and should be available starting with the next canary version of AGP (8.2 Hedgehog canary 5)
ja...@gmail.com <ja...@gmail.com> #8
Will you backport to 8.1.0 too?
(Also, I don't see it in any branch on gitlies or gerrit. Have a link?)
mi...@google.com <mi...@google.com> #9
no it won't backport unfortunately, and the gerrit and gitlies link is not accessible externally.
ja...@gmail.com <ja...@gmail.com> #10
Ah, that's a shame. So reproducible builds are broken on AGP 8.1.0, I guess. That will prevent those builds from shipping in F-Droid. :-(
fl...@obfusk.net <fl...@obfusk.net> #11
This seems like a fairly trivial fix, so why not backport it to avoid people having to wait for 8.2 to get reproducible builds working again?
fl...@obfusk.net <fl...@obfusk.net> #12
It's not like changing the behaviour from non-deterministic to deterministic could possibly break anything.
hu...@google.com <hu...@google.com> #13
Re:
Is that fix in Gerrit or in a git repo somewhere?
You can find it here:
Re:
This seems like a fairly trivial fix, so why not backport it to avoid people having to wait for 8.2 to get reproducible builds working again?
@Mica...: Should we try to cherry-pick this change to AGP 8.1 given the previous comments + there are currently 7 users voting on this issue?
mi...@google.com <mi...@google.com> #14
Yes, we will cherry pick to 8.1.
ga...@gmail.com <ga...@gmail.com> #15
Did this fix make it into 8.1 for the release or will it be only in a later patch release like 8.1.1
mi...@google.com <mi...@google.com> #16
It will be in 8.1 release.
hu...@google.com <hu...@google.com> #17
(There's a slight chance that it will be in a 8.1.1 release instead of 8.1.0 -- the situation is similar to
re...@gmail.com <re...@gmail.com> #18
Amerika.....Ben
re...@gmail.com <re...@gmail.com> #19
Rene Mildner
Description
If I use generateLocaleConfig=true, the locale config resource file it generates has a different ordering depending on which system it runs on. This breaks reproducible builds, making it impossible for, e.g., F-Droid, to verify the build.
Here's a job that just failed:https://gitlab.com/fdroid/fdroiddata/-/jobs/4267150016
And here's the associated diff:
As you can see, the items are the same, but the ordering is different.
I would suggest callinghttps://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:sdk-common/src/main/java/com/android/ide/common/resources/LocaleConfigGenerator.kt;l=94;drc=655ea2cf3bd8337a8a2172446a4c4713040d7df0
.sort()
on localeSet inwriteLocaleConfig
:This should be a pretty trivial change to make, and hopefully it can make 8.1.0-beta03 or 8.1.0-rc1.