Skip to content

fix: an optimized test build links on macOS - #390

Merged
sepehr-safari merged 1 commit into
mainfrom
tests-link-in-releasefast-on-macos
Sep 25, 2026
Merged

sepehr-safari merged 1 commit into
mainfrom
tests-link-in-releasefast-on-macos

Conversation

@sepehr-safari

Copy link
Copy Markdown
Contributor

Closes #389

  • main.zig references native_sdk.updater.c_api.native_sdk_update_verify_feed and ..._archive in a macOS-only comptime block, so they are exported in every binary built from the app module. In the app they were already exported through the platform module; the reference is the same symbol, not a second one.
  • CI's macOS app job runs zig build test -Doptimize=ReleaseFast after native test.

Verified on macOS: on main, zig build test -Doptimize=ReleaseFast fails to link (the test binary and plaza-model-contract); with this change it passes, Debug still passes, and the ReleaseFast app still builds with both symbols exported once.

The cause is in the toolkit's build wiring rather than here; this makes Plaza's own builds whole in the meantime.

The toolkit compiles its macOS host into every binary built from the app module, including the test binary and the model-contract tool. The host calls two functions the toolkit exports from Zig, native_sdk_update_verify_feed and native_sdk_update_verify_archive, but only its macOS platform module references them, and only the app's run path reaches that module. A Debug link dropped the unused host object; a ReleaseFast one kept it and failed with both symbols undefined. main.zig now references them on macOS, so they are exported wherever the module is built.

CI's macOS job now runs the suite in ReleaseFast as well, the mode the app ships in, which is the check that would have caught this.
@sepehr-safari
sepehr-safari merged commit d219bea into main Sep 25, 2026
6 checks passed
@sepehr-safari
sepehr-safari deleted the tests-link-in-releasefast-on-macos branch September 25, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An optimized test build cannot link on macOS

1 participant