darwin.libcxx: (╯°□°)╯︵ ┻━┻#398727
Conversation
edac098 to
34d2d14
Compare
bc18c00 to
d111455
Compare
d111455 to
7411df7
Compare
7411df7 to
e18b37b
Compare
|
Fixed the signatures. I think I’m going to need to look into Sequoia as a replacement for GnuPG …. Anyway, I confirmed that all of the packages changed in this PR build except for servo, which fails due to having |
e18b37b to
34c076c
Compare
34c076c to
02a2048
Compare
02a2048 to
8e5554e
Compare
aca3519 to
9cdc910
Compare
emilazy
left a comment
There was a problem hiding this comment.
Needs rebase; otherwise LGTM. Left a comment about the one unresolved thing (version).
There was a problem hiding this comment.
overrideLibcxx in pkgs/stdenv/adapters.nix does, I wonder who we should blame for that? 😆
But since Swift and Qt 5 are the only user (and hopefully Swift won’t be soon? and the Qt 5 one seems dubious to me), that’s hopefully not the end of the world; we can potentially just drop it and the assertion is harmless anyway since 15 > 12.
This is not a blocker for me, but it would be nice for the package name in the store path to be distinguished from an LLVM one, and maybe we can solve both problems at once. Some proposals:
libcxx-apple-sdk-15.2libcxx-0-apple-sdk-15.2(ensures version comparisons will at least fail harder)
I think that ideally, we’d have something like libcxx-⟨closest upstream LLVM version⟩-apple-sdk-⟨macOS SDK version⟩. But it might be hard to reliably determine the corresponding LLVM version, given what Apple’s tree is like.
088c7a6 to
996bbf6
Compare
Adds the headers and text-based stubs for the system libc++. This package is using the newest available version (currently 15.5) because libc++ uses static availability checks to prevent using features not supported by older deployment targets. Co-authored-by: Emily <vcs@emily.moe>
This reverts commit 04b49f4. This workaround has a non-trivial cost in build time. Since it’s not needed when linking against the system libc++, just drop it.
We now use the latest SDK’s libc++ headers, and longer have Clang versions old enough for version compatibility to be a concern.
Darwin now uses the system libc++ by default, so drop the replacement. The nixpkgs libc++ is not ABI-compatible with the system libc++, so this replacement was not guaranteed to work anyway. See: https://discourse.llvm.org/t/apples-libc-now-provides-std-type-descriptor-t-functionality-not-found-in-upstream-libc/73881/3
The libc++ in nixpkgs is not ABI-compatible with the system libc++, so replacements are not guaranteed to work. See: https://discourse.llvm.org/t/apples-libc-now-provides-std-type-descriptor-t-functionality-not-found-in-upstream-libc/73881/3
996bbf6 to
b5bbaf2
Compare
|
Woohoo! |
Darwin currently uses libc++ from nixpkgs, but it probably shouldn’t (at least not by default). The libc++ that is built in nixpkgs comes from LLVM. According to Louis Dionne (of Apple and a member of the C++ committee), the libc++ shipped by Apple should be considered distinct from the libc++ in LLVM. We’ve been lucky that we have not had problems with ODR violations. This PR was prompted by leakage of symbols from the system libc++ that started happening with the release of macOS 15.4. It changes a number of things to improve the compatibility of C++ on Darwin.
Testing
I also confirmed that all of the packages updated in this PR built (except for servo, which is broken due to Darwin having a case-insensitive build location), that Qt 5 and opencv4 built on x86_64-darwin, and that my configs built (except for util-linux, which appears broken again on Darwin).
Breaking Change
The primary points of breakage are as follows:
libcxxshould instead referencestdenv.cc.libcxx. (Those are also fixed in this PR.)overrideLibcxxdoesn’t work with the system libc++. If you really need to use it, you should use it withllvmPackages.libcxxStdenv.Notes about fixed packages
/usr/local/lib. Fixed in #399005.Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.