Skip to content

fixup: Macos sysroot crosscompiling - #35

Merged
ypsvlq merged 6 commits into
ypsvlq:masterfrom
nat3Github:macos-sysroot-crosscompile
Sep 6, 2026
Merged

ypsvlq merged 6 commits into
ypsvlq:masterfrom
nat3Github:macos-sysroot-crosscompile

Conversation

@nat3Github

Copy link
Copy Markdown
Contributor

can you check if this solves the issues with --sysroot?
regarding discussion in #33

nat3Github and others added 4 commits September 5, 2026 01:44
Adds framework/include search paths from --sysroot; library path is
left to Zig's own sysroot-relative lookup (usr/lib), since passing it
explicitly caused Zig to double-join the sysroot path.

Adds a Linux CI job that downloads the wio-macos-sdk and cross-builds
demo/framebuffer/vulkan for aarch64-macos with --sysroot, to verify
this on an actual non-macOS host.
…sysroot

Previously this surfaced as a confusing linker error ('unable to find
framework Cocoa. searched paths: none') with no pointer to the fix.
Add a CI step that verifies this error path on a real Linux runner.
examples/metal has its own build.zig with its own Objective-C source
(metal.m), so the top-level build.zig fix didn't cover it. Cross-compiling
it with --sysroot previously failed on missing Security/AppKit headers.

Also build it in the Linux sysroot-cross-compile CI job.

@ypsvlq ypsvlq left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general, thanks for the fix.

Comment thread .github/workflows/ci.yml Outdated
uses: mlugg/setup-zig@v2
- name: Download macOS SDK
run: |
curl -sL https://github.com/ypsvlq/wio-macos-sdk/archive/1014fff9b544bf80200a2a9a92af257451286913.tar.gz | tar xz

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you pointed out in #33, it's probably not acceptable to redistribute the SDK.

For now the patch is shown to work, so its okay to remove this and I'll add native sysroot testing in CI later.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are correct, the difference is this never hits User caches, only CI machines which I am way more comfortable with. but ultimately its your repo and so it's your call.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure it's preferable to that but I think ideally there isn't any license violations in the repo.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(so yes, I would like it removed)

Comment thread build.zig Outdated
Comment thread examples/metal/build.zig Outdated
@nat3Github
nat3Github requested a review from ypsvlq September 5, 2026 14:47
@nat3Github

Copy link
Copy Markdown
Contributor Author

please pull in the build.zig sysroot fixes to unblock cross compiling linux-to-mac.
you are welcome to close this PR or make changes how you see them fit.
(I am a bit frustrated by the communication)

@ypsvlq

ypsvlq commented Sep 6, 2026

Copy link
Copy Markdown
Owner

please pull in the build.zig sysroot fixes to unblock cross compiling linux-to-mac.

Please remove the legally problematic CI change as requested in the review.

(I am a bit frustrated by the communication)

I'm sorry, is there something I can do to be less frustrating?

@nat3Github
nat3Github force-pushed the macos-sysroot-crosscompile branch from b9ed28b to 263760b Compare September 6, 2026 21:57
@nat3Github
nat3Github force-pushed the macos-sysroot-crosscompile branch from 263760b to 962554b Compare September 6, 2026 22:01
@ypsvlq
ypsvlq merged commit 07d27d1 into ypsvlq:master Sep 6, 2026
10 checks passed
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.

2 participants