Skip to content

Commit

Permalink
haskellPackages.mkDerivation: avoid forcing stdenv.cc if missing
Browse files Browse the repository at this point in the history
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 8164b19 / #266172.
  • Loading branch information
sternenseemann committed Nov 17, 2023
1 parent f023d48 commit 28a3508
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkgs/development/haskell-modules/generic-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
}
)
Expand Down

0 comments on commit 28a3508

Please sign in to comment.