From d1779090326fc6bd6eddfc606dd177055a199863 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Tue, 1 Jul 2025 12:20:47 +0200 Subject: [PATCH] haskell.compiler.ghc902Binary: workaround com.apple.provenance xattr See #413450. (Ported from 759f22430c78267e863e583c79dd2269b51d1e5c.) --- pkgs/development/compilers/ghc/9.0.2-binary.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/compilers/ghc/9.0.2-binary.nix b/pkgs/development/compilers/ghc/9.0.2-binary.nix index de15bd8e55f0..65f6d133287a 100644 --- a/pkgs/development/compilers/ghc/9.0.2-binary.nix +++ b/pkgs/development/compilers/ghc/9.0.2-binary.nix @@ -350,6 +350,15 @@ stdenv.mkDerivation { # calls install-strip ... dontBuild = true; + # GHC tries to remove xattrs when installing to work around Gatekeeper + # (see https://gitlab.haskell.org/ghc/ghc/-/issues/17418). This step normally + # succeeds in nixpkgs because xattrs are not allowed in the store, but it + # can fail when a file has the `com.apple.provenance` xattr, and it can’t be + # modified (such as target of the symlink to `libiconv.dylib`). + # The `com.apple.provenance` xattr is a new feature of macOS as of macOS 13. + # See: https://eclecticlight.co/2023/03/13/ventura-has-changed-app-quarantine-with-a-new-xattr/ + makeFlags = lib.optionals stdenv.buildPlatform.isDarwin [ "XATTR=/does-not-exist" ]; + # Patch scripts to include runtime dependencies in $PATH. postInstall = '' for i in "$out/bin/"*; do