diff --git a/flake.lock b/flake.lock index 2cdd1d8eb..3ec9e5e38 100644 --- a/flake.lock +++ b/flake.lock @@ -120,11 +120,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1733704277, - "narHash": "sha256-fZ1dxVDJ7bLWiwzT9uK6TNWADVlSb1LaAD5gnsckxFs=", + "lastModified": 1734395427, + "narHash": "sha256-UlJvZ28OJlxMPWul1fBnAKQNi2FB9THzwXGaZk05Igg=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "c81e5d210fdbaa001e1eba2408485fc48fab1143", + "rev": "c156286449af88190a9c1af6c0bf05d452713eae", "type": "github" }, "original": { @@ -630,11 +630,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1733703167, - "narHash": "sha256-UIpSBNQh4Q5Sv9PU1oMxZfP27T0COikiZXC/sNBE7Yc=", + "lastModified": 1734480711, + "narHash": "sha256-40xqAhDQ+LDaIUCcjRBkMpLCQBQzARrZMLH7NgbwpsQ=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "984d656a0bf4d130acb560ccf2d91e89e7e076ae", + "rev": "2238f27db846e3e17fb077827152180cb882a321", "type": "github" }, "original": { diff --git a/lib/call-cabal-project-to-nix.nix b/lib/call-cabal-project-to-nix.nix index fbda651ef..d8d183f2d 100644 --- a/lib/call-cabal-project-to-nix.nix +++ b/lib/call-cabal-project-to-nix.nix @@ -1,4 +1,4 @@ -{ pkgs, runCommand, cacert, index-state-hashes, haskellLib }: +{ pkgs, cacert, index-state-hashes, haskellLib }: { name ? src.name or null # optional name for better error messages , src , materialized-dir ? ../materialized @@ -14,7 +14,6 @@ , cabalProjectFreeze ? null , caller ? "callCabalProjectToNix" # Name of the calling function for better warning messages , compilerSelection ? p: p.haskell-nix.compiler -, ghc ? null # Deprecated in favour of `compiler-nix-name` , ghcOverride ? null # Used when we need to set ghc explicitly during bootstrapping , configureArgs ? "" # Extra arguments to pass to `cabal v2-configure`. # `--enable-tests --enable-benchmarks` are included by default. @@ -74,29 +73,22 @@ let nix-tools = if args.nix-tools or null != null then args.nix-tools else evalPackages.haskell-nix.nix-tools-unchecked; - forName = pkgs.lib.optionalString (name != null) (" for " + name); + nameAndSuffix = suffix: if name == null then suffix else name + "-" + suffix; ghc' = if ghcOverride != null then ghcOverride else - if ghc != null - then __trace ("WARNING: A `ghc` argument was passed" + forName - + " this has been deprecated in favour of `compiler-nix-name`. " - + "Using `ghc` will break cross compilation setups, as haskell.nix cannot " - + "pick the correct `ghc` package from the respective buildPackages. " - + "For example, use `compiler-nix-name = \"ghc865\";` for GHC 8.6.5.") ghc - else - # Do note that `pkgs = final.buildPackages` in the `overlays/haskell.nix` - # call to this file. And thus `pkgs` here is the proper `buildPackages` - # set and we do not need, nor should pick the compiler from another level - # of `buildPackages`, lest we want to get confusing errors about the Win32 - # package. - # - # > The option `packages.Win32.package.identifier.name' is used but not defined. - # - (compilerSelection pkgs)."${compiler-nix-name}"; + # Do note that `pkgs = final.buildPackages` in the `overlays/haskell.nix` + # call to this file. And thus `pkgs` here is the proper `buildPackages` + # set and we do not need, nor should pick the compiler from another level + # of `buildPackages`, lest we want to get confusing errors about the Win32 + # package. + # + # > The option `packages.Win32.package.identifier.name' is used but not defined. + # + (compilerSelection pkgs)."${compiler-nix-name}"; in let ghc = if ghc' ? latestVersion diff --git a/overlays/bootstrap.nix b/overlays/bootstrap.nix index aeddedc18..b9a4c1416 100644 --- a/overlays/bootstrap.nix +++ b/overlays/bootstrap.nix @@ -297,6 +297,9 @@ in { # Fix issue loading windows dll using `.dll.a` file ++ onWindows (fromUntil "9.4" "9.14" ./patches/ghc/ghc-9.10-windows-dll-dependent-symbol-type-fix.patch) + + # See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13709 + ++ fromUntil "9.8.4" "9.8.5" ./patches/ghc/ghc-9.8.4-remove-unused-containers-h-include13709.diff ; in ({ ghc8107 = traceWarnOld "8.10" (final.callPackage ../compiler/ghc { diff --git a/overlays/haskell.nix b/overlays/haskell.nix index b6b58a4a9..76b917ffe 100644 --- a/overlays/haskell.nix +++ b/overlays/haskell.nix @@ -600,7 +600,7 @@ final: prev: { index-state-hashes = import indexStateHashesPath; inherit (final.buildPackages.haskell-nix) haskellLib; pkgs = final.buildPackages.pkgs; - inherit (final.buildPackages.pkgs) runCommand cacert; + inherit (final.buildPackages.pkgs) cacert; }; # Loads a plan and filters the package directories using cleanSourceWith diff --git a/overlays/patches/ghc/ghc-9.8.4-remove-unused-containers-h-include13709.diff b/overlays/patches/ghc/ghc-9.8.4-remove-unused-containers-h-include13709.diff new file mode 100644 index 000000000..75b7747ba --- /dev/null +++ b/overlays/patches/ghc/ghc-9.8.4-remove-unused-containers-h-include13709.diff @@ -0,0 +1,156 @@ +diff --git a/.gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py b/.gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py +index 6d97bda61c3037cecbe5f7fad42115927aa1a787..90b52076f37089e9bce8c1a55d49f757a6d178ff 100755 +--- a/.gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ++++ b/.gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py +@@ -36,6 +36,7 @@ import os + import yaml + import gitlab + from urllib.request import urlopen ++from urllib.parse import urlparse + import hashlib + import sys + import json +@@ -80,7 +81,7 @@ source_artifact = Artifact('source-tarball' + test_artifact = Artifact('source-tarball' + , 'ghc-{version}-testsuite.tar.xz' + , 'ghc-{version}-testsuite.tar.xz' +- , 'ghc-{version}' ) ++ , 'ghc-{version}/testsuite' ) + + def debian(arch, n): + return linux_platform(arch, "{arch}-linux-deb{n}".format(arch=arch, n=n)) +@@ -156,13 +157,18 @@ def mk_one_metadata(release_mode, version, job_map, artifact): + eprint(f"Bindist URL: {url}") + eprint(f"Download URL: {final_url}") + +- #Download and hash from the release pipeline, this must not change anyway during upload. ++ # Download and hash from the release pipeline, this must not change anyway during upload. + h = download_and_hash(url) + + res = { "dlUri": final_url + , "dlSubdir": artifact.subdir.format(version=version) +- , "dlOutput": artifact.output_name.format(version=version) + , "dlHash" : h } ++ ++ # Only add dlOutput if it is inconsistent with the filename inferred from the URL ++ output = artifact.output_name.format(version=version) ++ if Path(urlparse(final_url).path).name != output: ++ res["dlOutput"] = output ++ + eprint(res) + return res + +diff --git a/compiler/GHC/Data/Word64Map.hs b/compiler/GHC/Data/Word64Map.hs +index 3893313b5e9e79748f7595ecc1cb03c6536fa54f..b5034ca9f528d77c5571f4bd771edc5e6184d8c5 100644 +--- a/compiler/GHC/Data/Word64Map.hs ++++ b/compiler/GHC/Data/Word64Map.hs +@@ -8,7 +8,6 @@ + {-# LANGUAGE MonoLocalBinds #-} + #endif + +-#include "containers.h" + + ----------------------------------------------------------------------------- + -- | +diff --git a/compiler/GHC/Data/Word64Map/Internal.hs b/compiler/GHC/Data/Word64Map/Internal.hs +index 6e60b7f5464aba8f4971ab876ccc698c2415b997..9dd92fb9efdd4b9f402cc595ca1e326bd60803dd 100644 +--- a/compiler/GHC/Data/Word64Map/Internal.hs ++++ b/compiler/GHC/Data/Word64Map/Internal.hs +@@ -14,7 +14,6 @@ + {-# OPTIONS_HADDOCK not-home #-} + {-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-} + +-#include "containers.h" + + ----------------------------------------------------------------------------- + -- | +diff --git a/compiler/GHC/Data/Word64Map/Lazy.hs b/compiler/GHC/Data/Word64Map/Lazy.hs +index 0df84842e2a7ce2c6aacb91c404b8a8f3f5c512e..0c09f62937f4115f50cced65f0ba3c35090c2f7b 100644 +--- a/compiler/GHC/Data/Word64Map/Lazy.hs ++++ b/compiler/GHC/Data/Word64Map/Lazy.hs +@@ -3,7 +3,6 @@ + {-# LANGUAGE Safe #-} + #endif + +-#include "containers.h" + + ----------------------------------------------------------------------------- + -- | +diff --git a/compiler/GHC/Data/Word64Map/Strict.hs b/compiler/GHC/Data/Word64Map/Strict.hs +index 4de68d7f7c39560fffd7c5935042446311054574..ab7c1471fba741ab070f3ee47a0e13ccd7b615d1 100644 +--- a/compiler/GHC/Data/Word64Map/Strict.hs ++++ b/compiler/GHC/Data/Word64Map/Strict.hs +@@ -4,8 +4,6 @@ + {-# LANGUAGE Trustworthy #-} + #endif + +-#include "containers.h" +- + ----------------------------------------------------------------------------- + -- | + -- Module : Data.Word64Map.Strict +diff --git a/compiler/GHC/Data/Word64Map/Strict/Internal.hs b/compiler/GHC/Data/Word64Map/Strict/Internal.hs +index 1605565c9fd7a527fac61dbf162ce0a805f4f920..d998e6b6a9778e4aa3750d01b8b38a7a3eb6f104 100644 +--- a/compiler/GHC/Data/Word64Map/Strict/Internal.hs ++++ b/compiler/GHC/Data/Word64Map/Strict/Internal.hs +@@ -4,8 +4,6 @@ + + {-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-} + +-#include "containers.h" +- + ----------------------------------------------------------------------------- + -- | + -- Module : Data.Word64Map.Strict.Internal +diff --git a/compiler/GHC/Data/Word64Set.hs b/compiler/GHC/Data/Word64Set.hs +index 81cfcbd4efbab00fc203a5da905c0c0ccd9abb11..3c5c047d948e339de596d0fc729ae0534a229b7a 100644 +--- a/compiler/GHC/Data/Word64Set.hs ++++ b/compiler/GHC/Data/Word64Set.hs +@@ -3,8 +3,6 @@ + {-# LANGUAGE Safe #-} + #endif + +-#include "containers.h" +- + ----------------------------------------------------------------------------- + -- | + -- Module : Data.Word64Set +diff --git a/compiler/GHC/Data/Word64Set/Internal.hs b/compiler/GHC/Data/Word64Set/Internal.hs +index b2df095adfb1f363ed0fdfebc1516c5b699b8106..569c312840a4bd8cadefb05a0e29210eef75d2c5 100644 +--- a/compiler/GHC/Data/Word64Set/Internal.hs ++++ b/compiler/GHC/Data/Word64Set/Internal.hs +@@ -12,8 +12,6 @@ + + {-# OPTIONS_HADDOCK not-home #-} + +-#include "containers.h" +- + ----------------------------------------------------------------------------- + -- | + -- Module : Data.Word64Set.Internal +diff --git a/compiler/GHC/Utils/Containers/Internal/BitUtil.hs b/compiler/GHC/Utils/Containers/Internal/BitUtil.hs +index b7484cfc2e07b00b717e64f507aed0779c39f649..3d938b64e434ccdd4de7fbb0aa6c1651d911ee27 100644 +--- a/compiler/GHC/Utils/Containers/Internal/BitUtil.hs ++++ b/compiler/GHC/Utils/Containers/Internal/BitUtil.hs +@@ -6,8 +6,6 @@ + {-# LANGUAGE Safe #-} + #endif + +-#include "containers.h" +- + ----------------------------------------------------------------------------- + -- | + -- Module : Utils.Containers.Internal.BitUtil +diff --git a/compiler/GHC/Utils/Containers/Internal/StrictPair.hs b/compiler/GHC/Utils/Containers/Internal/StrictPair.hs +index 65d3780ef071f2b9fc2f4b3ff5502314f6426abd..9a2cf89ca20588c7ecd919072d328673f7888828 100644 +--- a/compiler/GHC/Utils/Containers/Internal/StrictPair.hs ++++ b/compiler/GHC/Utils/Containers/Internal/StrictPair.hs +@@ -3,8 +3,6 @@ + {-# LANGUAGE Safe #-} + #endif + +-#include "containers.h" +- + -- | A strict pair + + module GHC.Utils.Containers.Internal.StrictPair (StrictPair(..), toPair) where diff --git a/test/th-dlls/default.nix b/test/th-dlls/default.nix index be6343552..9e2ac540a 100644 --- a/test/th-dlls/default.nix +++ b/test/th-dlls/default.nix @@ -22,6 +22,11 @@ in recurseIntoAttrs { meta.disabled = stdenv.hostPlatform.isGhcjs # On aarch64 this test also breaks form musl builds (including cross compiles on x86_64-linux) || (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isMusl) + # On for aarch64 cross compile on GHC 9.8.4 this test is fails sometimes for non profiled builds + # (and always for the profiled builds). + # This may be related to the memory allocation changes made in 9.8.4 that + # replace the pool allocator patches we used in earlier versions. + || (compiler-nix-name == "ghc984" && stdenv.buildPlatform.isx86_64 && stdenv.hostPlatform.isAarch64) # Failed to lookup symbol: __aarch64_swp8_acq_rel || (builtins.elem compiler-nix-name ["ghc947" "ghc948"] && haskellLib.isCrossHost && stdenv.hostPlatform.isAarch64) # We have been unable to get windows cross compilation of th-orphans to work for GHC 8.10 using the latest nixpkgs