Skip to content

State the version literally so F-Droid can read it - #31

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

SibtainOcn merged 1 commit into
mainfrom
fix/fdroid-checkupdates

Conversation

@SibtainOcn

Copy link
Copy Markdown
Owner

The failure

The fdroiddata submission pipeline ran 9 jobs. fdroid lint, fdroid rewritemeta, schema validation, check source code and tools check scripts all passed. One failed:

ERROR: ...checkupdate failed for com.hazel.android : Couldn't find any version information
DEBUG: Parsing manifest at 'build/com.hazel.android/app/build.gradle.kts'
DEBUG: ..got package=com.hazel.android, version=None, vercode=None

The cause

fdroidserver reads the version out of build.gradle.kts with a regular expression and never runs Gradle:

vcsearch_g = re.compile(r'\b[Vv]ersionCode\s*=?\s*["\'(]*([0-9][0-9_]*)["\')]*')
vnsearch_g = re.compile(r'\b[Vv]ersionName\s*=?\s*\(?(["\'])((?:(?=(\?))\3.)*?)\1')

Both need a literal. 1.0.5 had versionCode = hazelVersionCode * abiCodeSpan and versionName = hazelVersionName, reading from gradle.properties, so both matched nothing.

That was introduced in the previous release to make AutoUpdateMode: Version work without hand-editing the recipe. It fixed that and broke this. A build argument would fail the same way: what is not in the file cannot be read from it.

The change

Both are literals in defaultConfig again:

versionCode = 300
versionName = "1.0.6"

The per-architecture codes now derive from the literal rather than the other way round, via android.defaultConfig.versionCode, so there is still exactly one copy of the number. tools/release.ps1 rewrites that copy instead of gradle.properties.

AutoUpdateMode is unaffected: the recipe still carries no version-specific literal, since output: uses $$VERSION$$ and there is no gradleprops.

Verified

fdroidserver's own regexes, imported from the installed package rather than retyped:

versionCode : ['300']
versionName : ['1.0.6']
package     : ['com.hazel.android']
VERDICT: checkupdates can read all three

Merged manifests with no -P arguments, which is how F-Droid builds:

ABI versionCode versionName
universal 300 1.0.6
armeabi-v7a 301 1.0.6
x86 302 1.0.6
x86_64 303 1.0.6
arm64-v8a 304 1.0.6

Also

Store changelogs regenerated as 300-304, and short enough that the listing will not truncate them this time. The recipe targets v1.0.6; neither v1.0.4 nor v1.0.5 can be submitted, the first for the foojay resolver and the second for this.

F-Droid's checkupdates job failed on the submission:

  checkupdate failed for com.hazel.android : Couldn't find any version
  information
  ..got package=com.hazel.android, version=None, vercode=None

It reads versionName and versionCode straight out of build.gradle.kts
with a regular expression and never runs Gradle, so the previous release
holding them in gradle.properties left nothing for it to find. The same
would be true of any computed expression.

Both are literals in defaultConfig again. The per-architecture codes are
derived from the literal rather than the other way round, so there is
still one copy of the number, and release.ps1 rewrites that copy.

Cuts 1.0.6 at codes 300 to 304.
@SibtainOcn
SibtainOcn merged commit e0a07b1 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