io7m-com / exfilac

Simple, reliable, automated S3 uploads for Android
https://www.io7m.com/software/exfilac
ISC License
10 stars 1 forks source link

Publish on F-Droid #14

Closed io7m closed 2 months ago

io7m commented 2 months ago

Metadata in this branch:

https://gitlab.com/io7m/fdroiddata/-/tree/exfilac?ref_type=heads

Running into problems building the code due to having a non-standard build setup (due to Gradle being pure undiluted excrement).

io7m commented 2 months ago

First issue: The fdroidserver package has a bug. It was first documented here two years ago, and apparently fixed:

https://gitlab.com/fdroid/docker-executable-fdroidserver/-/issues/15

But now with the most recent fdroidserver package from git, the problem is back:

2024-09-19 17:41:59,006 INFO: Cleaning Gradle project...
2024-09-19 17:41:59,006 DEBUG: Directory: build/com.io7m.exfilac
2024-09-19 17:41:59,006 DEBUG: > /home/rm-work/git/fdroidserver/fdroidserver-env/lib/python3.12/site-packages/gradlew-fdroid clean
2024-09-19 17:41:59,006 ERROR: Could not build app com.io7m.exfilac: OSError while trying to execute /home/rm-work/git/fdroidserver/fdroidserver-env/lib/python3.12/site-packages/gradlew-fdroid clean: [Errno 2] No such file or directory: '/home/rm-work/git/fdroidserver/fdroidserver-env/lib/python3.12/site-packages/gradlew-fdroid'
2024-09-19 17:41:59,009 DEBUG: skip deploying full build logs: not enabled in config
2024-09-19 17:41:59,010 DEBUG: skip deploying full build logs: not enabled in config
2024-09-19 17:41:59,010 INFO: Finished
2024-09-19 17:41:59,010 INFO: 1 build failed
2024-09-19 17:41:59,010 DEBUG: skip deploying full build logs: not enabled in config
2024-09-19 17:41:59,010 DEBUG: skip deploying full build logs: not enabled in config
io7m commented 2 months ago

Second issue: We put the version code in gradle.properties to make it possible for external tools to do version updates without having to involve Gradle. fdroid doesn't know how to extract the version code:

2024-09-19 17:49:14,260 ERROR: ...checkupdate failed for com.io7m.exfilac : Couldn't find any version information
2024-09-19 17:49:14,261 DEBUG: Traceback (most recent call last):
  File "/builds/io7m/fdroidserver/fdroidserver/checkupdates.py", line 751, in main
    checkupdates_app(app, options.auto, options.commit)
  File "/builds/io7m/fdroidserver/fdroidserver/checkupdates.py", line 537, in checkupdates_app
    (version, vercode, tag) = check_tags(app, pattern)
                              ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builds/io7m/fdroidserver/fdroidserver/checkupdates.py", line 270, in check_tags
    raise FDroidException(_("Couldn't find any version information"))
fdroidserver.exception.FDroidException: Couldn't find any version information

Fixed: https://gitlab.com/fdroid/fdroiddata/-/issues/3383

io7m commented 2 months ago

Third issue: fdroid deletes the bundled version of Gradle included in the repository, meaning that the build then fails (because make/Make.java expects ./gradlew to exist).

Fixed: Run java make/Make.java as a prebuild step, and then assume the rest of the build uses Gradle. This seems to work.

io7m commented 2 months ago

Now the build fails because there are extra jar files left over:

2024-09-20 15:14:39,533 INFO: Scanning source for common problems...
2024-09-20 15:14:39,537 DEBUG: scanner is configured to use signature data from: 'suss'
2024-09-20 15:14:39,537 DEBUG: downloading 'https://fdroid.gitlab.io/fdroid-suss/suss.json'
2024-09-20 15:14:39,731 DEBUG: write 'suss.json' to cache
2024-09-20 15:14:39,733 DEBUG: next suss.json cache update due in 23:59:59.996205
2024-09-20 15:14:39,762 ERROR: Found Java JAR file at xstructural.jar
2024-09-20 15:14:39,762 ERROR: Found Java JAR file at ktlint.jar
2024-09-20 15:14:39,765 ERROR: Found Java JAR file at scando.jar
2024-09-20 15:14:39,765 ERROR: Found Java JAR file at sqlite.jar
2024-09-20 15:14:39,767 INFO: Removing gradle-wrapper.jar at gradle/wrapper/gradle-wrapper.jar
2024-09-20 15:14:39,779 ERROR: Found shared library at com.io7m.exfilac.main/src/main/jniLibs/arm64-v8a/libsqlitejdbc.so
2024-09-20 15:14:39,779 ERROR: Found shared library at com.io7m.exfilac.main/src/main/jniLibs/x86/libsqlitejdbc.so
2024-09-20 15:14:39,780 ERROR: Found shared library at com.io7m.exfilac.main/src/main/jniLibs/armeabi/libsqlitejdbc.so
2024-09-20 15:14:39,780 ERROR: Found shared library at com.io7m.exfilac.main/src/main/jniLibs/x86_64/libsqlitejdbc.so
2024-09-20 15:14:39,793 ERROR: Could not build app com.io7m.exfilac: Can't build due to 8 errors while scanning
2024-09-20 15:14:39,793 DEBUG: Error encountered, stopping by user request.
Uploading artifacts for failed job

I don't know why any of these are problems.

io7m commented 2 months ago

Submitted: https://gitlab.com/fdroid/fdroiddata/-/merge_requests/15804

io7m commented 2 months ago

Merged. Should start appearing in F-droid soon.