Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packaging/macos/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.2.0</string>
<string>3.6.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>3.6.0</string>
<key>LSMinimumSystemVersion</key>
<string>13.0</string>
<key>NSHumanReadableCopyright</key>
Expand Down
5 changes: 5 additions & 0 deletions packaging/macos/build_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ APP_VERSION="$(tr -d '[:space:]' < "$REPO/VERSION" 2>/dev/null || true)"
if [ -n "$APP_VERSION" ] && command -v plutil >/dev/null 2>&1; then
plutil -replace CFBundleShortVersionString -string "$APP_VERSION" "$CONTENTS/Info.plist"
echo "==> bundle CFBundleShortVersionString = $APP_VERSION (from VERSION)"
# Sparkle decides "is this newer?" from CFBundleVersion (the appcast's sparkle:version),
# not the short string. It stayed "1" on every build, so no installed copy was ever
# offered an update. Use the same version.
plutil -replace CFBundleVersion -string "$APP_VERSION" "$CONTENTS/Info.plist"
echo "==> bundle CFBundleVersion = $APP_VERSION (from VERSION)"
fi
printf 'APPL????' > "$CONTENTS/PkgInfo"

Expand Down
17 changes: 17 additions & 0 deletions tests/test_app_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,20 @@ def test_build_assembles_bundle_and_selftest_passes():
capture_output=True, text=True, timeout=60,
)
assert st.returncode == 0, f"--selftest failed: {st.stderr}\n{st.stdout}"


def test_the_bundle_carries_the_release_version_as_its_build_number():
# Sparkle offers an update only when the appcast's sparkle:version (CFBundleVersion) is
# higher than the installed one. It stayed "1" on every build, so no installed copy was
# ever offered an update. Both version keys now come from VERSION.
import plistlib
version = (REPO / "VERSION").read_text(encoding="utf-8").strip()
static = plistlib.loads((PKG / "Info.plist").read_bytes())
assert static["CFBundleVersion"] == static["CFBundleShortVersionString"] == version, "static plist matches VERSION"
if sys.platform != "darwin":
return # the build itself needs macOS (Swift/AppKit launcher, plutil)
with tempfile.TemporaryDirectory() as td:
r = subprocess.run(["bash", str(BUILD), "--out", td, "--clean"], capture_output=True, text=True, timeout=120)
assert r.returncode == 0, r.stderr
built = plistlib.loads((Path(td) / "Sovereign AI Workstation.app" / "Contents" / "Info.plist").read_bytes())
assert built["CFBundleVersion"] == built["CFBundleShortVersionString"] == version
Loading