Skip to content

Version local builds as pre-releases of the next patch - #96

Merged
rocketraman merged 3 commits into
masterfrom
claude/local-build-versions
Dec 2, 2026
Merged

rocketraman merged 3 commits into
masterfrom
claude/local-build-versions

Conversation

@rocketraman

Copy link
Copy Markdown
Owner

A local build is currently stamped with the newest release tag, so a build several commits past v1.6.1 calls itself 1.6.1. The About panel, Diagnostics and the installed package can't tell it apart from the release.

What changes

Version derivation (build.gradle.kts). The version now comes from git describe --tags --long --dirty --match 'v[0-9]*':

Build App version (BuildInfo.VERSION) .msi / .dmg .rpm / .deb
CI release or -PappVersion= 1.6.2 1.6.2 1.6.2
Local, exactly on v1.6.1, clean 1.6.1 1.6.1 1.6.1
Local, 7 commits past v1.6.1 1.6.2-alpha.7 1.6.2 1.6.2~alpha.7
Same, with uncommitted changes 1.6.2-alpha.7.dirty 1.6.2 1.6.2~alpha.7.dirty
No release tag 0.0.0 0.0.0 0.0.0
  • BuildInfo gains IS_RELEASE. For a pre-release, the About panel's Release notes link opens the releases list instead of a tag page that doesn't exist.
  • .msi and .dmg only accept x.y.z, so a local build gets the next patch alone. electron-builder's MSI allows same-version upgrades, so the next local build and the real 1.6.2 both install over it. Going back to 1.6.1 is refused as a downgrade, on purpose: persisted data has no backward migrations.

Linux package version. Nucleus 2.5.18 passes the version to electron-builder through a package.json in the packaging output folder. It writes that file only if it doesn't already exist, so later builds keep the first build's version. It also rejects a - in an Rpm version through the DSL. Before each Rpm/Deb packaging run, the build now writes that file itself with the full version, and electron-builder turns - into ~, so 1.6.2~alpha.7 sorts between 1.6.1 and 1.6.2. Before the other packaging tasks it deletes the file, so Nucleus writes it again with plain x.y.z.

Native-image smoke test. This one is unrelated to versioning. xvfb-run only sets DISPLAY, so on a Wayland desktop the smoke-tested binary opened its window on the developer's live session. The test's command now runs without WAYLAND_DISPLAY/WAYLAND_SOCKET and with GDK_BACKEND=x11 and XDG_SESSION_TYPE=x11.

Reviewer notes

  • Each commit is one of the three changes above and can be reviewed on its own.
  • Checked locally: generateBuildInfo, compileKotlin and properties, with and without -PappVersion. No packaging task was run, so the package.json handling for .rpm/.deb hasn't been exercised yet.
  • The package.json workaround targets Nucleus 2.5.18. The Nucleus 3.0 upgrade should check whether it's still needed.

…sion

smokeTestNativeImage runs the binary under xvfb-run, which only sets
DISPLAY. On a Wayland desktop the binary still inherited WAYLAND_DISPLAY
and opened its window on the developer's session instead of on Xvfb.

The exec now drops WAYLAND_DISPLAY and WAYLAND_SOCKET and sets
GDK_BACKEND=x11 and XDG_SESSION_TYPE=x11. GTK's Wayland backend falls
back to the default wayland-0 socket even when WAYLAND_DISPLAY is unset,
so removing the variable alone is not enough.

Signed-off-by: Raman Gupta <rocketraman@gmail.com>
A local build was stamped with the newest release tag, so a build eleven
commits past v1.6.1 called itself 1.6.1. Neither the About panel nor the
installed package could tell it apart from the release.

The version now comes from `git describe --long --dirty`:

- A CI build (GITHUB_REF_NAME) or one with -PappVersion= is a release,
  stamped x.y.z as before.
- A local build exactly on a release tag with a clean tree is that
  release.
- Any other local build is a pre-release of the next patch: seven commits
  past v1.6.1 is 1.6.2-alpha.7, plus .dirty if the tree has uncommitted
  changes.

BuildInfo.VERSION carries that full version, so the About panel and
Diagnostics show it. A new BuildInfo.IS_RELEASE flag is false for a
pre-release, and the About panel's Release notes link then opens the
releases list, because a pre-release has no tag page of its own.

The .msi and .dmg only accept x.y.z, so they get the next patch alone:
1.6.2. The MSI that electron-builder generates allows same-version
upgrades, so the next local build and the 1.6.2 release both install
over it. Going back to 1.6.1 is refused as a downgrade, which is right
while persisted data has no backward migrations.

Signed-off-by: Raman Gupta <rocketraman@gmail.com>
Nucleus 2.5.18 gives electron-builder its version through a package.json
in the packaging output folder. It writes that file only if it does not
exist yet, so every later build kept the first build's version. A
pre-release version also can't go through the DSL: Nucleus rejects any
'-' in an Rpm version at configuration time.

Before each Rpm or Deb packaging run, the build now writes package.json
itself with the full version, for example 1.6.2-alpha.7. electron-builder
turns the '-' into '~', so 1.6.2~alpha.7 sorts after 1.6.1 and before
1.6.2. Before the other packaging tasks it deletes the file, so Nucleus
writes it again with the plain x.y.z that the .msi and .dmg need.

The full version is a task input, so a new pre-release repackages even
when the x.y.z passed through the DSL has not changed.

Signed-off-by: Raman Gupta <rocketraman@gmail.com>
@rocketraman
rocketraman merged commit 4a4c149 into master Dec 2, 2026
@rocketraman
rocketraman deleted the claude/local-build-versions branch December 2, 2026 16:20
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