Skip to content

Derive build versions from a tracked VERSION file - #259

Merged
jjohnson42 merged 2 commits into
xcat2:masterfrom
Obihoernchen:versioning
Jul 28, 2026
Merged

Derive build versions from a tracked VERSION file#259
jjohnson42 merged 2 commits into
xcat2:masterfrom
Obihoernchen:versioning

Conversation

@Obihoernchen

@Obihoernchen Obihoernchen commented Jul 27, 2026

Copy link
Copy Markdown
Member

It was hart to do tests in CI because the versioning was all over the place.
Packages built from master are stamped 3.15.2.dev<n>, a version released in April. Release tags do not live on master: 3.15.2 through 3.15.6 were tagged on branch 3.15, leaving 3.15.1 as the newest tag git describe can reach from master. Every build script bumped the last component of that.

Besides being confusing, it breaks upgrades. Both rpm and dpkg rank the released 3.15.6 above 3.15.2.dev701, so a development package will not install over a released one without forcing.

Fix

A top-level VERSION file names the release the branch is working toward (4.0.0 on master), and ./mkversion turns it into the version stamped on packages. The newest tag reachable from HEAD is kept as a floor and the higher of the two wins, so forgetting to bump VERSION after tagging the current branch cannot walk the version backwards. Staying ahead of tags on other branches is what VERSION itself is for.

situation version
master, VERSION=4.0.0 4.0.0.dev<n>+g<hash>
branch 4.0, 5 commits past tag 4.0.0 4.0.1.dev5+g<hash>
exactly on tag 4.0.1 4.0.1
master after cutting 4.0, bumped to 4.1.0 4.1.0.dev<n>+g<hash>

Only master needs an edit, once per series, and the order matters: cut branch X.Y first, then bump VERSION on master, or the release branch inherits the wrong series. Documented in README.md.

mkversion never guesses. A missing or malformed VERSION, an unreadable git tree (build/buildarm runs buildrpm as root inside a container over a $HOME bind mount, where git refuses the repository) or an unknown argument each exit non-zero rather than emitting a plausible-looking version, and every caller propagates that.

mkversion also replaces the version block copy-pasted into seven build scripts. --tilde selects ~dev for the packages with no setup.py, as before. makesetup now echoes the version it stamped and buildrpm/builddeb capture it, so the version is computed once per package instead of the per-package VERSION file the two of them used to read; the stale checked-in confluent_common/VERSION (1.0.1, last touched in the 1.1 cycle) goes with it, leaving one file
named VERSION in the tree. The makesetup.deb wrapper in builddeb, which rewrote a tilde makesetup has not emitted in years, is dropped.

This does not change the .dev form used by confluent_server/client/common, which both rpm and dpkg rank above the matching release.

Testing

  • rpmdev-vercmp and dpkg --compare-versions now rank the development build above 3.15.6
  • Built and installed in the lab: alma9 upgraded from a 3.15.2.dev<n> rpm and ubuntu2404 from a
    3.15.2~dev<n> deb, both as ordinary upgrades; daemon restarted and /version reports the new version
  • osdeploy tarball checked to contain confluent_osdeploy/LICENSE at the path %install uses

Release tags do not live on master: 3.15.2 through 3.15.6 were tagged on branch
3.15, so git describe reaches only 3.15.1 and dev builds were stamped
3.15.2.dev<n>. Besides being confusing, rpm and dpkg both rank the released
3.15.6 above that, so a dev package will not install over a released one.

Add a top-level VERSION file naming the release the branch is working toward
(4.0.0 on master) and a mkversion helper that stamps packages from it, keeping
the tag-derived value as a floor so a forgotten bump cannot go backwards.
mkversion also replaces the block copy-pasted into seven build scripts, and
makesetup no longer writes a per-package VERSION file, so the stale checked-in
confluent_common/VERSION goes with it.
The copy ran after the cd to the repo root, so it read ../LICENSE from
outside the checkout and never placed the file in confluent_osdeploy/. The
tarball went out without it and the spec's %install, which does
"cp LICENSE" after %setup cds into the unpacked directory, failed.
imgutil/buildrpm already copies before its cd; do the same here.

The aarch64 spec has its LICENSE lines commented out, so only the x86_64
build broke, but the copy was equally wrong in both scripts.
@jjohnson42
jjohnson42 merged commit 46296d4 into xcat2:master Jul 28, 2026
2 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.

2 participants