!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

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

Load older messages


SenderMessageTime
11 Apr 2026
@emilazy:matrix.orgemily Randy Eckenrode: going to take a look at the pending PRs now. I take it you're targeting these refactors/bumps for before the freeze? 15:13:44
@emilazy:matrix.orgemilythe 26.4 bump seems like it might be… exciting :)15:14:21
@reckenrode:matrix.orgRandy EckenrodeYes. The source release refactor has no rebuilds.15:15:15
@reckenrode:matrix.orgRandy EckenrodeFuture SDK updates should be easier assuming Apple stops doing weird things.15:15:34
@emilazy:matrix.orgemilybig assumption15:16:01
@emilazy:matrix.orgemilyI'm looking into the ICU thing17:12:16
@emilazy:matrix.orgemilyleft a very long, rambly comment, apologies 😅18:40:00
@emilazy:matrix.orgemilynot 100% confident I figured out the best fix but I am at least a lot less confused by the observed behaviour now18:42:18
@reckenrode:matrix.orgRandy EckenrodeI believe one of the .NET core libraries links against it. The native AoT also links against it.18:43:24
@emilazy:matrix.orgemily it's all via dlopen, I traced it fully in my comment and also figured out the root cause of why ICU specifically causes the weird mixing 18:44:53
@emilazy:matrix.orgemily I suspect dlopen makes it easier to expose the issue here but isn't the root cause per se 18:45:34
@reckenrode:matrix.orgRandy EckenrodeThe reason why we don’t follow Apple’s logic is to reuse our existing ICU derivation and potentially link it like a normal ICU. We also need the separate dylibs for the tests.18:48:13
@reckenrode:matrix.orgRandy EckenrodeThe C++ ABI isn’t stable. We can’t use normal ICU because Apple has its own patches. It also requires unversioned symbols, which is not how we build ICU.18:51:58
@reckenrode:matrix.orgRandy Eckenrode * 18:52:49
@reckenrode:matrix.orgRandy EckenrodeWe can’t use normal ICU because Apple has its own patches. It also requires unversioned symbols, which is not how we build ICU.18:52:52
@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

Show newer messages


Back to Room ListRoom Version: 6