From 69125bc160be89bf5dabd4ef77498b02c6cc69e3 Mon Sep 17 00:00:00 2001 From: Gabriella Gonzalez Date: Tue, 21 Dec 2021 21:19:51 -0800 Subject: [PATCH] haskell.compiler.ghcjs: Don't use upstream `config.sub` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this change the `ghcjs` build fails with: ``` checking host system type... Invalid configuration `js-ghcjs': machine `js-unknown' not recognized configure: error: …/bin/bash …/configured-ghcjs-src/lib/boot/pkg/unix/config.sub js-ghcjs failed ``` This fails because the `updateAutotoolsGnuConfigScriptsHook` overrides the `config.sub` in the `unix` boot package to use the newer upstream version of `config.sub`, but the newer version is incompatible with the `js-ghcjs` host string used to configure the `unix` package. The fix is to undo the override, because the `config.sub` vendored within `ghc` supports the host string correctly. --- pkgs/development/compilers/ghcjs/8.10/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/compilers/ghcjs/8.10/default.nix b/pkgs/development/compilers/ghcjs/8.10/default.nix index b6c2f7e72ee0..2fbf7ded9c40 100644 --- a/pkgs/development/compilers/ghcjs/8.10/default.nix +++ b/pkgs/development/compilers/ghcjs/8.10/default.nix @@ -78,6 +78,11 @@ in stdenv.mkDerivation { ]; dontConfigure = true; dontInstall = true; + + # Newer versions of `config.sub` reject the `js-ghcjs` host string, but the + # older `config.sub` filed vendored within `ghc` still works + dontUpdateAutotoolsGnuConfigScripts = true; + buildPhase = '' export HOME=$TMP mkdir $HOME/.cabal