about summary refs log tree commit diff
path: root/pkgs/development/haskell-modules
diff options
context:
space:
mode:
authorsternenseemann <sternenseemann@systemli.org>2023-11-17 10:35:55 +0100
committersternenseemann <sternenseemann@systemli.org>2023-11-17 12:54:46 +0100
commit28a3508303041fd6f1538eee16345650591547c8 (patch)
tree52080c294f34bf11abc99c1662ab307809ad0aec /pkgs/development/haskell-modules
parentf023d489972442fc96200e25448dceff7e0ee798 (diff)
haskellPackages.mkDerivation: avoid forcing stdenv.cc if missing
If we don't check `hasCC`, we run into trouble on pkgsCross.ghcjs, one
of the few platforms where `cc` will throw
(so `stdenv.cc.isClang or false would` not be enough).

Problem introduced in 8164b190 / #266172.
Diffstat (limited to 'pkgs/development/haskell-modules')
-rw-r--r--pkgs/development/haskell-modules/generic-builder.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix
index 0b8af6ba6de45..1819b29da460c 100644
--- a/pkgs/development/haskell-modules/generic-builder.nix
+++ b/pkgs/development/haskell-modules/generic-builder.nix
@@ -814,14 +814,14 @@ stdenv.mkDerivation ({
 
 # Implicit pointer to integer conversions are errors by default since clang 15.
 # Works around https://gitlab.haskell.org/ghc/ghc/-/issues/23456.
-// lib.optionalAttrs stdenv.cc.isClang {
+// lib.optionalAttrs (stdenv.hasCC && stdenv.cc.isClang) {
   NIX_CFLAGS_COMPILE = "-Wno-error=int-conversion";
 }
 
 # Ensure libc++abi is linked even when clang is invoked as just `clang` or `cc`.
 # Works around https://github.com/NixOS/nixpkgs/issues/166205.
 # This can be dropped once a fix has been committed to cc-wrapper.
-// lib.optionalAttrs (stdenv.cc.isClang && stdenv.cc.libcxx != null) {
+// lib.optionalAttrs (stdenv.hasCC && stdenv.cc.isClang && stdenv.cc.libcxx != null) {
   NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
 }
 )