@@ -48,6 +48,7 @@ let
4848 };
4949 traceWarnOld = v: x: __trace
5050 "WARNING: ${x.src-spec.version} is out of date, consider using ${latestVer.${v}}." x;
51+ errorOldGhcjs = v: up: throw "ghcjs ${v} is no longer supported by haskell.nix. Consider using ${latestVer.${up}}";
5152in {
5253 haskell-nix = prev.haskell-nix // {
5354 # Use this to disable the existing haskell infra structure for testing purposes
@@ -515,6 +516,21 @@ in {
515516 isHaskellNixBootCompiler = true;
516517 })
517518 ({
519+ # Better error messages when an unsupported version of ghcjs is used
520+ ghc844 = errorOldGhcjs "8.4.4" "8.6";
521+ ghc861 = errorOldGhcjs "8.6.1" "8.6";
522+ ghc862 = errorOldGhcjs "8.6.2" "8.6";
523+ ghc863 = errorOldGhcjs "8.6.3" "8.6";
524+ ghc864 = errorOldGhcjs "8.6.4" "8.6";
525+ ghc881 = errorOldGhcjs "8.8.1" "8.8";
526+ ghc882 = errorOldGhcjs "8.8.2" "8.8";
527+ ghc883 = errorOldGhcjs "8.8.3" "8.8";
528+ ghc8101 = errorOldGhcjs "8.10.1" "8.10";
529+ ghc8102 = errorOldGhcjs "8.10.2" "8.10";
530+ ghc8103 = errorOldGhcjs "8.10.3" "8.10";
531+ ghc8104 = errorOldGhcjs "8.10.4" "8.10";
532+ ghc810420210212 = throw "ghcjs for ghc810420210212 is not supported by haskell.nix";
533+ ghc901 = throw "ghcjs 9.0.1 is not yet supported by haskell.nix";
518534 ghc865 = let buildGHC = final.buildPackages.haskell-nix.compiler.ghc865;
519535 in let booted-ghcjs = final.callPackage ../compiler/ghcjs/ghcjs.nix {
520536 ghcjsSrcJson = ../compiler/ghcjs/ghcjs-src.json;
@@ -547,40 +563,6 @@ in {
547563 cd lib
548564 lndir ${booted-ghcjs}/lib ${targetPrefix}ghc-8.6.5
549565 '' + installDeps targetPrefix);
550− ghc883 = let buildGHC = final.buildPackages.haskell-nix.compiler.ghc883;
551− in let booted-ghcjs = final.callPackage ../compiler/ghcjs/ghcjs.nix {
552− ghcjsSrcJson = ../compiler/ghcjs/ghcjs88-src.json;
553− ghcjsVersion = "8.8.0.0.1";
554− ghc = buildGHC;
555− ghcVersion = "8.8.3";
556− compiler-nix-name = "ghc883";
557− }; in let targetPrefix = "js-unknown-ghcjs-"; in final.runCommand "${targetPrefix}ghc-8.8.3" {
558− nativeBuildInputs = [ final.xorg.lndir ];
559− passthru = {
560− inherit targetPrefix;
561− version = "8.8.3";
562− isHaskellNixCompiler = true;
563− enableShared = false;
564− inherit (booted-ghcjs) configured-src bundled-ghcjs project;
565− inherit booted-ghcjs buildGHC;
566− extraConfigureFlags = [
567− "--ghcjs"
568− "--with-ghcjs=${targetPrefix}ghc" "--with-ghcjs-pkg=${targetPrefix}ghc-pkg"
569− "--with-gcc=${final.buildPackages.emscripten}/bin/emcc"
570− ];
571− };
572− # note: we'll use the buildGHCs `hsc2hs`, ghcjss wrapper just horribly breaks in this nix setup.
573− } (''
574− mkdir -p $out/bin
575− cd $out/bin
576− ln -s ${booted-ghcjs}/bin/ghcjs ${targetPrefix}ghc
577− ln -s ${booted-ghcjs}/bin/ghcjs-pkg ${targetPrefix}ghc-pkg
578− ln -s ${buildGHC}/bin/hsc2hs ${targetPrefix}hsc2hs
579− cd ..
580− mkdir -p lib/${targetPrefix}ghc-8.8.3
581− cd lib
582− lndir ${booted-ghcjs}/lib ${targetPrefix}ghc-8.8.3
583− '' + installDeps targetPrefix);
584566 ghc884 = let buildGHC = final.buildPackages.haskell-nix.compiler.ghc884;
585567 in let booted-ghcjs = final.callPackage ../compiler/ghcjs/ghcjs.nix {
586568 ghcjsSrcJson = ../compiler/ghcjs/ghcjs88-src.json;