-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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_sdk_11_0: generate frameworks.nix #196197
Conversation
in { | ||
# Below this comment are entries migrated from before the generator was | ||
# added. If, for a given framework, you are able to reverify the extra | ||
# deps are really necessary on top of the generator deps, move it above | ||
# this comment (and maybe document your findings). | ||
AVFoundation = { inherit ApplicationServices AVFCapture AVFCore; }; | ||
Accelerate = { inherit CoreWLAN IOBluetooth; }; | ||
AddressBook = { inherit AddressBookCore ContactsPersistence libobjc; }; | ||
AppKit = { inherit AudioToolbox AudioUnit UIFoundation; }; | ||
AudioToolbox = { inherit AudioToolboxCore; }; | ||
AudioUnit = { inherit Carbon CoreAudio; }; | ||
Carbon = { inherit IOKit QuartzCore libobjc; }; | ||
CoreAudio = { inherit IOKit; }; | ||
CoreFoundation = { inherit libobjc; }; | ||
CoreGraphics = { inherit Accelerate IOSurface SystemConfiguration; }; | ||
CoreMIDIServer = { inherit CoreMIDI; }; | ||
CoreMedia = { inherit ApplicationServices AudioToolbox AudioUnit; }; | ||
CoreServices = { inherit CoreAudio CoreData NetFS OpenDirectory ServiceManagement; }; | ||
CoreWLAN = { inherit SecurityFoundation; }; | ||
DiscRecording = { inherit IOKit libobjc; }; | ||
Foundation = { inherit SystemConfiguration libobjc; }; | ||
GameKit = { inherit GameCenterFoundation GameCenterUI GameCenterUICore ReplayKit; }; | ||
ICADevices = { inherit Carbon libobjc; }; | ||
IOBluetooth = { inherit CoreBluetooth; }; | ||
JavaScriptCore = { inherit libobjc; }; | ||
Kernel = { inherit IOKit; }; | ||
LinkPresentation = { inherit URLFormatting; }; | ||
MediaToolbox = { inherit AudioUnit; }; | ||
MetricKit = { inherit SignpostMetrics; }; | ||
Network = { inherit libnetwork; }; | ||
PCSC = { inherit CoreData; }; | ||
PassKit = { inherit PassKitCore; }; | ||
QTKit = { inherit CoreMedia CoreMediaIO MediaToolbox VideoToolbox; }; | ||
Quartz = { inherit QTKit; }; | ||
QuartzCore = { inherit ApplicationServices CoreImage CoreVideo Metal OpenCL libobjc; }; | ||
Security = { inherit IOKit libDER; }; | ||
TWAIN = { inherit Carbon; }; | ||
VideoDecodeAcceleration = { inherit CoreVideo; }; | ||
WebKit = { inherit ApplicationServices Carbon libobjc; }; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are quite a lot. How were these figured out?
Could this at least be partially automated somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the difference between the generated set and old set. So everything in the old frameworks.nix
the generator could not find. (I did this manually because we only have to do it once, in theory.)
I think each of those requires some investigation to see if they are still needed. But for now I thought let's not remove anything to prevent breakage elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To add to this, I think when we add other SDK versions, we should maybe try starting without these manual dependencies. For the 11.0 SDK, that could be trouble because it's the base for aarch64-darwin
stdenv. But any other SDK version will likely be a per-package opt-in situation, and we can reintroduce manual dependencies as we find them.
86a6825
to
b9c6525
Compare
b9c6525
to
d3ebc95
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/1958 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense to me
] | ||
frameworks.sort() | ||
|
||
# Determine the longest ame for padding output. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Determine the longest ame for padding output. | |
# Determine the longest name for padding output. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Diff LGTM
The SDK was missing SDKSettings files. This is usually not a problem for Nix builds, because we generate our own fake SDK structure when necessary (in xcbuild), but not having these files blocks using the upstream Apple SDK in tooling such as gen-frameworks.py.
d3ebc95
to
a0537d6
Compare
Thanks for the reviews! I fixed the typo and rebased on staging, but no other changes. |
I think it's good enough for staging. If there's a massive breakage, we can still spot it in Hydra and fix up/revert. |
Description of changes
This is an attempt to generate
frameworks.nix
using the Swift compiler. Viaswiftc -scan-dependencies
, the compiler outputs JSON we can easily consume. A script runs this on a very simple Swift module that does justimport SomeFramework
, for every framework in the input SDK.This PR is currently split in four commits:
frameworks.nix
with a generated version. Dependencies that would've been removed in this process were added back as manual overrides inapple_sdk.nix
.SDKSettings.{plist,json}
, there wasn't much else missing, but those files happen to be essential for the Swift compiler to work with the SDK as downloaded by Nix.This successfully builds stdenv. I also tested
swift
, in order to run the script itself. As an extra check, I also builtmpv
, which worked after a partial revert of #211864 (currently only on staging), and after adding an Accelerate framework dependency (but it appears mpv is similarly broken on master). Especially mpv also uses rust, gfortran, python and a whole bunch of things in its build closure, so I think that makes this decently tested?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/
)nixos/doc/manual/md-to-db.sh
to update generated release notes