Skip to content
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 can't build #147

Closed
licaon-kter opened this issue Jul 22, 2024 · 48 comments
Closed

F-Droid can't build #147

licaon-kter opened this issue Jul 22, 2024 · 48 comments

Comments

@licaon-kter
Copy link

licaon-kter commented Jul 22, 2024

https://monitor.f-droid.org/builds/log/ua.com.radiokot.photoprism/43#site-footer

Is that coming to maven soon or should we build it from source instead?

/LE: fyi https://gitlab.com/fdroid/fdroiddata/-/commit/ce82a52e3d2d08ae7af2b0b34d654d4a04fa442c

@licaon-kter licaon-kter added the bug Something isn't working label Jul 22, 2024
@Radiokot
Copy link
Owner

Hi Licaon Kter, thank you for reporting the failure.
ua.com.radiokot:offline-license-key:1.0.0 dependency is hosted on Jitpack, and it's been in the app since April.
I don't know why it didn't resolve, as the package is definitely available:
https://jitpack.io/ua/com/radiokot/offline-license-key/1.0.0/build.log
https://jitpack.io/ua/com/radiokot/offline-license-key/1.0.0/offline-license-key-1.0.0.jar

@Radiokot
Copy link
Owner

Version 44 built successfully
https://monitor.f-droid.org/builds/log/ua.com.radiokot.photoprism/44#site-footer

@linsui
Copy link

linsui commented Sep 29, 2024

Reproducible build failed.
ua.com.radiokot.photoprism-1.31.0.apk.html.zip

Maybe clean the cache and rebuild? Could you please take a look? Thanks!

@Radiokot Radiokot reopened this Sep 29, 2024
@Radiokot Radiokot added or can it? and removed bug Something isn't working labels Sep 29, 2024
@Radiokot
Copy link
Owner

F-Droid, oh, F-Droid 😄
I've cleaned the local build cache and re-built the APK. The updated file is attached to the release:
https://github.com/Radiokot/photoprism-android-client/releases/download/1.31.0(46)/ua.com.radiokot.photoprism-1.31.0.apk
@linsui can you please re-run the pipeline?

@linsui
Copy link

linsui commented Sep 29, 2024

ua.com.radiokot.photoprism-1.31.0(1).apk.html.zip
Now there is only a small diff. Any idea?

@Radiokot
Copy link
Owner

I accidentally added an extra line break to the class source code, maybe that's why the lines are offset by 1, although I thought the compiler ignores all the line breaks and spaces.
@linsui please, try the updated APK:
https://github.com/Radiokot/photoprism-android-client/releases/download/1.31.0(46)/ua.com.radiokot.photoprism-1.31.0.apk

@linsui
Copy link

linsui commented Sep 29, 2024

It works, thanks!

@licaon-kter
Copy link
Author

and again: https://gitlab.com/fdroid/checkupdates-bot-fdroiddata/-/jobs/8327688100#L659

diff log is really small:

│   --- ua.com.radiokot.photoprism-1.32.0/smali_classes3/ua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModel.smali
├── +++ ua.com.radiokot.photoprism_48/smali_classes3/ua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModel.smali
│ @@ -1040,33 +1040,31 @@
│      invoke-direct {p0}, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModel;->getStateDefaultSearchConfig()Lua/com/radiokot/photoprism/features/gallery/data/model/SearchConfig;
│  
│      move-result-object v0
│  
│      iput-object v0, p0, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModel;->currentSearchConfig:Lua/com/radiokot/photoprism/features/gallery/data/model/SearchConfig;
│  
│      .line 204
│ +    iget-object v1, p0, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModel;->mediaRepositoryChanges:Lio/reactivex/rxjava3/subjects/BehaviorSubject;
│ -    iget-object v0, p0, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModel;->mediaRepositoryChanges:Lio/reactivex/rxjava3/subjects/BehaviorSubject;
│  
│      .line 205
│ +    new-instance v2, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModel$MediaRepositoryChange$ResetToInitial;
│ -    new-instance v1, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModel$MediaRepositoryChange$ResetToInitial;
│  
│      .line 206
│ +    iget-object v3, p0, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModel;->galleryMediaRepositoryFactory:Lua/com/radiokot/photoprism/features/gallery/data/storage/SimpleGalleryMediaRepository$Factory;
│ -    iget-object v2, p0, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModel;->galleryMediaRepositoryFactory:Lua/com/radiokot/photoprism/features/gallery/data/storage/SimpleGalleryMediaRepository$Factory;
│  
│ +    invoke-virtual {v3, v0}, Lua/com/radiokot/photoprism/features/gallery/data/storage/SimpleGalleryMediaRepository$Factory;->get(Lua/com/radiokot/photoprism/features/gallery/data/model/SearchConfig;)Lua/com/radiokot/photoprism/features/gallery/data/storage/SimpleGalleryMediaRepository;
│ -    iget-object v3, p0, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModel;->currentSearchConfig:Lua/com/radiokot/photoprism/features/gallery/data/model/SearchConfig;
│  
│ +    move-result-object v0
│ -    invoke-virtual {v2, v3}, Lua/com/radiokot/photoprism/features/gallery/data/storage/SimpleGalleryMediaRepository$Factory;->get(Lua/com/radiokot/photoprism/features/gallery/data/model/SearchConfig;)Lua/com/radiokot/photoprism/features/gallery/data/storage/SimpleGalleryMediaRepository;
│ -
│ -    move-result-object v2
│  
│      .line 205
│ +    invoke-direct {v2, v0}, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModel$MediaRepositoryChange$ResetToInitial;-><init>(Lua/com/radiokot/photoprism/features/gallery/data/storage/SimpleGalleryMediaRepository;)V
│ -    invoke-direct {v1, v2}, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModel$MediaRepositoryChange$ResetToInitial;-><init>(Lua/com/radiokot/photoprism/features/gallery/data/storage/SimpleGalleryMediaRepository;)V
│  
│      .line 204
│ +    invoke-virtual {v1, v2}, Lio/reactivex/rxjava3/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V
│ -    invoke-virtual {v0, v1}, Lio/reactivex/rxjava3/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V
│  
│      return-void
│  .end method
│  
│  .method private final subscribeToFastScroll()V
│      .locals 7

@Radiokot
Copy link
Owner

Hi, I've cleaned the local build cache and re-built the APK. The updated file is attached to the release:
https://github.com/Radiokot/photoprism-android-client/releases/tag/1.32.0(48)
@licaon-kter @linsui can you please re-run the build?

@licaon-kter
Copy link
Author

same fail, same diff log :(

@Radiokot
Copy link
Owner

@licaon-kter Ok, I have no idea on the cause of the issue, so now I just signed the APK from the fdroid build run artifacts and attached it to the release. Please, re-run. Thank you for your work 🤝🏻

@licaon-kter
Copy link
Author

that's not how reproducibility works 🤷

@Radiokot
Copy link
Owner

@licaon-kter

  • The package built by F-Droid behaves as expected
  • There's a minor difference with the package built on my computer, perhaps caused by the way Kotlin is translated into Java bytecode
  • I, as a developer of the app, accept the package built by F-Droid as a correctly built one, like if it was built by CI

@licaon-kter
Copy link
Author

@Radiokot yes, go ahead then 🤷

@Radiokot
Copy link
Owner

@licaon-kter please, re-run the job

@licaon-kter
Copy link
Author

this was ok in the CI https://gitlab.com/fdroid/checkupdates-bot-fdroiddata/-/jobs/8340827080

but failed on the main server still: https://monitor.f-droid.org/builds/log/ua.com.radiokot.photoprism/48#site-footer

will loop locally to see if there's a pattern

@Radiokot Radiokot reopened this Nov 13, 2024
@licaon-kter
Copy link
Author

licaon-kter commented Nov 13, 2024

limiting to 6 cores was ok in my testing, eg. 22 cores was failing

will reopen if main server fails again: https://gitlab.com/fdroid/fdroiddata/-/commit/9437c790e215668c4f12cbf01b8a4b0aa4ad7aca

@Radiokot
Copy link
Owner

Thank you!

@linsui
Copy link

linsui commented Dec 2, 2024

ua.com.radiokot.photoprism-1.33.0.apk.html.zip

Reproducible build failed. Maybe we need a clean rebuild?

@Radiokot
Copy link
Owner

Radiokot commented Dec 2, 2024

@linsui clean rebuild hasn't worked for some time now.

The differences are negligible. I accept the package built by F-Droid as a correctly built one, I have signed it and attached to the release. Please, re-run the job. Thank you.

@linsui
Copy link

linsui commented Dec 2, 2024

OK, thanks! But there must be something different that the diff is so large. Did you build it with openjdk 17?

@licaon-kter licaon-kter reopened this Dec 2, 2024
@linsui
Copy link

linsui commented Dec 2, 2024

Weird. I got the same apk. Could you please build the apk with openjdk 17, e.g. https://adoptium.net/temurin/releases/?

@Radiokot
Copy link
Owner

Radiokot commented Dec 2, 2024

I'll try it for the next release, let's proceed with the APK built by F-Droid for now.

@linsui
Copy link

linsui commented Dec 2, 2024

OK, thanks!

@linsui
Copy link

linsui commented Jan 9, 2025

Reproducible build failed again.

@Radiokot
Copy link
Owner

Radiokot commented Jan 9, 2025

Hi @linsui , that's unfortunate, this time it was built with JDK 17 as you suggested. Please, re-launch the task, I once again signed the F-Droid build and re-attached it to the release. Thank you.

@linsui
Copy link

linsui commented Jan 9, 2025

Maybe a clean build helps. Your apk was not built from the tag.

@Radiokot
Copy link
Owner

Radiokot commented Jan 9, 2025

What makes you think that?

@linsui
Copy link

linsui commented Jan 9, 2025

The apk has a vcs info embeded. It points to the commit before the tag. So you built the apk before committing the last change.

@Radiokot
Copy link
Owner

Radiokot commented Jan 9, 2025

I didn't know that. Could it cause the difference in dex files though? I build APK before putting a tag in order to smoke test it. If everything's fine, I update the changelog and put a tag, I don't change the sources 🤔

@licaon-kter
Copy link
Author

See https://f-droid.org/docs/Reproducible_Builds/#vcs-info as the tree info (commit) ends up in the APK.

While we understand that developers build and test during their normal workflow, please upload release APKs built after tagging, from a clean tree at the actual tagged commit (i.e. without local changes or remaining artifacts from previous builds).

@linsui
Copy link

linsui commented Jan 9, 2025

It shouldn't cause the dex diff. Did you clean the cache before building?

@linsui
Copy link

linsui commented Jan 9, 2025

The diff is similiar though... It's still about smali_classes4/ua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModelGallery.smali.

@licaon-kter
Copy link
Author

It shouldn't cause the dex diff.

right, but it's nice that it acts as a clue to how the build was made, it might help

@Radiokot
Copy link
Owner

Radiokot commented Jan 9, 2025

Thanks guys, next time I'll build the APK after committing and tagging a version update. As for the clear cache, I run the Gradle clean and then build the main APK. If there are other cleaning routines which must be executed before building, please let me know 🙏🏻

@Radiokot
Copy link
Owner

Guys, please re-run the update job with the latest artifact attached to the release

@linsui
Copy link

linsui commented Jan 16, 2025

Thanks!

@licaon-kter
Copy link
Author

Looks like it fails to build on both buildserver: https://monitor.f-droid.org/builds/log/ua.com.radiokot.photoprism/50#site-footer

and for me locally

difflog:

│   --- ua.com.radiokot.photoprism-1.34.0/smali_classes4/ua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModelGallery.smali
├── +++ ua.com.radiokot.photoprism_50/smali_classes4/ua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModelGallery.smali
│ @@ -1005,31 +1005,33 @@
│      invoke-direct {p0}, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModelGallery;->getStateDefaultSearchConfig()Lua/com/radiokot/photoprism/features/gallery/data/model/SearchConfig;
│  
│      move-result-object v0
│  
│      iput-object v0, p0, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModelGallery;->currentSearchConfig:Lua/com/radiokot/photoprism/features/gallery/data/model/SearchConfig;
│  
│      .line 199
│ +    iget-object v0, p0, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModelGallery;->mediaRepositoryChanges:Lio/reactivex/rxjava3/subjects/BehaviorSubject;
│ -    iget-object v1, p0, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModelGallery;->mediaRepositoryChanges:Lio/reactivex/rxjava3/subjects/BehaviorSubject;
│  
│      .line 200
│ +    new-instance v1, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModelGallery$MediaRepositoryChange$ResetToInitial;
│ -    new-instance v2, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModelGallery$MediaRepositoryChange$ResetToInitial;
│  
│      .line 201
│ +    iget-object v2, p0, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModelGallery;->galleryMediaRepositoryFactory:Lua/com/radiokot/photoprism/features/gallery/data/storage/SimpleGalleryMediaRepository$Factory;
│ -    iget-object v3, p0, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModelGallery;->galleryMediaRepositoryFactory:Lua/com/radiokot/photoprism/features/gallery/data/storage/SimpleGalleryMediaRepository$Factory;
│  
│ +    iget-object v3, p0, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModelGallery;->currentSearchConfig:Lua/com/radiokot/photoprism/features/gallery/data/model/SearchConfig;
│ -    invoke-virtual {v3, v0}, Lua/com/radiokot/photoprism/features/gallery/data/storage/SimpleGalleryMediaRepository$Factory;->get(Lua/com/radiokot/photoprism/features/gallery/data/model/SearchConfig;)Lua/com/radiokot/photoprism/features/gallery/data/storage/SimpleGalleryMediaRepository;
│  
│ +    invoke-virtual {v2, v3}, Lua/com/radiokot/photoprism/features/gallery/data/storage/SimpleGalleryMediaRepository$Factory;->get(Lua/com/radiokot/photoprism/features/gallery/data/model/SearchConfig;)Lua/com/radiokot/photoprism/features/gallery/data/storage/SimpleGalleryMediaRepository;
│ +
│ +    move-result-object v2
│ -    move-result-object v0
│  
│      .line 200
│ +    invoke-direct {v1, v2}, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModelGallery$MediaRepositoryChange$ResetToInitial;-><init>(Lua/com/radiokot/photoprism/features/gallery/data/storage/SimpleGalleryMediaRepository;)V
│ -    invoke-direct {v2, v0}, Lua/com/radiokot/photoprism/features/gallery/view/model/GalleryViewModelGallery$MediaRepositoryChange$ResetToInitial;-><init>(Lua/com/radiokot/photoprism/features/gallery/data/storage/SimpleGalleryMediaRepository;)V
│  
│      .line 199
│ +    invoke-virtual {v0, v1}, Lio/reactivex/rxjava3/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V
│ -    invoke-virtual {v1, v2}, Lio/reactivex/rxjava3/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V
│  
│      return-void
│  .end method

@licaon-kter licaon-kter reopened this Jan 21, 2025
@Radiokot
Copy link
Owner

I literally signed the APK built by F-Droid update checker on Jan 09 and attached it to the release as ua.com.radiokot.photoprism-1.34.0.apk. How can it have a diff in this case?

@licaon-kter
Copy link
Author

licaon-kter commented Jan 21, 2025

...built by the F-Droid Gitlab CI user for verification at metadata merge time only.

Now that I look at it again, it's the same diff log as Nov 12 🤦

@Radiokot
Copy link
Owner

Never mind

@Radiokot
Copy link
Owner

Radiokot commented Feb 4, 2025

The latest release artifact, version 1.35.0(51), has been built and signed by a GitHub action on Ubuntu 24.04 with Java 17 (Temurin). I wonder if there is going to be a diff this time.

@licaon-kter
Copy link
Author

https://gitlab.com/fdroid/fdroiddata/-/commit/e6cfd8d5eb936e2f9b822985a4e3b9220ee7b4bf thanks

@licaon-kter
Copy link
Author

Ah, one more thing @Radiokot https://gitlab.com/fdroid/fdroiddata/-/jobs/9037719640#L609

We find that there is a DependencyInfoBlock in your APK.

It's a Signing block added by AGP and encrypted with the Google public key so it can't be read by anyone else except Google. You can read more about it here and here.

While this was added a while ago, we were only enforcing it for new apps, and recently we started scanning updates too.

Could you please disable it with the following code?

android {
    dependenciesInfo {
        // Disables dependency metadata when building APKs.
        includeInApk = false
        // Disables dependency metadata when building Android App Bundles.
        includeInBundle = false
    }
}

Thanks!

@licaon-kter licaon-kter reopened this Feb 4, 2025
@Radiokot
Copy link
Owner

Radiokot commented Feb 5, 2025

Thanks, @licaon-kter

  • dependenciesInfo disabled for bundle and APK
  • New tag, 1.35.0(52) is published
  • The existing 1.35.0 release tag switched to 1.35.0(52)
  • Artifacts in the existing release re-built from the new tag, 1.35.0(52)

@licaon-kter
Copy link
Author

thanks https://gitlab.com/fdroid/fdroiddata/-/commit/efb8e89a5e3a1a666d1617f9d2d3a32260f3a82a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants