Repository navigation
Version local builds as pre-releases of the next patch - #96
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 fromgit describe --tags --long --dirty --match 'v[0-9]*':BuildInfo.VERSION).msi/.dmg.rpm/.deb-PappVersion=1.6.21.6.21.6.2v1.6.1, clean1.6.11.6.11.6.1v1.6.11.6.2-alpha.71.6.21.6.2~alpha.71.6.2-alpha.7.dirty1.6.21.6.2~alpha.7.dirty0.0.00.0.00.0.0BuildInfogainsIS_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..msiand.dmgonly 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.jsonin 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~, so1.6.2~alpha.7sorts 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-runonly setsDISPLAY, so on a Wayland desktop the smoke-tested binary opened its window on the developer's live session. The test's command now runs withoutWAYLAND_DISPLAY/WAYLAND_SOCKETand withGDK_BACKEND=x11andXDG_SESSION_TYPE=x11.Reviewer notes
generateBuildInfo,compileKotlinandproperties, with and without-PappVersion. No packaging task was run, so thepackage.jsonhandling for.rpm/.debhasn't been exercised yet.package.jsonworkaround targets Nucleus 2.5.18. The Nucleus 3.0 upgrade should check whether it's still needed.