!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

1163 Members
“There are still many issues with the Darwin platform but most of it is quite usable.” — http://yves.gnu-darwin.org188 Servers

Load older messages


SenderMessageTime
24 Oct 2025
@reckenrode:matrix.orgRandy EckenrodeWe shouldn’t be hacking up xnu headers. We should actually be building them because that sucks a lot less than what we are currently doing.01:53:35
@emilazy:matrix.orgemilydefine "actually building them"?01:54:17
@emilazy:matrix.orgemilyI don't think we can avoid modifying them in some way01:54:36
@reckenrode:matrix.orgRandy EckenrodeThe xnu makefiles have a target for building the headers.01:54:37
@emilazy:matrix.orgemilyfundamentally we are not actually running our own XNU at runtime01:54:46
@reckenrode:matrix.orgRandy EckenrodeThe old source releases used to do it, but they made a mess pf the result.01:55:06
@reckenrode:matrix.orgRandy Eckenrode * 01:55:13
@emilazy:matrix.orgemily my point is that the xnu headers we use have a fundamentally different expectation for SPI_* than the source releases we build 01:55:27
@emilazy:matrix.orgemilybecause of the two existing in different contexts01:55:33
@emilazy:matrix.orgemilyif we make it expand to a real availability annotation in one, it's wrong for the other01:55:48
@reckenrode:matrix.orgRandy EckenrodeWe would use the SDK’s stubs, which means we want functioning checks for private symbols.01:56:13
@emilazy:matrix.orgemilyright01:56:26
@emilazy:matrix.orgemilybut only for XNU headers because we are not building our own XNU01:56:34
@emilazy:matrix.orgemilynot for anything else we actually build01:56:40
@emilazy:matrix.orgemilydespite those things sometimes using XNU headers01:56:47
@emilazy:matrix.orgemilygiven the divergence here, there's no way out of patching the XNU headers, because you want two different meanings for the same expression in different contexts01:57:02
@emilazy:matrix.orgemilyApple doesn't do what we do, so they don't run into the inconsistency01:57:20
@reckenrode:matrix.orgRandy EckenrodeWe would in fact want those to have functioning checks too because they are using private APIs that may not be available on our deployment target.01:57:44
@emilazy:matrix.orgemily"those" as in the source releases we build?01:58:14
@emilazy:matrix.orgemilydid you look at the examples I linked? :(01:58:29
@emilazy:matrix.orgemily it's stuff defining those symbols 01:58:37
@reckenrode:matrix.orgRandy EckenrodeYes. I had to add an availability check to one of the releases.01:58:38
@emilazy:matrix.orgemilythat's different01:58:50
@emilazy:matrix.orgemily that's an API_* check 01:58:54
@emilazy:matrix.orgemilyand not something in a source release defining its own symbol01:59:01
@reckenrode:matrix.orgRandy EckenrodeIIRC we don’t install the private headers for libpcap or libffi. How the symbols are defined for them doesn’t matter.01:59:51
@reckenrode:matrix.orgRandy EckenrodeIf we do, then we should strip out the checks. I do agree with that.02:00:28
@emilazy:matrix.orgemily dyld is a much more relevant example 02:01:26
@reckenrode:matrix.orgRandy Eckenrode How? It doesn’t install any headers. The only dylib it installs is libdsc_extractor.dylib, which doesn’t have any public API. 02:02:42
@emilazy:matrix.orgemily
    substituteInPlace include/mach-o/utils_priv.h \
      --replace-fail 'SPI_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0))' ""

we do this. if we did not do this, it would start failing to build due to availability errors

02:03:39

Show newer messages


Back to Room ListRoom Version: 6