-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apple_sdks: init with 11.1, 11.3, 12.1, 12.3, 13.1, and 13.3 #229210
Conversation
a9fc6d4
to
47b6a4b
Compare
e531aef
to
b3fe9b3
Compare
I wonder where did it get my username from. I don't see any change involving me and I don't have any darwin machine |
e965e39
to
61255f3
Compare
Okay! Did some fairly major refactoring of the 13.3 SDK to genericize it and make it easier to sub in other versions. I've also added a |
Should |
It should, but I'm hesitant to refactor all of the SDKs at the moment, so I'm trying to keep changes localized to the SDK for 13.
Thankfully, all of the 11.0+ releases seem to follow a similar pattern. I imagine each will have its own nix expression for public and private frameworks, as well as fixups, but that they'll have a lot in common. If we wanted to move away from checking in the auto-generated public dependencies, we could instead make use of I just updated the PR description with a bit of documentation for what the |
I want to note that I was also able to get rid of some recursion and switch over to using |
Can it be at the top level without refactoring the other SDKs? That would allow them to be refactored later. Ideally, the SDKs should share as much of the build infrastructure to make adding new ones as painless as possible.
Would each dependency use
Looks good! One other thing that comes to mind is making sure the system ncurses is excluded from the SDK. That’s not the case for the 11.0 SDK currently. It’s one of a few things that prevent Apple’s upstream cctools from building on aarch64-darwin. I grepped the current PR and don’t see it, so it appears it’s not excluded. Ideally, the 11.0 SDK would be updated/refactored and drop the system ncurses framework. Everything in nixpkgs should use the packaged ncurses. There are a few private frameworks that also aren’t included. See #149692 (comment). If those could also be included, it might be possible to build the upstream cctools and fix the linker crash. |
I like the new organization. If this means adding new SDKs is a lot easier, that would be fantastic. As discussed on Matrix, MoltenVK is well-behaved and can be built against the latest SDK. It uses dynamic feature detection to run on older systems. It supports a couple of macOS versions (10.11 and 10.12) for which it is impossible to build using those platforms’ SDKs. |
@ConnorBaker #234710 is complete. The Darwin stdenv update has been merged into master. |
Any updates on the >= 12.x versions? This seems to be the new target architecture for many packages in the Python ecosystem and if i remember correctly the first official version to support Arm64 macs. |
I will be picking this up after I get the cctools and ld64 updates successfully building the Darwin blockers channel and take a look at the Darwin cross-compilation issue after those and the recent LLVM changes. The plan is to land an SDK refactor into a common pattern first then add the missing SDKs (10.13 through 14.x) with as many source-based components as possible without regressing compatibility. Once newer SDKs are available, packages that need one can use
11.0 was the first release of macOS to support Apple Silicon. There are no plans currently to change the default SDK on aarch64-darwin, but x86_64-darwin will be updated to 10.13 or 10.14 (but most likely 10.13). |
@reckenrode did I read that correctly that you continue on this PR? |
@gador That’s right (more or less). The first iteration will be just the current SDKs in the common pattern. I’d like to do it without causing rebuilds, but I’m doubtful it’s possible. It may be a continuation, or it may just incorporate some of the approach. I’ll post an update to the Darwin updates news thread on Discourse once I have something to test. |
Hey @reckenrode, I didn't mean to step on any toes with that flake. It was for an experiment, but I never managed to make it actually work. It'd definitely be better being part of nixpkgs, and we don't have any grand plans to maintain an apple sdk flake long term. Just trying to get out of a jam where we needed a newer SDK for a Swift program, but couldn't wait for a future merge, and it wasn't working as-is in the PR. Fwiw I emailed Connor Baker about this PR last night before I made the repo, but it didn't occur to me to email you first too. I'm sorry again. |
It’s not about whether it’s a flake or an alternative. It’s the lack of communication and roadmap, especially in light of recent controversies. Is this going to be the solution? Is DetSys going to drive that? What’s going on? |
There is no roadmap, and we're definitely not the people to decide if this is the solution, and we're not driving it, lol. Like I said: Just trying to get out of a jam where we needed a newer SDK for a Swift program, but couldn't wait for a future merge, and it wasn't working as-is in the PR. |
@grahamc Thanks for the clarification. I think if I had known the context when I saw the repo, I’d have reacted better. It’s understandable that you needed a solution when the soonest anything could possibly land is after the 24.05 release. The current SDK situation is definitely not great. |
The zed-editor package will require the 12.3 SDKs to fix darwin because of ScreenCaptureKit. I'll open a draft PR for the zed-editor fixes this week, if there's any way I can help please let me know. 😄 |
Closed by #346043 |
What's new?
Adds a new directory for
apple-sdks
and refactors Xcode directory. Both use a “builder” and “releases” pattern where a nix configuration file stores information about each release and a separate nix file contains the function to build each release. This pattern has proven useful in the CUDA work I’ve done where we need to support multiple SDKs.Default Apple SDK for
aarch64
has been bumped from 11.0 to 11.1.Apple SDK versions 11.3, 12.1, 12.3, 13.1, and 13.3 are now available.
In addition, we now have a script to track Apple SDK releases (by parsing their
sucatalog
). Thegen-frameworks.py
script has been updated to accept command line arguments as well as support generating apublic.nix
file for each SDK release in the file generated bygen-apple-sdk-releases.py
.Current problems?
stdenv
and ensuring linking against the correctlibc
/libcxx
.stdenv
compiler will fail if run in parallel. The specific error mentions miniperl. If encountered, limit the number of jobs to one until the bootstrapping is complete.Docs
pkgs/os-specific/darwin/apple-sdks/README.md
for the beginnings of some documentation around howframeworks
are generated.Miscellaneous notes
Notes on the SDK's
mkStdenv
indefault.nix
, courtesy of @reckenrode:darwinMinVersion = "10.12"
.xcodeVer = "14.3"
. Nor do we need to override the default Xcode set inpkgs/os-specific/darwin/Xcode/default.nix
because it only serves to copy the Xcode into the store and there aren't any derivations in Nixpkgs which seem to use it.darwinSdkVersion = "13.3"
so our SDK is chosen instead of the default when buildingstdenv
.Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)