From 405d78eafcdf76dbf7189858fe0c4ef3e15301ca Mon Sep 17 00:00:00 2001 From: Emily Date: Sun, 2 May 2021 05:30:50 +0100 Subject: [PATCH] Mark `__impureHostDeps` paths as optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Starting in macOS 11, the on-disk dylib bundles are no longer available, but nixpkgs needs to be able to keep compatibility with older versions that require `/usr/lib/libSystem.B.dylib` in `__impureHostDeps`. Allow it to keep backwards compatibility with these versions by marking these dependencies as optional. Fixes #4658. (cherry picked from commit c4355a52fa317cb782fec5e22c4ac688f67d487d) Signed-off-by: Domen Kožar --- src/libstore/build.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libstore/build.cc b/src/libstore/build.cc index d09db82fc..3fe01270e 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -2065,7 +2065,9 @@ void DerivationGoal::startBuilder() if (!found) throw Error(format("derivation '%1%' requested impure path '%2%', but it was not in allowed-impure-host-deps") % drvPath % i); - dirsInChroot[i] = i; + /* Allow files in __impureHostDeps to be missing; e.g. + macOS 11+ has no /usr/lib/libSystem*.dylib */ + dirsInChroot[i] = {i, true}; } #if __linux__