From 759f22430c78267e863e583c79dd2269b51d1e5c Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Thu, 10 Apr 2025 16:52:59 -0400 Subject: [PATCH] haskell.compiler.ghc*Binary: work around com.apple.provenance xattr --- pkgs/development/compilers/ghc/8.10.7-binary.nix | 9 +++++++++ pkgs/development/compilers/ghc/8.6.5-binary.nix | 9 +++++++++ pkgs/development/compilers/ghc/9.2.4-binary.nix | 9 +++++++++ pkgs/development/compilers/ghc/9.6.3-binary.nix | 9 +++++++++ 4 files changed, 36 insertions(+) diff --git a/pkgs/development/compilers/ghc/8.10.7-binary.nix b/pkgs/development/compilers/ghc/8.10.7-binary.nix index 40becff83767..dd892510f49f 100644 --- a/pkgs/development/compilers/ghc/8.10.7-binary.nix +++ b/pkgs/development/compilers/ghc/8.10.7-binary.nix @@ -388,6 +388,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 diff --git a/pkgs/development/compilers/ghc/8.6.5-binary.nix b/pkgs/development/compilers/ghc/8.6.5-binary.nix index 4ed8654a0bfa..82d7a11c7183 100644 --- a/pkgs/development/compilers/ghc/8.6.5-binary.nix +++ b/pkgs/development/compilers/ghc/8.6.5-binary.nix @@ -178,6 +178,15 @@ stdenv.mkDerivation rec { # 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 diff --git a/pkgs/development/compilers/ghc/9.2.4-binary.nix b/pkgs/development/compilers/ghc/9.2.4-binary.nix index 88b25c420632..fa1119654fee 100644 --- a/pkgs/development/compilers/ghc/9.2.4-binary.nix +++ b/pkgs/development/compilers/ghc/9.2.4-binary.nix @@ -342,6 +342,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 diff --git a/pkgs/development/compilers/ghc/9.6.3-binary.nix b/pkgs/development/compilers/ghc/9.6.3-binary.nix index 73cdc3019418..ff6a6dba5478 100644 --- a/pkgs/development/compilers/ghc/9.6.3-binary.nix +++ b/pkgs/development/compilers/ghc/9.6.3-binary.nix @@ -326,6 +326,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 = ''