fix(macos): stamp app version from git release tag - #223
Open
xavierforge wants to merge 1 commit into
Open
xavierforge wants to merge 1 commit into
xavierforge wants to merge 1 commit into
Conversation
Info.plist has shipped CFBundleShortVersionString 0.4.0 and CFBundleVersion 5 unchanged since a469b7e, so every release from v0.1.0 to v0.4.1 reports the same version in Finder. Users cannot tell which release they installed, and issue reports naming a version cannot be trusted. build-app.sh now rewrites the installed Info.plist from git before codesign: a clean checkout at an exact vX.Y.Z tag gets that version, anything else gets 0.0.0 so a development build never claims a release number, CFBundleVersion is the commit count, and TryOmarchyBuildDescribe keeps the full git describe output. Without a git checkout the checked-in plist is kept and a warning is printed. The package and release targets now require a clean worktree (including untracked files) and an exact vX.Y.Z tag on HEAD, so a signed DMG cannot be produced with a stale or development version again.
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.
Summary
CFBundleShortVersionString,CFBundleVersionand a newTryOmarchyBuildDescribekey into the builtInfo.plistfrom git, right before codesign.version-preflighttarget thatpackageandreleasedepend on: the worktree must be clean (untracked files included) and HEAD must carry an exactvX.Y.Ztag.Problem
macos/Info.plisthas carriedCFBundleShortVersionString = 0.4.0andCFBundleVersion = 5unchanged sincea469b7e(2026-08-24), andbuild-app.shinstalls it verbatim. Every tagged release from v0.1.0 to v0.4.1 therefore reports the same version:Users cannot tell which release they installed, and a version quoted in an issue cannot be trusted. #211 is titled "v0.4.0: every launch fails ... v0.3.0 fine", but a v0.3.0 build also shows 0.4.0 in Finder. I hit the same thing: Finder said 0.4.0, the bundle was actually built at the v0.3.0 tag time, and I assumed the guest already contained #172.
Fix
macos/build-app.sh, after theInfo.plistinstall and before codesign:CFBundleShortVersionStringCFBundleVersionTryOmarchyBuildDescribevX.Y.ZtagX.Y.Zgit rev-list --count HEADvX.Y.Z0.0.0v0.4.1-2-g4a8ccab-dirty0.0.0for non-release builds follows Apple's three-integer format forCFBundleShortVersionStringwhile making sure a development build never presents itself as a release; the fullgit describeoutput stays readable withplutil -pormdls.Makefile:version-preflightrunsgit status --porcelain --untracked-files=allandgit describe --tags --exact-match --match 'v[0-9]*', and bothpackage-preflightandrelease-preflightdepend on it. Ignored build output (dist/,.build/,guest/.work/) does not count as dirty.Scope
.appbuild only. It does not identify which factory image seeded an already-provisioned VM disk; that identity lives in the host-side persistent-diskmetadata.json(bundleIdentity,sourceRootfs.sha256) and is not touched here.guest/spec.json, or guest provenance are changed.Test plan
make teston macOS 26.6.2 (arm64): all suites pass, includingswift testandqemu-persistent-storage.testmake version-preflighton a clean untagged HEAD: rejected withHEAD must carry an exact vX.Y.Z release tagmake version-preflightat a localv9.9.9tag: passesmake version-preflightwith an untracked file present: rejected withthe worktree must be clean before building a signed apppython3at thev9.9.9tag:plutil -lintOK,9.9.9/316/v9.9.9v1foo, and no.gitall produce the values in the table aboveversion-preflightagainst a throwaway repo: non-semver tag rejected, modified tracked file rejected, ignoreddist/and.build/contents acceptedmake appandcodesign --verify --deep --stricton the produced bundle. Not run:make gueston currentmainfails to resolve the factory transaction against Arch Linux ARM (hyprland0.56.2-3 now requireslibaquamarine.so=14, the pinnedaquamarine0.14.0-2 provides.so=13); see the 2026-09-17 comment on [fix] Refresh the factory lock for available ARM packages #192. The plist rewrite was verified standalone with macOSpython3instead.