From d93f2c38659b6ec5a61428ce504626e742c2a361 Mon Sep 17 00:00:00 2001 From: Dan Peebles Date: Sun, 9 Apr 2017 09:39:30 -0400 Subject: [PATCH] darwin.libSystem: fix intermittent impurity bug If you've seen issues with libsystem_symptoms.dylib, this should fix that. --- .../Libsystem/default.nix | 6 ++- .../Libsystem/reexported_libraries | 41 +++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 pkgs/os-specific/darwin/apple-source-releases/Libsystem/reexported_libraries diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix index 92c54d9b679e..ea5aac60ab95 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix @@ -76,7 +76,11 @@ appleDerivation rec { /usr/lib/libSystem.dylib \ -reexported_symbols_list ${./system_symbols} - libs=$(otool -arch x86_64 -L /usr/lib/libSystem.dylib | tail -n +3 | awk '{ print $1 }') + # We used to determine these impurely based on the host system, but then when we got some 10.12 Hydra boxes, + # one of them accidentally built this derivation, referenced libsystem_symptoms.dylib, which doesn't exist on + # 10.11, and then broke all subsequent builds on 10.11. By picking a 10.11 compatible subset of the libraries, + # we avoid scary impurity issues like that. + libs=$(cat ${./reexported_libraries} | grep -v '^#') for i in $libs; do if [ "$i" != "/usr/lib/system/libsystem_kernel.dylib" ] && [ "$i" != "/usr/lib/system/libsystem_c.dylib" ]; then diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/reexported_libraries b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/reexported_libraries new file mode 100644 index 000000000000..00aaba1d4982 --- /dev/null +++ b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/reexported_libraries @@ -0,0 +1,41 @@ +# These are generated with otool -L /usr/lib/libSystem.dylib on a 10.11 machine +/usr/lib/system/libcache.dylib +/usr/lib/system/libcommonCrypto.dylib +/usr/lib/system/libcompiler_rt.dylib +/usr/lib/system/libcopyfile.dylib +/usr/lib/system/libcorecrypto.dylib +/usr/lib/system/libdispatch.dylib +/usr/lib/system/libdyld.dylib +/usr/lib/system/libkeymgr.dylib +/usr/lib/system/liblaunch.dylib +/usr/lib/system/libmacho.dylib +/usr/lib/system/libquarantine.dylib +/usr/lib/system/libremovefile.dylib +/usr/lib/system/libsystem_asl.dylib +/usr/lib/system/libsystem_blocks.dylib + +# We handle this specially in the expression +# /usr/lib/system/libsystem_c.dylib + +/usr/lib/system/libsystem_configuration.dylib +/usr/lib/system/libsystem_coreservices.dylib +/usr/lib/system/libsystem_coretls.dylib +/usr/lib/system/libsystem_dnssd.dylib +/usr/lib/system/libsystem_info.dylib + +# We handle this specially in the expression +# /usr/lib/system/libsystem_kernel.dylib + +/usr/lib/system/libsystem_m.dylib +/usr/lib/system/libsystem_malloc.dylib +/usr/lib/system/libsystem_network.dylib +/usr/lib/system/libsystem_networkextension.dylib +/usr/lib/system/libsystem_notify.dylib +/usr/lib/system/libsystem_platform.dylib +/usr/lib/system/libsystem_pthread.dylib +/usr/lib/system/libsystem_sandbox.dylib +/usr/lib/system/libsystem_secinit.dylib +/usr/lib/system/libsystem_trace.dylib +/usr/lib/system/libunc.dylib +/usr/lib/system/libunwind.dylib +/usr/lib/system/libxpc.dylib