Skip to content
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

darwin: change the SDK pattern, update the SDKs, and update source releases #346043

Merged
merged 157 commits into from
Oct 10, 2024
Merged
Changes from 1 commit
Commits
Show all changes
157 commits
Select commit Hold shift + click to select a range
22369ef
maintainers/team-list.nix: add reckenrode to darwin
reckenrode Aug 11, 2024
08ad882
darwin: add bootstrapStdenv
reckenrode Aug 21, 2024
40d415f
darwin: add darwinMinVersionHook
reckenrode Sep 23, 2024
5721c4f
darwin: add libSystem
reckenrode Sep 30, 2024
1211498
darwin: add xcodeProjectCheckHook
reckenrode Sep 2, 2024
8f8e240
darwin.apple-source-releases: add mkAppleDerivation
reckenrode Sep 2, 2024
6a54c7f
darwin.apple-source-releases: add update-source-releases.sh
reckenrode Sep 22, 2024
639108e
darwin.libsbuf: init at 14.1
reckenrode Sep 21, 2024
5567902
apple-sdk: init at 10.12.2 and 11.3
reckenrode Sep 21, 2024
3fb982d
apple-sdk_10_13: init at 10.13.2
reckenrode Sep 21, 2024
a447cba
apple-sdk_10_14: init at 10.14.6
reckenrode Sep 21, 2024
d10c85b
apple-sdk_10_15: init at 10.15.6
reckenrode Sep 21, 2024
689e898
apple-sdk_12: init at 12.3
reckenrode Sep 21, 2024
4283b8f
apple-sdk_13: init at 13.3
reckenrode Sep 21, 2024
8fae285
apple-sdk_14: init at 14.4
reckenrode Sep 21, 2024
d1c2539
darwin: add mkStub for deprecating frameworks
reckenrode Sep 29, 2024
17aeace
darwin: prepare for adding stub packages
reckenrode Sep 21, 2024
fcd9dc8
darwin.apple_sdk_11_0: convert frameworks and libs to stubs
reckenrode Sep 26, 2024
4802277
darwin.apple_sdk_12_3: convert frameworks and libs to stubs
reckenrode Sep 27, 2024
0a3c487
darwin.apple_sdk: convert frameworks and libs to stubs
reckenrode Sep 26, 2024
9ecb69c
darwin.apple_sdk: drop gen-frameworks.py (replaced by new SDK pattern)
reckenrode Oct 6, 2024
c218ce1
darwin: replace framework chooser with stubs
reckenrode Sep 21, 2024
97d75cb
{bintools,cc}-wrapper: set up Darwin SDK paths
reckenrode Sep 29, 2024
51755b0
{bintools,cc}-wrapper: use a fallback SDK when `DEVELOPER_DIR` is not…
reckenrode Sep 29, 2024
826edbf
{bintools,cc}-wrapper: fix static builds on Darwin
reckenrode Sep 29, 2024
a556a81
atf: build with the bootstrap stdenv on Darwin
reckenrode Sep 8, 2024
54d591b
cmake: undo `/var/empty` workaround for Darwin SDK paths
reckenrode Aug 31, 2024
472d10b
cmake: do in fact use the Darwin SDK in the setup hook
reckenrode Aug 17, 2024
a79ed0d
gnutar: make sure libiconv is linked
reckenrode Aug 17, 2024
f1480a2
libpng: build with the bootstrap stdenv on Darwin
reckenrode Sep 8, 2024
1ebcfd5
libuv: Use darwin.libutil on Darwin
reckenrode Sep 29, 2024
5a60ff8
libxml2: build with the bootstrap stdenv on Darwin
reckenrode Sep 8, 2024
25c6fe1
llvmPackages.clang: backport __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
reckenrode Sep 24, 2024
4dc3227
llvmPackages.clang: use the system libunwind on Darwin
reckenrode Sep 24, 2024
d3114e0
llvmPackages.compiler-rt: align Darwin bootstrap with other platforms
reckenrode Sep 24, 2024
654e19f
llvmPackages.compiler-rt: always build sanitizers on Darwin
reckenrode Sep 24, 2024
7647c68
llvmPackages.compiler-rt: avoid propagating the SDK in static builds
reckenrode Sep 24, 2024
2fd9a1a
llvmPackages.compiler-rt: drop use of xcbuild
reckenrode Sep 24, 2024
e6a4c83
llvmPackages.compiler-rt: fix compiler-rt bootstrap on Darwin
reckenrode Sep 24, 2024
3e5acda
llvmPackages.compiler-rt: fix cross-compilation on Darwin
reckenrode Sep 24, 2024
18211ad
llvmPackages.libcxx: use a bootstrap stdenv on Darwin
reckenrode Sep 24, 2024
34ce30c
llvmPackages.libllvm: disable tests when built in the Darwin bootstrap
reckenrode Sep 24, 2024
bf45402
ncurses: build with the bootstrap stdenv on Darwin
reckenrode Sep 8, 2024
aef4614
xar: add xarMinimal
reckenrode Oct 2, 2024
45e65c1
xcbuild: move to pkgs/by-name
reckenrode Sep 22, 2024
f51c62a
xcbuild: format with nixfmt-rfc-style
reckenrode Oct 3, 2024
15ac657
xcbuild: refactor to support the new SDKs
reckenrode Sep 22, 2024
118a214
xcbuild: warn when someone tries to override `sdkVer`
reckenrode Oct 3, 2024
49834c3
xcbuild: suppress warning for now
reckenrode Oct 5, 2024
fee84be
xcbuild: suppress xcbuild passthru warning for now
reckenrode Oct 5, 2024
dd569d8
xcbuild: avoid `xcrun` invoking itself via `/usr/bin` stubs
reckenrode Sep 22, 2024
75bc428
xcbuild: 0.1.2-pre -> 0.1.1-unstable-2019-11-20
reckenrode Sep 22, 2024
1fd1796
zlib: build with the bootstrap stdenv on Darwin
reckenrode Sep 8, 2024
76a5ef6
darwin.stdenv: rework for the new SDK
reckenrode Sep 25, 2024
9c004ef
darwin.stdenv: use xarMinimal
reckenrode Oct 2, 2024
b7442b9
darwin.stdenv: provide an SDK when cross-compiling
reckenrode Aug 21, 2024
4624bd7
darwin.adv_cmds: convert to Meson and use mkAppleDerivation
reckenrode Sep 21, 2024
78076b3
darwin.AvailabilityVersions: use mkAppleDerivation
reckenrode Sep 2, 2024
129a959
darwin.AvailabilityVersions: also generate _symbol_aliasing.h
reckenrode Sep 21, 2024
8e7056c
darwin.AvailabilityVersions: remove workaround
reckenrode Oct 5, 2024
94b1474
darwin.basic_cmds: convert to Meson and use mkAppleDerivation
reckenrode Sep 21, 2024
c5c276b
darwin.bootstrap_cmds: convert to Meson and use mkAppleDerivation
reckenrode Sep 22, 2024
b878c44
darwin.bsdmake: add to darwin-aliases.nix
reckenrode Sep 22, 2024
8574626
darwin.copyfile: convert to Meson and use mkAppleDerivation
reckenrode Sep 22, 2024
b8dbc16
darwin.Csu: use mkAppleDerivation
reckenrode Sep 22, 2024
83807dc
darwin.developer_cmds: convert to Meson and use mkAppleDerivation
reckenrode Sep 22, 2024
97454b4
darwin.diskdev_cmds: convert to Meson and use mkAppleDerivation
reckenrode Sep 22, 2024
eed715a
darwin.file_cmds: convert to Meson and use mkAppleDerivation
reckenrode Sep 22, 2024
0335ce0
darwin.ICU: convert to upstream build system and use mkAppleDerivation
reckenrode Sep 22, 2024
ca4dd24
darwin.libiconv: move back to darwin attrset and use mkAppleDerivation
reckenrode Sep 22, 2024
b0884d5
darwin.libiconv: use finalPackage when referencing doInstallCheck
reckenrode Oct 5, 2024
9af3511
darwin.libiconv: use `EOF` instead of `-header` for the herdoc
reckenrode Oct 5, 2024
375057b
darwin.libresolv: convert to Meson and use mkAppleDerivation
reckenrode Sep 22, 2024
dac3f1f
macfuse-stubs: use top-level libtapi
reckenrode Sep 25, 2024
b8be4c4
darwin.libtapi: add to darwin-aliases.nix
reckenrode Sep 22, 2024
4b4270c
darwin.libutil: convert to Meson and use mkAppleDerivation
reckenrode Sep 22, 2024
822a865
darwin.network_cmds: convert to Meson and use mkAppleDerivation
reckenrode Sep 22, 2024
6fca3b4
darwin.PowerManagement: convert to Meson and use mkAppleDerivation
reckenrode Sep 22, 2024
149eb5a
darwin.removefile: convert to Meson and use mkAppleDerivation
reckenrode Sep 22, 2024
a19b0a7
darwin.shell_cmds: convert to Meson and use mkAppleDerivation
reckenrode Sep 22, 2024
9ea9221
darwin.system_cmds: use mkAppleDerivation
reckenrode Sep 22, 2024
97da1bd
darwin.text_cmds: convert to Meson and use mkAppleDerivation
reckenrode Sep 22, 2024
29a87d6
darwin.top: convert to Meson and use mkAppleDerivation
reckenrode Sep 22, 2024
9d376e2
cctools: drop darwin.objc4 from build inputs
reckenrode Aug 17, 2024
3904162
cctools: move libtool to its own output
reckenrode Aug 24, 2024
2bf9c22
ld64: ensure ld64 checks pass with the new SDK
reckenrode Sep 23, 2024
1c17748
ld64: drop libunwind as a dependency
reckenrode Sep 23, 2024
f90d4d5
ld64: adopt source release private headers pattern
reckenrode Sep 23, 2024
84f8fcf
libcCross: use darwin.libSystem unconditionally
reckenrode Sep 25, 2024
6986cab
libunwind: add a comment explaining the package situation
reckenrode Sep 25, 2024
8a0d884
libxo: init at 1.7.5
reckenrode Sep 23, 2024
66fcbb9
makeStaticDarwin: drop darwin-portable-libSystem-hook
reckenrode Sep 25, 2024
1c26a2f
makeStaticDarwin: handle when `env.NIX_CFLAGS_LINK` is set
reckenrode Sep 1, 2024
0e61488
overrideSDK: update for the new SDK
reckenrode Sep 25, 2024
b62e262
python27: drop configd
reckenrode Aug 29, 2024
3e5316c
python3: drop configd
reckenrode Sep 29, 2024
092b50a
python3: fix stdenv bootstrap on x86_64-darwin
reckenrode Oct 3, 2024
7a8e3bf
darwin.CF: remove and replace with stubs
reckenrode Sep 21, 2024
2ed29e2
darwin.CarbonHeaders: remove and replace with stubs
reckenrode Sep 2, 2024
4fbe414
darwin.CommonCrypto: remove and replace with stubs
reckenrode Sep 2, 2024
390e8e7
darwin.CoreSymbolication: remove and replace with stubs
reckenrode Oct 2, 2024
65650be
darwin.IOKit: remove and replace with stubs
reckenrode Sep 2, 2024
2e1f901
darwin.Libc: remove and replace with stubs
reckenrode Sep 2, 2024
0d76542
darwin.Libinfo: remove and replace with stubs
reckenrode Sep 2, 2024
67271ab
darwin.Libm: remove and replace with stubs
reckenrode Sep 2, 2024
b47afcc
darwin.Libnotify: remove and replace with stubs
reckenrode Sep 2, 2024
fe9623e
darwin.Librpcsvc: remove and replace with stubs
reckenrode Sep 2, 2024
db40aca
darwin.Libsystem: remove and replace with stubs
reckenrode Sep 2, 2024
07272a0
darwin.Security: remove and replace with stubs
reckenrode Sep 2, 2024
fd2ae22
darwin.architecture: remove and replace with stubs
reckenrode Sep 2, 2024
ac79109
darwin.configd: remove and replace with stubs (including configdHeaders)
reckenrode Sep 2, 2024
d78b641
darwin.darwin-stubs: remove and replace with stubs
reckenrode Sep 21, 2024
ae78385
darwin.dtrace: remove and replace with stubs
reckenrode Sep 2, 2024
8a59383
darwin.dyld: remove and replace with stubs
reckenrode Sep 2, 2024
cce88cf
darwin.eap8021x: remove and replace with stubs
reckenrode Sep 2, 2024
2ade0ae
darwin.hfs: remove and replace with stubs (including hfsHeaders)
reckenrode Sep 2, 2024
1c2dde0
darwin.launchd: remove and replace with stubs
reckenrode Sep 2, 2024
eb7c5f8
darwin.libclosure: remove and replace with stubs
reckenrode Sep 2, 2024
b9005e1
darwin.libdispatch: remove and replace with stubs
reckenrode Sep 2, 2024
1afb8b5
darwin.libmalloc: remove and replace with stubs
reckenrode Sep 2, 2024
29f65b3
darwin.libplatform: remove and replace with stubs
reckenrode Sep 2, 2024
7b23be1
darwin.libpthread: remove and replace with stubs
reckenrode Sep 2, 2024
ec40b04
darwin.libunwind: improve compatibility with libunwind
reckenrode Sep 2, 2024
259c350
darwin.libunwind: remove source release
reckenrode Sep 2, 2024
4c77578
darwin.mDNSResponder: remove and replace with stubs
reckenrode Sep 2, 2024
7be27dc
darwin.objc4: remove and replace with stubs
reckenrode Sep 2, 2024
03e585a
darwin.ppp: remove and replace with stubs
reckenrode Sep 2, 2024
6b6277e
darwin.xnu: remove and replace with stubs
reckenrode Sep 2, 2024
6c6b7b0
darwin.apple-source-releases: switch to new source release pattern
reckenrode Sep 2, 2024
bdf3046
darwin.adv_cmds: 163 -> 231
reckenrode Sep 21, 2024
4854f28
darwin.AvailabilityVersions: 140.1 -> 143.3
reckenrode Sep 21, 2024
ab006b0
darwin.basic_cmds: 55 -> 70
reckenrode Sep 22, 2024
4d328d0
darwin.bootstrap_cmds: 121 -> 136
reckenrode Sep 22, 2024
d5f4ae4
darwin.copyfile: 138 -> 213
reckenrode Sep 22, 2024
82a2469
darwin.developer_cmds: 62 -> 79
reckenrode Sep 22, 2024
e0cf96b
darwin.diskdev_cmds: 593 -> 735
reckenrode Sep 22, 2024
c640ed8
darwin.doc_cmds: init at 66
reckenrode Sep 22, 2024
32f5feb
darwin.file_cmds: 264.1.1 -> 448.0.3
reckenrode Sep 22, 2024
47df058
darwin.ICU: 66108 -> 74221
reckenrode Sep 22, 2024
d3ca461
darwin.IOKitTools: init at 125
reckenrode Sep 28, 2024
1d8c6e7
darwin.libiconv: 99 -> 107
reckenrode Sep 22, 2024
9c31a3e
darwin.libpcap: init at 135
reckenrode Sep 22, 2024
fc97344
darwin.libresolv: 64 -> 83
reckenrode Sep 22, 2024
edb2497
darwin.libutil: 47.30.1 -> 72
reckenrode Sep 22, 2024
44f1fa4
darwin.mail_cmds: init at 38.0.1
reckenrode Sep 22, 2024
42daeac
darwin.misc_cmds: init at 44
reckenrode Sep 22, 2024
d293dd1
darwin.network_cmds: 606.40.2 -> 696
reckenrode Sep 22, 2024
01d1005
darwin.patch_cmds: init at 62
reckenrode Sep 22, 2024
6d0bc8c
darwin.PowerManagement: 572.50.1 -> 1740.0.7
reckenrode Sep 22, 2024
f493fb8
darwin.remote_cmds: init at 303.0.2
reckenrode Sep 22, 2024
a32fcaa
darwin.removefile: 45 -> 75
reckenrode Sep 22, 2024
7b84d89
darwin.shell_cmds: 187 -> 319.0.1
reckenrode Sep 22, 2024
72f19ad
darwin.system_cmds: 970.0.4 -> 1012
reckenrode Sep 22, 2024
63bfe3c
darwin.text_cmds: 99 -> 190.0.1
reckenrode Sep 22, 2024
7e4956a
darwin.top: 108 -> 139
reckenrode Sep 22, 2024
bafc6ff
darwin.xattr: replace with xattr from file_cmds
reckenrode Sep 7, 2024
e3f2829
xar: 498 -> 501
reckenrode Oct 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
apple-sdk: init at 10.12.2 and 11.3
This is a new packaging of the Darwin SDK. Instead of splitting
libraries and frameworks into separate packages, it provides a single
package for the whole SDK.

# Features

- Vendored files are removed from the SDK. There are 50+ different
  packages that are vendored by upstream (depending on the version);
- Components that are built in nixpkgs (either from upstream or from the
  source releases) are also removed. If they need to be included by
  default, they are propagated;
- A single SDK pattern is used to package all SDKs, and scripts are
  provided to aid updating the SDK version and its source release
  versions. This makes adding new SDKs much easier;
- SDK overrides are handled by adding the SDK version you require. If
  multiple SDKs are present, only the newest is used. It is possible to
  have different SDKs for each of build, host, and target platforms;
- Private headers are no longer provided by default unless you use the
  SDK’s `privateFrameworksHook` to add them. It does the right thing
  when multiple SDKs are in your inputs;
- Source releases for the SDK version are available via a passthru
  `sourceRelease` function. This is mostly useful for getting private
  headers for building source releases in the darwin attrset; and
- The same versions of propagated components are used on both platforms
  (e.g., the same libresult, libiconv, etc).

See `pkgs/by-name/ap/apple-sdk/README.md` for details on how the SDK
derivation is structured and how to update it.
reckenrode committed Oct 10, 2024

Partially verified

This commit is signed with the committer’s verified signature.
targos’s contribution has been verified via GPG key.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
commit 556790248f75fbd60ba60bb55418a830b2f98945
Empty file.
51 changes: 51 additions & 0 deletions pkgs/by-name/ap/apple-sdk/common/add-core-symbolication.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
lib,
fetchFromGitHub,
stdenvNoCC,
}:

let
CoreSymbolication = stdenvNoCC.mkDerivation (finalAttrs: {
pname = "CoreSymbolication";
version = "0-unstable-2018-06-17";

src = fetchFromGitHub {
repo = "CoreSymbolication";
owner = "matthewbauer";
rev = "24c87c23664b3ee05dc7a5a87d647ae476a680e4";
hash = "sha256-PzvLq94eNhP0+rLwGMKcMzxuD6MlrNI7iT/eV0obtSE=";
};
emilazy marked this conversation as resolved.
Show resolved Hide resolved

patches = [
# Add missing symbol definitions needed to build `zlog` in system_cmds.
# https://github.com/matthewbauer/CoreSymbolication/pull/2
../patches/0001-Add-function-definitions-needed-to-build-zlog-in-sys.patch
../patches/0002-Add-CF_EXPORT-To-const-symbols.patch
emilazy marked this conversation as resolved.
Show resolved Hide resolved
];

dontBuild = true;

installPhase = ''
mkdir -p "$out/include"
cp *.h "$out/include"
'';

meta = {
description = "Reverse engineered headers for Apple's CoreSymbolication framework";
homepage = "https://github.com/matthewbauer/CoreSymbolication";
license = lib.licenses.mit;
maintainers = lib.teams.darwin.members;
platforms = lib.platforms.darwin;
};
});
in
self: super: {
buildPhase =
super.buildPhase or ""
+ ''
mkdir -p System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/Headers
ln -s A System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/Current
ln -s Versions/Current/Headers System/Library/PrivateFrameworks/CoreSymbolication.framework/Headers
cp '${CoreSymbolication}/include/'*.h System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/Headers
'';
}
17 changes: 17 additions & 0 deletions pkgs/by-name/ap/apple-sdk/common/derivation-options.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ lib, config }:

self: super: {
preBuild =
super.preBuild or ""
+ ''
platformPath=$out/Platforms/MacOSX.platform
sdkpath=$platformPath/Developer/SDKs
'';

preInstall =
super.preInstall or ""
+ ''
platformPath=$out/Platforms/MacOSX.platform
sdkpath=$platformPath/Developer/SDKs
'';
}
42 changes: 42 additions & 0 deletions pkgs/by-name/ap/apple-sdk/common/fetch-sdk.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
lib,
fetchurl,
cpio,
pbzx,
}:

{
url,
version,
hash,
}:

fetchurl {
pname = "macOS-SDK";
inherit version url hash;

recursiveHash = true;

nativeBuildInputs = [
cpio
pbzx
];

postFetch = ''
renamed=$(mktemp -d)/sdk.xar
mv "$downloadedFile" "$renamed"
pbzx "$renamed" | cpio -idm
reckenrode marked this conversation as resolved.
Show resolved Hide resolved
# SDKs are inconsistent about whether MacOSX.sdk or MacOSX<version>.sdk is a symlink.
src=Library/Developer/CommandLineTools/SDKs/MacOSX${lib.versions.majorMinor version}.sdk
if [ ! -d $src ]; then
src=Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
fi
# Remove unwanted binaries, man pages, and folders from the SDK.
rm -rf $src/usr/bin $src/usr/share $src/System/Library/Perl
mkdir -p "$out"
cp -rd $src/* "$out"
'';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{ makeSetupHook, sdkVersion }:

self: super: {
passthru = super.passthru or { } // {
privateFrameworksHook = makeSetupHook {
name = "apple-sdk-private-frameworks-hook";
} ../setup-hooks/add-private-frameworks.sh;
};
}
37 changes: 37 additions & 0 deletions pkgs/by-name/ap/apple-sdk/common/passthru-source-release-files.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
let
lockfile = builtins.fromJSON (builtins.readFile ../metadata/apple-oss-lockfile.json);
in

{
lib,
fetchFromGitHub,
stdenvNoCC,
sdkVersion,
}:

let
sdkinfo = lockfile.${sdkVersion};
in
self: super: {
passthru = super.passthru or { } // {
# Returns the raw source from apple-oss-distributions repo.
# This is mostly useful for copying private headers needed to build other source releases.
#
# Note: The source releases are mostly not used to build the SDK. Unless they can be used to build binaries,
# they’re not used.
sourceRelease =
name:
let
lockinfo = sdkinfo.${name};
in
fetchFromGitHub {
owner = "apple-oss-distributions";
repo = name;
rev = lockinfo.rev or "${name}-${lockinfo.version}";
inherit (lockinfo) hash;
}
// {
inherit (lockinfo) version;
};
emilazy marked this conversation as resolved.
Show resolved Hide resolved
};
}
Loading