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.org | 201 Servers |
| Sender | Message | Time |
|---|---|---|
| 11 Apr 2026 | ||
| 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 | |
| the 26.4 bump seems like it might be… exciting :) | 15:14:21 | |
| Yes. The source release refactor has no rebuilds. | 15:15:15 | |
| Future SDK updates should be easier assuming Apple stops doing weird things. | 15:15:34 | |
| big assumption | 15:16:01 | |
| I'm looking into the ICU thing | 17:12:16 | |
| left a very long, rambly comment, apologies 😅 | 18:40:00 | |
| not 100% confident I figured out the best fix but I am at least a lot less confused by the observed behaviour now | 18:42:18 | |
| I believe one of the .NET core libraries links against it. The native AoT also links against it. | 18:43:24 | |
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 | |
I suspect dlopen makes it easier to expose the issue here but isn't the root cause per se | 18:45:34 | |
| The 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 | |
| The 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 | |
| * | 18:52:49 | |
| 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:52:52 | |
| So is the recommended path to rebuild the dylib from the raw object files, copying what Apple does? | 18:55:31 | |
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 | |
| 19:06:43 | ||
| bypassed in what way? the symbols here don't have a namespace involved (because they're defined, just weekly), and I think using (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 | |
| my feeling is that the lack of that export on the template instantiation is just an ICU bug | 19:35:36 | |
| presumably because explicit template instantiations are weird abs nobody thought about it | 19:35:55 | |
| I'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 anything | 19:36:47 | |
| that 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 way | 19:37:56 | |
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 | |
| per usual two-level namespace rules | 19:40:10 | |
| https://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 | |
| btw, 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-L61 | 20:26:32 | |
| ah, actually no | 20:27:32 | |
| that code path isn't used on Darwin I guess :) | 20:27:38 | |
| anyway, finding out more about weak exports… | 20:27:45 | |