-
-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
F-Droid reproduceable build failed #1639
Comments
Seems like it could be due to APK Signature that's causing a mismatch? F-Drod is more for mobile then ATV but in saying that, it's best to have an app be more accessible. |
Issue might be fixed in the v0.13.4 release. |
Still not verified. |
There are two different files.
|
Still an issue :( https://gitlab.com/fdroid/fdroiddata/-/jobs/2806346970#L636 Disabled autoupdate for now: https://gitlab.com/fdroid/fdroiddata/-/commit/34bd6224241835aa3e761e02c1db0f00c3aca955 |
Thanks for linking the job, I think I know why it fails now. The AboutLibraries plugin we use generates a JSON file with all licenses and adds a timestamp from when it generated the file. That timestamp obviously differs between our build and F-Droid's build. Will see what I can do to fix. |
Issue should be fixed in the next release (0.14.1) |
Still is failing locally: 2 files differ, can you dissect the APK? (remove |
With tasks.whenTaskAdded {
if(name.contains("ArtProfile")) {
enabled = false
}
} we can disable the prefile. Not sure if it affects the performance. |
I'm quite sure that disabling ART will give us a performance penalty, so we shouldn't disable it. If that's the problem in creating a reproducible build I think our only choice is to not use reproducible builds for now. |
It doesn't disable the Android Runtime (ART), just baseline profiles. According to the docs:
So it may very well indeed result in a performance penalty, but I have found no real-world data on whether 30% is accurate or not. And all the docs say that developers need to define these profiles, but I don't see e.g. a |
Could you please test the apk build without the profile? |
Every time it produces a different apk so the profile part is not reproducible at all. |
@licaon-kter got the 0.14.3 version build reproduciblly by limiting it to use only 1 core. @nielsvanvelzen Do you use more cores for newer versions? Could you please build the latest version with 1 core? |
All releases are build with GitHub actions. According to the documentation these are the specs:
I believe they used two cores from the start. Our 0.14 releases also used this release pipeline. |
@obfusk's https://github.com/obfusk/reproducible-apk-tools#sort-baselinepy can fix the profm problem. You also need to run the script before sign the apk. |
You can also sort the import com.android.tools.profgen.ArtProfileKt
import com.android.tools.profgen.ArtProfileSerializer
import com.android.tools.profgen.DexFile
project.afterEvaluate {
tasks.compileReleaseArtProfile.doLast {
outputs.files.each { file ->
if (file.toString().endsWith(".profm")) {
println("Sorting ${file} ...")
def version = ArtProfileSerializer.valueOf("METADATA_0_0_2")
def profile = ArtProfileKt.ArtProfile(file)
def keys = new ArrayList(profile.profileData.keySet())
def sortedData = new LinkedHashMap()
Collections.sort keys, new DexFile.Companion()
keys.each { key -> sortedData[key] = profile.profileData[key] }
new FileOutputStream(file).with {
write(version.magicBytes$profgen)
write(version.versionBytes$profgen)
version.write$profgen(it, sortedData, "")
}
}
}
}
} |
Our Gradle build files use Kotlin and it looks like the compiler is slightly more strict. We can't use the properties/functions on ArtProfileSerializer because their visibility is internal. |
I was afraid it would not work with You might be able to put it in a separate |
A quick test suggest it will fail to find the required imports via FWIW, using the python script to sort instead of |
You can also wait for a new AGP version with the fix, but that might take a while. |
You can put this in buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
// NB: use this with gradle/libs.versions.toml (and modify as needed):
classpath "com.android.tools.build:gradle:${libs.versions.android.gradle.get()}"
}
}
import com.android.tools.profgen.ArtProfileKt
import com.android.tools.profgen.ArtProfileSerializer
import com.android.tools.profgen.DexFile
project.afterEvaluate {
tasks.compileReleaseArtProfile.doLast {
outputs.files.each { file ->
if (file.toString().endsWith(".profm")) {
println("Sorting ${file} ...")
def version = ArtProfileSerializer.valueOf("METADATA_0_0_2")
def profile = ArtProfileKt.ArtProfile(file)
def keys = new ArrayList(profile.profileData.keySet())
def sortedData = new LinkedHashMap()
Collections.sort keys, new DexFile.Companion()
keys.each { key -> sortedData[key] = profile.profileData[key] }
new FileOutputStream(file).with {
write(version.magicBytes$profgen)
write(version.versionBytes$profgen)
version.write$profgen(it, sortedData, "")
}
}
}
}
} And add this to apply(from = "fix-profm.gradle") And it should work. |
You can open an MR or ping me when it's ready. |
@linsui https://github.com/jellyfin/jellyfin-androidtv/releases/tag/v0.15.5 includes the workaround for reproducible builds. Let me know if this issue persists or something else comes up. Thanks for the report! |
A quick test did fail to Repro :( |
Hmm weird, I tested it by creating multiple builds locally and using |
|
Ok, builds fine, I've missed that it needs Java17 now 🥳 |
Awesome, thanks for checking! Glad to hear it's working now. |
Done https://gitlab.com/fdroid/fdroiddata/-/commit/260ab2dd85fe5739476f756b6233ae556d36344e Thanks for sticking with it :) |
Describe the bug
https://monitor.f-droid.org/builds/log/org.jellyfin.androidtv/130399#site-footer It built fine in the CI. Not sure why it failed on the build server. Could you please take a look? Thanks!
Logs
Application version
130399
Where did you install the app from?
No response
Device information
None
Android version
None
Jellyfin server version
None
The text was updated successfully, but these errors were encountered: