You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: conform CFBundleVersion to documentation (#167)
Second PR for #47.
Previously, we were setting [`CFBundleVersion`](https://developer.apple.com/documentation/bundleresources/information-property-list/cfbundleversion) to the output of `git describe --tags` (`vX.Y.Z` or `vX.Y.Z-N-gHASH` for preview builds).
To support Sparkle, and potentially to avoid a breakage with macOS failing to update an installed `LaunchDaemon` when it can't parse `CFBundleVersion`, we'll conform the string to the specification.
Given that:
> You can include more integers but the system ignores them.
We set `CFBundleVersion` to a value of the form `X.Y.Z[.N]` where N is the number of commits since the `X.Y.Z` tag (omitted if 0)
Sparkle did previously allow you to supply a manual version comparator, but it was deprecated to help require `CFBundleVersion` start with `X.Y.Z` sparkle-project/Sparkle#2585
That issue recommends instead putting marketing version information in `CFBundleShortVersionString`, but that actually has even stricter requirements: https://developer.apple.com/documentation/bundleresources/information-property-list/cfbundleshortversionstring
Though not documented, from testing & reading the [Sparkle source](https://github.com/sparkle-project/Sparkle/blob/2.x/Sparkle/SUStandardVersionComparator.m), I discovered that `X.Y.Z.N+1` will be deemed a later version than `X.Y.Z.N`, which is what we'll do for the preview stream of auto-updates.
For non-preview builds (i.e. builds on a tag), both version strings will be `X.Y.Z`.
Since we're no longer including the commit hash in a version string, we instead embed it separately in the `Info.plist` so we can continue to display it in the UI:
<img width="284" alt="image" src="https://github.com/user-attachments/assets/a9b2359d-6e2f-4f7d-979c-ba69ee01e69c" />
0 commit comments