Skip to content

android: derive versionCode from tailscale version#807

Open
kari-ts wants to merge 1 commit into
mainfrom
kari/fdroid
Open

android: derive versionCode from tailscale version#807
kari-ts wants to merge 1 commit into
mainfrom
kari/fdroid

Conversation

@kari-ts

@kari-ts kari-ts commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Previously, versionCode was only set by the Play Store builder and never committed back to the repo, so fdroid wouldn't detect updates.
Now, we compute versionCode deterministically using the formula major100M + minor100K + patch*10 + platform, so that fdroid and Play Store builds always produce the same value.

Updates tailscale/tailscale#18969

Signed-off-by: kari-ts kari@tailscale.com

@kari-ts kari-ts requested a review from barnstar June 5, 2026 20:08
@SuggonM

SuggonM commented Jun 14, 2026

Copy link
Copy Markdown

Out of curiosity, is this the reason Tailscale hasn't been updated on F-Droid in 3 months?

Comment thread Makefile Outdated
bumposs: update-oss tailscale.version
source tailscale.version && git commit -sm "android: bump OSS" -m "OSS and Version updated to $${VERSION_LONG}" go.toolchain.rev android/build.gradle go.mod go.sum
## Bump versionCode, amend the current commit, and tag it
tag_release: debug-symbols tailscale.version bump_version_code

@barnstar barnstar Jun 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just bumping here will cause f-droid and playstore versions to diverge.. I don't know if we care since the version source-of-truth is the tailscale version, but Android cares and this makes things hard to reason about.

The build scripts will check the playstore version and increment this during the build. Perhaps a better approach is to do something deterministic so that an f-droid build always ends up with same version as the corresponding playstore build and that the playstore version can be derived from the tailscale version and vice-versa. That way, we're not changing anything at build time (except perhaps a modifier to denote atv)

Something like: major * 10000000 + minor * 1000000 + patch *10 + (platform)
1.99.123 -> 1_099_0123_0 and 1.100.123 - > 1_100_0123_0 and add 1 for the atv build and remove the check in the build pipeline that looks up the version and increments it and just change this on very bumposs or tagrelease. With enough precision to allow for minor version up to 999, and patch versions up to 9999....

Previously, versionCode was only set by the Play Store builder and never committed back to the repo, so fdroid wouldn't detect updates.
Now, we compute versionCode deterministically using the formula major*100M + minor*100K + patch*10 + platform, so that fdroid and Play Store builds always produce the same value.

Updates tailscale/tailscale#18969

Signed-off-by: kari-ts <kari@tailscale.com>
@kari-ts kari-ts changed the title android: bump versionCode on tag to trigger fdroid builds android: derive versionCode from tailscale version Jun 17, 2026
@kari-ts kari-ts requested a review from barnstar June 17, 2026 21:09
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.

3 participants