Repository navigation
Fix NIGHTLY update bundle icon metadata #4353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
0a11b06
test: cover app bundle icon persistence policy
austinywang d1e98aa
fix: keep nightly bundle icon metadata authoritative
austinywang fd634fd
fix: require stable app identity for icon persistence
austinywang 3e2cdf7
fix: share app bundle icon persistence policy
austinywang 69c6208
fix: share smoke icon persistence state
austinywang f3af2f7
test: assert icon persistence defaults presence
austinywang 79dab88
test: cover settings store startup side effects
austinywang aacef14
fix: suppress live settings side effects during startup import
austinywang c73918e
Merge branch 'main' of https://github.com/manaflow-ai/cmux into issue…
austinywang f764036
test: make CLI socket probe harness concurrent
austinywang 5d95a65
fix: respect quit warning in tagged dev builds
austinywang 9977af9
Merge remote-tracking branch 'origin/main' into issue-4350-nightly-up…
austinywang aaec9d5
fix: replay deferred settings side effects
austinywang 28b29b6
fix: order deferred settings side effects
austinywang 5e4418a
fix: initialize icon persistence flag before side effects
austinywang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import Foundation | ||
|
|
||
| enum AppBundleIconPersistencePolicy { | ||
| private static let stableReleaseBundleIdentifier = "com.cmuxterm.app" | ||
| private static let stableReleaseAppBundleName = "cmux.app" | ||
| static let disablePersistenceArgument = "--cmux-disable-bundle-icon-persistence" | ||
|
|
||
| static func shouldPersist( | ||
| bundleIdentifier: String?, | ||
| appBundleLastPathComponent: String?, | ||
| launchArguments: [String] = ProcessInfo.processInfo.arguments | ||
| ) -> Bool { | ||
| guard !launchArguments.contains(disablePersistenceArgument) else { | ||
| return false | ||
| } | ||
|
|
||
| // Channel variants own their identity through build-time bundle metadata. | ||
| // Persisted Finder icons would override that metadata and can leak into | ||
| // packaged artifacts after CI smoke launches the app bundle. | ||
| return bundleIdentifier == stableReleaseBundleIdentifier | ||
| && appBundleLastPathComponent == stableReleaseAppBundleName | ||
| } | ||
| } |
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| usage() { | ||
| cat <<'EOF' | ||
| usage: verify-app-bundle-channel-metadata.sh <app-path> <stable|nightly> | ||
|
|
||
| Verifies the built app bundle metadata that LaunchServices and Sparkle use for | ||
| system prompts. This intentionally checks the final bundle artifact, not the | ||
| checked-in plist template. | ||
| EOF | ||
| } | ||
|
|
||
| if [[ $# -ne 2 ]]; then | ||
| usage >&2 | ||
| exit 2 | ||
| fi | ||
|
|
||
| APP_PATH="$1" | ||
| CHANNEL="$2" | ||
| INFO_PLIST="$APP_PATH/Contents/Info.plist" | ||
|
|
||
| if [[ ! -d "$APP_PATH/Contents" ]]; then | ||
| echo "error: app bundle not found at $APP_PATH" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ ! -f "$INFO_PLIST" ]]; then | ||
| echo "error: Info.plist not found at $INFO_PLIST" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| case "$CHANNEL" in | ||
| stable) | ||
| EXPECTED_NAME="cmux" | ||
| EXPECTED_BUNDLE_ID="com.cmuxterm.app" | ||
| EXPECTED_ICON_NAME="AppIcon" | ||
| ;; | ||
| nightly) | ||
| EXPECTED_NAME="cmux NIGHTLY" | ||
| EXPECTED_BUNDLE_ID="com.cmuxterm.app.nightly" | ||
| EXPECTED_ICON_NAME="AppIcon-Nightly" | ||
| ;; | ||
| *) | ||
| usage >&2 | ||
| exit 2 | ||
| ;; | ||
| esac | ||
|
|
||
| plist_value() { | ||
| /usr/libexec/PlistBuddy -c "Print :$1" "$INFO_PLIST" | ||
| } | ||
|
|
||
| expect_plist_value() { | ||
| local key="$1" | ||
| local expected="$2" | ||
| local actual | ||
| actual="$(plist_value "$key" 2>/dev/null || true)" | ||
| if [[ "$actual" != "$expected" ]]; then | ||
| echo "error: $key expected '$expected', found '${actual:-<missing>}'" >&2 | ||
| exit 1 | ||
| fi | ||
| } | ||
|
|
||
| expect_plist_value CFBundleName "$EXPECTED_NAME" | ||
| expect_plist_value CFBundleDisplayName "$EXPECTED_NAME" | ||
| expect_plist_value CFBundleIdentifier "$EXPECTED_BUNDLE_ID" | ||
| expect_plist_value CFBundleIconFile "$EXPECTED_ICON_NAME" | ||
| expect_plist_value CFBundleIconName "$EXPECTED_ICON_NAME" | ||
|
|
||
| ICON_PATH="$APP_PATH/Contents/Resources/${EXPECTED_ICON_NAME}.icns" | ||
| if [[ ! -s "$ICON_PATH" ]]; then | ||
| echo "error: expected icon file missing or empty at $ICON_PATH" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| CUSTOM_ICON_PATH="$APP_PATH/Icon"$'\r' | ||
| if [[ -e "$CUSTOM_ICON_PATH" ]]; then | ||
| echo "error: app bundle contains Finder custom icon file: $CUSTOM_ICON_PATH" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if xattr -p com.apple.FinderInfo "$APP_PATH" >/dev/null 2>&1; then | ||
| echo "error: app bundle has com.apple.FinderInfo; packaged apps must use Info.plist icon metadata" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ -d "$APP_PATH/Contents/_CodeSignature" ]]; then | ||
| codesign --verify --deep --strict --verbose=2 "$APP_PATH" | ||
| fi | ||
|
|
||
| echo "verified $CHANNEL app bundle metadata: $APP_PATH" |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.