!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

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

Load older messages


SenderMessageTime
11 Apr 2026
@reckenrode:matrix.orgRandy EckenrodeSo is the recommended path to rebuild the dylib from the raw object files, copying what Apple does?18:55:31
@reckenrode:matrix.orgRandy Eckenrode dlopen bypasses two-level namespaces. I ran into that with a GStreamer plugin (and ended up finding and fixing a 20 year old bug in Glib). 18:58:18
@andreacfromtheapp:matrix.orgAndrea C joined the room.19:06:43
@emilazy:matrix.orgemily

bypassed in what way? the symbols here don't have a namespace involved (because they're defined, just weekly), and dlsym with a specific library looks symbols up in that library. I think the global namespace only gets used for the weird weak symbol deduplication case or if you explicitly ask for it.

I think using darwin.ICU like a normal ICU doesn't make much sense, since Apple specifically don't export the non-monolithic version at all - so consumers that expect Apple patches and consumers that expect to consume it as separate libraries are disjoint.

(do we actually know that .NET wants the Apple patches? I vaguely recall we saw it default or something without in the past - but that is quite plausibly due to the very same weak symbol issue we're running into now.)

I'm guessing that making a monolithic .dylib might work around what we're seeing here. it seemed like there might be other divergences in his Apple builds their ICU to what we're doing too. though ultimately they have the same weak symbols of course, which is what's causing the problem here - it's just like the weak C++ symbols that were causing a problem on the old SDK in the past 🙃

but I would probably check if U_I18N_API on the explicit instantiations and -no_weak_exports to the linker to guard against it works first, because if it does that's probably upstreamable to ICU, and it seems like we really want -no_weak_exports for everything that has symbols that are also in the dyld cache, because otherwise nothing stops things like this happening, C++ or not. C++ might be the most common way to "accidentally" get weak symbols but it's definitely not the only time they'd come up. (admittedly weak exports are a weird case and I don't fully understand yet how they don't mess up two-level namespaces in general.)

it would be nice if we could tell ICU to just hide all the C++ API but aim not sure that's a knob their build system supports.

still thinking about what other more robust options we might have

19:33:22
@emilazy:matrix.orgemilymy feeling is that the lack of that export on the template instantiation is just an ICU bug19:35:36
@emilazy:matrix.orgemilypresumably because explicit template instantiations are weird abs nobody thought about it19:35:55
@emilazy:matrix.orgemilyI'm not 100% confident it'd get rid of the weak export but it's trivial to check since the linker can bail out on it without having to compile .NET or anything19:36:47
@emilazy:matrix.orgemilythat said it would be nice to not have to be afraid of Apple screwing things up for us with clashing symbols, incl. C ones, in the presence of weak stuff. so I'm still figuring out if my understanding of weak exports is fully accurate and if there's a better way19:37:56
@emilazy:matrix.orgemily my suspicion is the explicit instantiation with no visibility annotation + -fvisibility=hidden -> weak export and with the correct visibility used for all other C++ defns it'd become strong and never get resolved elsewhere 19:39:54
@emilazy:matrix.orgemilyper usual two-level namespace rules19:40:10
@emilazy:matrix.orgemilyhttps://github.com/llvm/llvm-project/blob/0c0ae3786ef4ec04ba0dc9cdd565b68ec486498a/lld/MachO/InputFiles.cpp#L681 makes me wonder if this would even happen with LLD...19:54:41
@emilazy:matrix.orgemilybtw, it looks to me like .NET will handle the versioned symbols just fine fwiw https://github.com/dotnet/dotnet/blob/36afe73557f5f93cd7bc827cb644a3ff018eca0b/src/runtime/src/native/libs/System.Globalization.Native/pal_icushim.c#L60-L6120:26:32
@emilazy:matrix.orgemilyah, actually no20:27:32
@emilazy:matrix.orgemilythat code path isn't used on Darwin I guess :)20:27:38
@emilazy:matrix.orgemilyanyway, finding out more about weak exports…20:27:45
@reckenrode:matrix.orgRandy Eckenrode dlopen defaults to RTLD_GLOBAL on Darwin. .NET doesn’t specify, so it gets that by default, which means symbols are resolved against the global namespace. 21:25:35
@emilazy:matrix.orgemily no, it doesn't affect resolution; it means that the loaded library gets exported into the global namespace 21:26:18
@emilazy:matrix.orgemily it should only be relevant if anything with -flat_namespace is linked in or you use dlsym with one of the special handles 21:26:39
@reckenrode:matrix.orgRandy Eckenrode -flat_namespace doesn’t matter. That was the problem with GStreamer. 21:29:29
@reckenrode:matrix.orgRandy EckenrodeBut I feel like this is all beside the point. The question is how much work I have to do to get this fixed. If it’s a non-trivial amount, I’m just going to close the PR and let someone else fix it.21:31:42
@reckenrode:matrix.orgRandy Eckenrode

(do we actually know that .NET wants the Apple patches? I vaguely recall we saw it default or something without in the past - but that is quite plausibly due to the very same weak symbol issue we're running into now.)

It uses libicucore.dylib on Darwin. Native AoT also links against it. Changing it requires making a bunch of changes to .NET to use the upstream ICU instead. It also won’t work for binaries using install_name_tool to avoid sandbox issues with the system ICU.

21:33:28
@reckenrode:matrix.orgRandy Eckenrode *

(do we actually know that .NET wants the Apple patches? I vaguely recall we saw it default or something without in the past - but that is quite plausibly due to the very same weak symbol issue we're running into now.)
It uses libicucore.dylib on Darwin. Native AoT also links against it. Changing it requires making a bunch of changes to .NET to use the upstream ICU instead. It also won’t work for binaries using install_name_tool to avoid sandbox issues with the system ICU.

21:43:37
@reckenrode:matrix.orgRandy Eckenrode *

(do we actually know that .NET wants the Apple patches? I vaguely recall we saw it default or something without in the past - but that is quite plausibly due to the very same weak symbol issue we're running into now.)

It uses libicucore.dylib on Darwin. Native AoT also links against it. Changing it requires making a bunch of changes to .NET to use the upstream ICU instead. It also won’t work for binaries using install_name_tool to avoid sandbox issues with the system ICU.

21:43:44
@reckenrode:matrix.orgRandy EckenrodeI have no idea why Element X renders that last one funny.21:44:03
@emilazy:matrix.orgemilythis feels like a somewhat unfair response to me putting in hours of work and counting today investigating this and trying things to ensure that we don't continually run into OS updates breaking our binaries…21:46:42
@emilazy:matrix.orgemily AFAICT, in the limit, we would have to ensure that nothing we build ever has a weak export for any symbol that is now or could be in the SDK in future, because those will get coalesced ignoring two-level namespaces 21:48:20
@reckenrode:matrix.orgRandy Eckenrode I don’t have hours to deal with this. If resolving it is going to require more time than I can invest, then what else can I do? 22:08:32
12 Apr 2026
@axel_w:matrix.orgaxwlol I didn't think it was possible to configure any programs besides the ones officially supported by nix-darwin. Turns out you can declare settings for any Programm that has a plist file in Library/Prefrences/00:07:32
@axel_w:matrix.orgaxw* lol I didn't think it was possible to configure any programs besides the ones officially supported by nix-darwin. Turns out you can declare settings for any Programm that has a plist file in Library/Prefrences/. Not all have extensive options, but most that can be managed or are intended to be managed by an mdm00:09:35
@logn:zirco.devLogN joined the room.00:58:06

There are no newer messages yet.


Back to Room ListRoom Version: 6