[PR #5484] [MERGED] Keep macOS app bundles alive during launcher updates #6316

Closed
opened 2026-11-03 06:18:09 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5484
Author: @guilhermejansen
Created: 10/31/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/macos-updater-keychain


📝 Commits (2)

  • 4f1ffce fix(launcher): preserve running macOS app bundles during updates
  • c539244 Merge main into #5484

📊 Changes

10 files changed (+882 additions, -61 deletions)

View changed files

📝 launcher/Cargo.lock (+1 -0)
📝 launcher/Cargo.toml (+2 -0)
📝 launcher/src/account.rs (+19 -0)
📝 launcher/src/account/tests.rs (+36 -0)
📝 launcher/src/backend.rs (+9 -61)
📝 launcher/src/lib.rs (+2 -0)
➕ launcher/src/mac_update.rs (+168 -0)
➕ launcher/src/mac_update/tests.rs (+356 -0)
📝 launcher/src/main.rs (+1 -0)
➕ tools/test_launcher_macos_update.py (+288 -0)

📄 Description

The macOS updater removed the old app bundle while its launcher process was still running. Signing in with Microsoft could then fail when Keychain tried to create a credential, returning OSStatus 100002 (UNIX[No such file or directory]).

Keep retired bundles until no process uses their executable, including other launcher windows and MCP processes. Cleanup leaves ambiguous results alone. Rollback backups stay outside the cleanup namespace until final signature verification succeeds. Already affected launchers get a message to restart and sign in again.

Fixes #5427.

Regression coverage includes repeated updates, multiple processes, cross-process Keychain reads, same-PID restart, signature rejection, and cleanup during rollback. The rollback regression fails against the previous implementation and passes with this fix.

Kind

  • bug: a crash or a breakage

Vanilla reference

Horizon-only launcher behavior.

Other projects' code

Read for diagnosis and build setup; no external code was copied or adapted:

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on MacBook-M5-Pro, against upstream/main at 9658ee1fe, 1 min 36 s)

Check Result
Scope ⚠️ 10 files, +882 −61; 655 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ changes with a Cargo.toml
Public tree ✅
Python tests ✅ 508 passed (27 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
Rust ⚠️ 1.97.1 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with rustup update
launcher clippy ✅ (58 s)
launcher tests ✅ 348 passed (10 s)
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Also passed python3 tools/test_launcher_macos_update.py --run --keychain (7 tests plus the native regression) and cargo build --manifest-path launcher/Cargo.toml --locked --features gpui/runtime_shaders --bin horizon-launcher.

The Python summary includes one skipped test; the launcher suite has five ignored tests. Checks used isolated homes and gpui/runtime_shaders. No OAuth flow was run.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/5484 **Author:** [@guilhermejansen](https://github.com/guilhermejansen) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/macos-updater-keychain` --- ### 📝 Commits (2) - [`4f1ffce`](https://github.com/horizon-rust/horizon/commit/4f1ffce47dfd3986c337c32edbf257dbefc8a693) fix(launcher): preserve running macOS app bundles during updates - [`c539244`](https://github.com/horizon-rust/horizon/commit/c539244947703727439701c28efb9b6a0c0faed9) Merge main into #5484 ### 📊 Changes **10 files changed** (+882 additions, -61 deletions) <details> <summary>View changed files</summary> 📝 `launcher/Cargo.lock` (+1 -0) 📝 `launcher/Cargo.toml` (+2 -0) 📝 `launcher/src/account.rs` (+19 -0) 📝 `launcher/src/account/tests.rs` (+36 -0) 📝 `launcher/src/backend.rs` (+9 -61) 📝 `launcher/src/lib.rs` (+2 -0) ➕ `launcher/src/mac_update.rs` (+168 -0) ➕ `launcher/src/mac_update/tests.rs` (+356 -0) 📝 `launcher/src/main.rs` (+1 -0) ➕ `tools/test_launcher_macos_update.py` (+288 -0) </details> ### 📄 Description The macOS updater removed the old app bundle while its launcher process was still running. Signing in with Microsoft could then fail when Keychain tried to create a credential, returning OSStatus 100002 (`UNIX[No such file or directory]`). Keep retired bundles until no process uses their executable, including other launcher windows and MCP processes. Cleanup leaves ambiguous results alone. Rollback backups stay outside the cleanup namespace until final signature verification succeeds. Already affected launchers get a message to restart and sign in again. Fixes #5427. Regression coverage includes repeated updates, multiple processes, cross-process Keychain reads, same-PID restart, signature rejection, and cleanup during rollback. The rollback regression fails against the previous implementation and passes with this fix. ## Kind - [x] bug: a crash or a breakage ## Vanilla reference Horizon-only launcher behavior. ## Other projects' code Read for diagnosis and build setup; no external code was copied or adapted: - [keyring-rs at 315cbdf6](https://github.com/hwchen/keyring-rs/tree/315cbdf6c6a9153d8c9f88b56568f29862d3e39d), MIT OR Apache-2.0: the macOS backend. - [rust-security-framework at 5f6e6511](https://github.com/kornelski/rust-security-framework/tree/5f6e65114b77d5bc161d2b099cad09f2a67609d2), MIT OR Apache-2.0: Keychain calls and OSStatus error handling. - [GPUI 0.2.2 build.rs](https://docs.rs/crate/gpui/0.2.2/source/build.rs), Apache-2.0: the runtime-shader fallback. The published crate records [69e21302](https://github.com/zed-industries/zed/tree/69e2130295c2649963eb639fc70b4f2ee8ea1624) as its VCS base with a dirty tree. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on MacBook-M5-Pro, against upstream/main at 9658ee1fe, 1 min 36 s) | Check | Result | | --- | --- | | Scope | ⚠️ 10 files, +882 −61; 655 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ changes with a Cargo.toml | | Public tree | ✅ | | Python tests | ✅ 508 passed (27 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | Rust | ⚠️ 1.97.1 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with `rustup update` | | launcher clippy | ✅ (58 s) | | launcher tests | ✅ 348 passed (10 s) | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Also passed `python3 tools/test_launcher_macos_update.py --run --keychain` (7 tests plus the native regression) and `cargo build --manifest-path launcher/Cargo.toml --locked --features gpui/runtime_shaders --bin horizon-launcher`. The Python summary includes one skipped test; the launcher suite has five ignored tests. Checks used isolated homes and `gpui/runtime_shaders`. No OAuth flow was run. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:18:09 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6316
No description provided.