#`zig libc` results in panic on Ventura / Apple M2

1 messages · Page 1 of 1 (latest)

little beacon
#

Specifically:

% zig libc
thread 118610 panic: Darwin is handled separately via std.zig.system.darwin module
Unable to dump stack trace: debug info stripped
zsh: abort      zig libc

My zig env:

{
 "zig_exe": "/Users/jake/.local/bin/zig/zig",
 "lib_dir": "/Users/jake/.local/bin/zig/lib",
 "std_dir": "/Users/jake/.local/bin/zig/lib/std",
 "global_cache_dir": "/Users/jake/.cache/zig",
 "version": "0.11.0-dev.2191+30427ff79",
 "target": "aarch64-macos.13.2.1...13.2.1-none"
}

I've opened https://github.com/ziglang/zig/issues/15024. In the meantime, I'm wondering if this is a known issue, whether there are workarounds, etc. Or perhaps something is just weird about my environment?

GitHub

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software. - Issues · ziglang/zig

bitter quarry
#

Are you concerned with the panic or the fact that zig libc doesn't work on macOS? The latter is expected because as of Big Sur, libc/libSystem isn't on disk anymore.
But from a UX point of view, zig libc should exit 1 and not panic, I'm guessing.

night tinsel
#

We hit this as well: https://github.com/tigerbeetledb/tigerbeetle/issues/451 passing anything that's not native to the OS portion of the target (i.e. -target native-macos) seems to work for stuff like zig build-exe but zig libc seems like it only runs if the target is completely native which is unfortunate

little beacon
#

the latter is expected because as of Big Sur, libc/libSystem isn't on disk anymore.
Ah! This is what I hadn't understood. How do you stay on top of limitations like this? I haven't been able to find it documented anywhere.

#

Also does this limitation mean that you can't currently compile zig code that depends on libc on macos?

bitter quarry
#

How do you stay on top of limitations like this?

In this case, by coincidence 🙂
I recently started doing some development on macOS again and ran into this a couple days ago. I found one Apple forums post that pointed to some release notes (I can look for that later)