mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
fix: remove vestigial MachServices from ShipIt launchd job (#51111)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
This commit is contained in:
@@ -12,3 +12,4 @@ use_uttype_class_instead_of_deprecated_uttypeconformsto.patch
|
||||
fix_clean_up_orphaned_staged_updates_before_downloading_new_update.patch
|
||||
fix_add_explicit_json_property_mappings_for_shipit_request_model.patch
|
||||
fix_resolve_target_bundle_path_once_at_start_of_install.patch
|
||||
fix_remove_vestigial_machservices_from_shipit_launchd_job.patch
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Keeley Hammond <vertedinde@electronjs.org>
|
||||
Date: Tue, 14 Apr 2026 10:00:00 -0700
|
||||
Subject: fix: remove vestigial MachServices from ShipIt launchd job
|
||||
|
||||
The MachServices key in the ShipIt launchd job dictionary is a leftover
|
||||
from when ShipIt was an XPC service (removed in Squirrel/Squirrel.Mac@d6ca1c2
|
||||
":fire: XPC :fire:" in October 2013). Since then, nothing connects to
|
||||
the registered Mach port.
|
||||
|
||||
When a macOS system update is pending, launchd puts the user domain into
|
||||
"on-demand-only mode", where only jobs with an on-demand trigger (like a
|
||||
MachServices connection) are started. Since nothing connects to ShipIt's
|
||||
Mach port, launchd pends the spawn indefinitely with:
|
||||
|
||||
"pending spawn, domain in on-demand-only mode"
|
||||
|
||||
This prevents ShipIt from running, causing Electron auto-updates to fail
|
||||
whenever a macOS update is staged. By the time the domain exits
|
||||
on-demand-only mode (after reboot/update completion), the staged update
|
||||
bundle is often stale, leading to "Too many attempts to install" errors.
|
||||
|
||||
Removing the MachServices key eliminates the on-demand trigger, so
|
||||
launchd falls back to evaluating KeepAlive.SuccessfulExit which
|
||||
correctly starts ShipIt immediately on submission.
|
||||
|
||||
Also removes the stale "service name" comment on the jobLabel argument,
|
||||
since ShipIt is no longer a Mach service.
|
||||
|
||||
diff --git a/Squirrel/SQRLShipItLauncher.m b/Squirrel/SQRLShipItLauncher.m
|
||||
index 6a9151d92f399184fff9854eb00ea506165bbbe2..0ebd2a23d62424c41e15413edeab360bef87ecc4 100644
|
||||
--- a/Squirrel/SQRLShipItLauncher.m
|
||||
+++ b/Squirrel/SQRLShipItLauncher.m
|
||||
@@ -50,14 +50,10 @@ + (RACSignal *)shipItJobDictionary {
|
||||
@(LAUNCH_JOBKEY_KEEPALIVE_SUCCESSFULEXIT): @NO
|
||||
};
|
||||
|
||||
- jobDict[@(LAUNCH_JOBKEY_MACHSERVICES)] = @{
|
||||
- jobLabel: @YES
|
||||
- };
|
||||
-
|
||||
NSMutableArray *arguments = [[NSMutableArray alloc] init];
|
||||
[arguments addObject:[squirrelBundle URLForResource:@"ShipIt" withExtension:nil].path];
|
||||
|
||||
- // Pass in the service name so ShipIt knows how to broadcast itself.
|
||||
+ // Pass in the job label so ShipIt can identify itself.
|
||||
[arguments addObject:jobLabel];
|
||||
|
||||
// We need to pass the path to ShipIt rather than having ShipIt
|
||||
Reference in New Issue
Block a user