From e5a51b9ce446d8cc12f0d086f0d68638ddcb9249 Mon Sep 17 00:00:00 2001 From: Artturin Date: Fri, 6 Dec 2024 03:26:53 +0200 Subject: [PATCH] DONTDROP haskellPackages.mkDerivation: Fix `cannot coerce null to a string` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.github.com/NixOS/nixpkgs/issues/362272 Fixes ``` $ nix repl --file . --system aarch64-darwin nix-repl> pkgsCross.aarch64-multiplatform.haskellPackages.ghc-lib.env error: … while evaluating attribute 'LOCALE_ARCHIVE' of derivation 'ghc-shell-for-ghc-lib-aarch64-unknown-linux-gnu-9.6.6.20240701-aarch64-unknown-linux-gnu' error: cannot coerce null to a string: null ``` --- pkgs/development/haskell-modules/generic-builder.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index 14afa3dfe6b44e..079698ebd13fa3 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -802,7 +802,7 @@ stdenv.mkDerivation ({ buildInputs = otherBuildInputsSystem; LANG = "en_US.UTF-8"; - LOCALE_ARCHIVE = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "${buildPackages.glibcLocales}/lib/locale/locale-archive"; + LOCALE_ARCHIVE = lib.optionalString (stdenv.hostPlatform.libc == "glibc" && buildPackages.glibcLocales != null) "${buildPackages.glibcLocales}/lib/locale/locale-archive"; "NIX_${ghcCommandCaps}" = "${ghcEnv}/bin/${ghcCommand}"; "NIX_${ghcCommandCaps}PKG" = "${ghcEnv}/bin/${ghcCommand}-pkg"; # TODO: is this still valid?