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
libxpc/libdispatch plan: correct the pre-XPC boundary
This page treated 10.6 as the revert target on the reasoning that XPC shipped
in 10.7. Resolving Apple's distribution-macOS manifest shows components
adopted XPC years after it existed: Libnotify's boundary is 133.1.1 (10.10)
to 149 (10.11), four major releases later. A wholesale 10.6 migration was
never required for an XPC-free notifyd.
Local copy verified as Libnotify-348.100.7 (macOS 26.4) -- a revert would be a
215-version, twelve-year jump.
Records that remove-in-place beats reverting for Libnotify: ~250 lines deleted
versus ~1300 re-derived, keeping the #78 MIG demux and #120 collections fixes,
with every XPC path already inert (entitlements return NULL unconditionally,
the publisher API is no-op macros). Public API is identical across the twelve
years, so the revert is possible but strictly worse.
Also corrects the direction of the mixed-vintage risk: it points at ASL, whose
tree was vendored the same day as its deliberate counterpart, not at launchd.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013FP6vokobmZDdMwpxXgotF
Copy file name to clipboardExpand all lines: nextbsd-libxpc-libdispatch-scoping.html
+25Lines changed: 25 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -164,6 +164,31 @@ <h2>5. What is known about 10.6-era launchd</h2>
164
164
<p><em>Measured:</em> our launchd has <strong>8 files using dispatch and 5 using xpc</strong>, alongside 64 call sites into its own kqueue runtime. It is a hybrid.</p>
165
165
<p><em>Assumed, needs checking:</em> launchd-258 (10.6) used its own <code>launchd_runtime.c</code> kqueue loop and did not use libdispatch — it could not, because libdispatch depends on launchd for bootstrap. If that holds, the dispatch and XPC call sites in our launchd are later additions with a documented pre-existing alternative already present in the tree.</p>
166
166
167
+
<h2>5b. Correction: XPC adoption is far later than XPC’s existence</h2>
168
+
<divclass="callout callout-bad">
169
+
<p><strong>This page repeatedly said “pre-10.7 releases are XPC-free by construction” and treated 10.6 as the revert target. That is true but badly misleading.</strong> XPC shipped in 10.7; individual components adopted it years later. Resolving Apple’s own <code>distribution-macOS</code> manifest gives the real boundary for Libnotify:</p>
170
+
<pre><code>Libnotify 133.1.1 -> OS X 10.10 0 xpc_ lines <- last pre-XPC
171
+
Libnotify 149 -> OS X 10.11 13 xpc_ lines <- first XPC</code></pre>
172
+
<p>So a pre-XPC notifyd is a <strong>10.10</strong> release, not a 10.6 one — four major releases later than assumed. A “wholesale 10.6 migration” was never required to get an XPC-free notifyd.</p>
173
+
</div>
174
+
<p><em>Verified:</em> the local copy is <strong>Libnotify-348.100.7 — macOS 26.4</strong>, imported 2026-05-16 (the <code>VENDORED.md</code> SHA is exactly that upstream tag object, and the working tree is byte-identical to a pristine archive of it). A revert would be a 215-version, twelve-year jump backwards.</p>
175
+
176
+
<h3>Remove in place beats reverting, for Libnotify at least</h3>
177
+
<p>Every XPC reference is peripheral and <strong>already inert</strong>: the entitlement gates route through <code>xpc_copy_entitlement_for_token</code>, which returns NULL unconditionally on FreeBSD, and the event-publisher API is a set of <code>#define … (void)0</code> macros in <code>libxpc/xpc/private.h</code>, so the single handler that could reach <code>NOTIFY_TYPE_XPC_EVENT</code> is never even stored.</p>
178
+
<table>
179
+
<tr><th></th><th>Remove in place</th><th>Revert to 133.1.1</th></tr>
<tr><td>12 years of upstream fixes</td><tdclass="good">Kept</td><tdclass="bad">Discarded, unaudited</td></tr>
186
+
</table>
187
+
<p>The public API is identical across those twelve years — 13 symbols, zero delta — and <code>notify_register_plain</code> (syslogd’s heaviest consumer, 13 call sites) exists in both. So the revert is <em>possible</em>; it is simply strictly worse. If the <code>os_set</code> shim is itself the burden, 133.1.1’s self-contained <code>table.c</code> can be lifted on its own — a much smaller change than reverting the component.</p>
188
+
<divclass="callout callout-warn">
189
+
<p><strong>The mixed-vintage risk points at ASL, not launchd.</strong> The syslog tree was vendored the same day as Libnotify and is its deliberate macOS 26-era counterpart. Pairing a 2026 syslogd with a 2014 notifyd would invert the one vintage pairing in this tree that is currently correct — and syslogd is libnotify’s heaviest consumer, so a mismatch would most likely show up as a silent performance cliff rather than a build break.</p>
190
+
</div>
191
+
167
192
<h2>6. The plan: one PR, both libraries out, userland builds and runs</h2>
168
193
<pclass="lede">Scope as stated: remove libxpc and libdispatch together, fix every component enough to build and run functionally (tests excluded), then chase individual services afterwards only if something non-trivial breaks. Reverting components is a fallback, not the method.</p>
0 commit comments