also looking at this
fix(build): three test artifacts reach Carbon and none of them linked it
#139
1 file
+23
-0
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -342,6 +342,13 @@ pub fn build(b: *std.Build) void { | ||
| 342 | 342 | // The storage module is Keychain: SecItemAdd and the kSec* constants |
| 343 | 343 | // live in Security.framework. |
| 344 | 344 | ios_surface_tests.root_module.linkFramework("Security", .{}); |
| 345 | // And Carbon, for the same reason as the paragraph above rather than a | |
| 346 | // new one: the desktop arm this drags in reaches `bridge_shortcuts.zig`, | |
| 347 | // which imports `macos_hotkey.zig` and its `RegisterEventHotKey` | |
| 348 | // externs. Nothing in the iOS surface names a hotkey — the dependency | |
| 349 | // arrives through the reply path, which is precisely the code this gate | |
| 350 | // exists to compile. | |
| 351 | ios_surface_tests.root_module.linkFramework("Carbon", .{}); | |
| 345 | 352 | ios_surface_tests.root_module.addCSourceFile(.{ |
| 346 | 353 | .file = b.path("vendor/sqlite/sqlite3.c"), |
| 347 | 354 | .flags = &.{ "-DSQLITE_THREADSAFE=1", "-DSQLITE_ENABLE_FTS5", "-DSQLITE_ENABLE_JSON1" }, |
| @@ -1353,6 +1360,14 @@ pub fn build(b: *std.Build) void { | ||
| 1353 | 1360 | system_tray_tests.root_module.linkFramework("Cocoa", .{}); |
| 1354 | 1361 | system_tray_tests.root_module.linkFramework("WebKit", .{}); |
| 1355 | 1362 | system_tray_tests.root_module.linkFramework("CoreMIDI", .{}); |
| 1363 | // Carbon, because `tray.zig` reaches it: tray.zig imports | |
| 1364 | // macos.zig, which imports bridge_shortcuts.zig, which imports | |
| 1365 | // macos_hotkey.zig and its `RegisterEventHotKey` externs. Nothing | |
| 1366 | // in tray.zig names a hotkey, so the dependency is four files away | |
| 1367 | // and invisible from here — which is how both of these artifacts | |
| 1368 | // came to list Cocoa, WebKit and CoreMIDI by hand and miss the one | |
| 1369 | // framework they actually could not link without. | |
| 1370 | system_tray_tests.root_module.linkFramework("Carbon", .{}); | |
| 1356 | 1371 | applySdkPaths(b, system_tray_tests.root_module, macos_sdk); |
| 1357 | 1372 | }, |
| 1358 | 1373 | .linux => { |
| @@ -1378,6 +1393,14 @@ pub fn build(b: *std.Build) void { | ||
| 1378 | 1393 | system_tray_benchmark.root_module.linkFramework("Cocoa", .{}); |
| 1379 | 1394 | system_tray_benchmark.root_module.linkFramework("WebKit", .{}); |
| 1380 | 1395 | system_tray_benchmark.root_module.linkFramework("CoreMIDI", .{}); |
| 1396 | // Carbon, because `tray.zig` reaches it: tray.zig imports | |
| 1397 | // macos.zig, which imports bridge_shortcuts.zig, which imports | |
| 1398 | // macos_hotkey.zig and its `RegisterEventHotKey` externs. Nothing | |
| 1399 | // in tray.zig names a hotkey, so the dependency is four files away | |
| 1400 | // and invisible from here — which is how both of these artifacts | |
| 1401 | // came to list Cocoa, WebKit and CoreMIDI by hand and miss the one | |
| 1402 | // framework they actually could not link without. | |
| 1403 | system_tray_benchmark.root_module.linkFramework("Carbon", .{}); | |
| 1381 | 1404 | applySdkPaths(b, system_tray_benchmark.root_module, macos_sdk); |
| 1382 | 1405 | }, |
| 1383 | 1406 | .linux => { |