Skip to content

Mark __impureHostDeps paths as optional#4761

Merged
edolstra merged 1 commit intoNixOS:masterfrom
emilazy:issue-4658-mark-impure-host-deps-as-optional
May 3, 2021
Merged

Mark __impureHostDeps paths as optional#4761
edolstra merged 1 commit intoNixOS:masterfrom
emilazy:issue-4658-mark-impure-host-deps-as-optional

Conversation

@emilazy
Copy link
Member

@emilazy emilazy commented May 2, 2021

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.

If you’d like to test out this fix, the following settings should with with nix-darwin:

{ pkgs, ... }:

{
  nix.package = pkgs.nixFlakes.override (prev: {
    patches = prev.patches or [ ] ++ [
      (pkgs.fetchpatch {
        url = "https://github.com/NixOS/nix/pull/4761.patch";
        sha256 = "1z7s2dkbsd3fk5688s0870k942r8nsnmr140sn5vgjafywihbihb";
      })
    ];
  });

  # Then enable:
  #nix.useSandbox = "relaxed";
}

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 NixOS#4658.
@emilazy
Copy link
Member Author

emilazy commented May 2, 2021

Note that I don’t know much about Darwin sandboxing or if /usr/lib/libSystem.B.dylib necessarily has to stay in the default nixpkgs sandbox paths; see #4658 (comment).

@emilazy
Copy link
Member Author

emilazy commented May 2, 2021

I don’t understand the CI failure and I’m also seeing some build failures with the sandbox on (e.g. pkgs.fish during the tests); not sure whether these are general macOS infelicities or caused by the patch.

@edolstra edolstra merged commit 40378fb into NixOS:master May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build sandbox seems broken on macOS 11 Big Sur

2 participants