Skip to content

Drop the foojay toolchain resolver so F-Droid can build - #29

Merged
SibtainOcn merged 1 commit into
mainfrom
fix/fdroid-scanner-foojay
Sep 3, 2026
Merged

SibtainOcn merged 1 commit into
mainfrom
fix/fdroid-scanner-foojay

Conversation

@SibtainOcn

Copy link
Copy Markdown
Owner

The finding

Ran Hazel through F-Droid's own tooling (fdroidserver 2.4.5, on WSL). The build scanner refuses the whole thing:

ERROR: Found usual suspect 'org.gradle.toolchains.foojay-resolver' at settings.gradle.kts
ERROR: Can't build due to 1 error while scanning

foojay-resolver-convention resolves a Java toolchain by downloading a JDK from the Foojay API partway through the build. F-Droid rejects that on sight, and reasonably: a build that fetches its own compiler from a third party is not one anyone else can reproduce.

Nothing in this project requests a toolchain. No jvmToolchain(...), no JavaLanguageVersion. Java level is set through sourceCompatibility and jvmTarget, which the plugin has no part in. It came from the Android Studio template and has never done anything here.

Removed. :app:compileReleaseKotlin still configures and builds; after this change the scanner passes and the build proceeds to compiling.

Also in here

The recipe draft ran ./gradlew itself from a build: command. That cannot work on F-Droid: it deletes gradle-wrapper.jar before building (seen in the log: Removing gradle-wrapper.jar at gradle/wrapper/gradle-wrapper.jar), and the command runs from app/ where gradlew does not exist. It now uses gradle: so fdroidserver runs assembleRelease with its own Gradle, and gradleprops to pass VERSION_NAME.

The recipe's Changelog also moves from /blob/main/ to /blob/HEAD/, which is what fdroid lint asks for. Lint is now clean, exit 0.

What this means for submission

The recipe targets v1.0.5, which does not exist yet. v1.0.4 cannot be submitted to F-Droid: it predates this fix, so their scanner would reject it. The tag has to be cut after this merges.

v1.0.4 on GitHub is unaffected and stays as it is. It is a working release, just not one F-Droid can build.

Verified along the way

  • fdroid lint com.hazel.android clean
  • Categories checked against the real 108-entry config/categories.yml; Download is a valid category and the best fit
  • fdroidserver strips the signing config itself, so the HAZEL_SIGNING_DIR unsigned fallback never comes up on their builders
  • Gradle 9.5.0 verifies against its official checksum, though fdroidserver 2.4.5 ships no hash for any 9.x and needs one added upstream

The draft ran ./gradlew itself from a build: command. That cannot work:
F-Droid deletes gradle-wrapper.jar before building, since a binary blob
in the source tree is exactly what it will not run, and the command also
ran from app/ where gradlew is not.

Uses the gradle: field so fdroidserver runs assembleRelease with its own
Gradle, and gradleprops to pass VERSION_NAME. Targets v1.0.5, since
v1.0.4 predates the foojay removal and its scanner error.
@SibtainOcn
SibtainOcn merged commit d6004b1 into main Sep 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant