Derive build versions from a tracked VERSION file - #259
Merged
Conversation
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.
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.
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 branch3.15, leaving 3.15.1 as the newest taggit describecan reach from master. Every build script bumped the last component of that.Besides being confusing, it breaks upgrades. Both
rpmanddpkgrank the released 3.15.6 above3.15.2.dev701, so a development package will not install over a released one without forcing.Fix
A top-level
VERSIONfile names the release the branch is working toward (4.0.0on master), and./mkversionturns 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 bumpVERSIONafter tagging the current branch cannot walk the version backwards. Staying ahead of tags on other branches is whatVERSIONitself is for.VERSION=4.0.04.0.0.dev<n>+g<hash>4.0, 5 commits past tag 4.0.04.0.1.dev5+g<hash>4.0.14.0, bumped to 4.1.04.1.0.dev<n>+g<hash>Only master needs an edit, once per series, and the order matters: cut branch
X.Yfirst, then bumpVERSIONon master, or the release branch inherits the wrong series. Documented inREADME.md.mkversionnever guesses. A missing or malformedVERSION, an unreadable git tree (build/buildarmrunsbuildrpmas root inside a container over a$HOMEbind 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.mkversionalso replaces the version block copy-pasted into seven build scripts.--tildeselects~devfor the packages with nosetup.py, as before.makesetupnow echoes the version it stamped andbuildrpm/builddebcapture it, so the version is computed once per package instead of the per-packageVERSIONfile the two of them used to read; the stale checked-inconfluent_common/VERSION(1.0.1, last touched in the 1.1 cycle) goes with it, leaving one filenamed
VERSIONin the tree. Themakesetup.debwrapper inbuilddeb, which rewrote a tildemakesetuphas not emitted in years, is dropped.This does not change the
.devform used by confluent_server/client/common, which both rpm and dpkg rank above the matching release.Testing
rpmdev-vercmpanddpkg --compare-versionsnow rank the development build above 3.15.63.15.2.dev<n>rpm and ubuntu2404 from a3.15.2~dev<n>deb, both as ordinary upgrades; daemon restarted and/versionreports the new versionconfluent_osdeploy/LICENSEat the path%installuses