diff --git a/flake.lock b/flake.lock index b72dde2de8..60048cccb0 100644 --- a/flake.lock +++ b/flake.lock @@ -16,23 +16,6 @@ "type": "github" } }, - "cabal-32": { - "flake": false, - "locked": { - "lastModified": 1603716527, - "narHash": "sha256-X0TFfdD4KZpwl0Zr6x+PLxUt/VyKQfX7ylXHdmZIL+w=", - "owner": "haskell", - "repo": "cabal", - "rev": "48bf10787e27364730dd37a42b603cee8d6af7ee", - "type": "github" - }, - "original": { - "owner": "haskell", - "ref": "3.2", - "repo": "cabal", - "type": "github" - } - }, "cabal-34": { "flake": false, "locked": { @@ -388,11 +371,11 @@ "iserv-proxy": { "flake": false, "locked": { - "lastModified": 1755243078, - "narHash": "sha256-GLbl1YaohKdpzZVJFRdcI1O1oE3F3uBer4lFv3Yy0l8=", + "lastModified": 1761801472, + "narHash": "sha256-2aCGboNCF602huvmbyTcfhe6s+D4/n/NlOefd0c0SC0=", "owner": "stable-haskell", "repo": "iserv-proxy", - "rev": "150605195cb7183a6fb7bed82f23fedf37c6f52a", + "rev": "bbee090fc67bb5cc6ad4508fa5def560b7672591", "type": "github" }, "original": { @@ -518,7 +501,6 @@ "root": { "inputs": { "HTTP": "HTTP", - "cabal-32": "cabal-32", "cabal-34": "cabal-34", "cabal-36": "cabal-36", "cardano-shell": "cardano-shell", diff --git a/flake.nix b/flake.nix index b1fa5d5af3..0c7c836efc 100644 --- a/flake.nix +++ b/flake.nix @@ -39,10 +39,6 @@ url = "github:input-output-hk/stackage.nix"; flake = false; }; - cabal-32 = { - url = "github:haskell/cabal/3.2"; - flake = false; - }; cabal-34 = { url = "github:haskell/cabal/3.4"; flake = false; diff --git a/lazy-inputs/ghc913/flake.lock b/lazy-inputs/ghc913/flake.lock index d73af49a22..bbe9374f12 100644 --- a/lazy-inputs/ghc913/flake.lock +++ b/lazy-inputs/ghc913/flake.lock @@ -3,11 +3,11 @@ "ghc913": { "flake": false, "locked": { - "lastModified": 1748027596, - "narHash": "sha256-5WU40R26lwl0lRTkEnWui8CEikZ9gRnbiOa4aw/GbI4=", + "lastModified": 1761689977, + "narHash": "sha256-1+tAiKpeokEzzArog9fs0jEDKitAjwcWT/uGzxdkoe4=", "ref": "refs/heads/master", - "rev": "17db44c5b32fff82ea988fa4f1a233d1a27bdf57", - "revCount": 68114, + "rev": "d69ea8fe2ddb71d9ecae049317d072675bcbfde2", + "revCount": 68582, "submodules": true, "type": "git", "url": "https://gitlab.haskell.org/ghc/ghc" diff --git a/overlays/bootstrap.nix b/overlays/bootstrap.nix index 2da240b20f..a7b115e865 100644 --- a/overlays/bootstrap.nix +++ b/overlays/bootstrap.nix @@ -312,6 +312,8 @@ in { ++ fromUntil "9.8.3" "9.8.4" ./patches/ghc/ghc-9.8.3-text-upper-bound.patch ++ fromUntil "9.10" "9.10.2" ./patches/ghc/ghc-9.10-containers-upper-bound.patch ++ fromUntil "9.10" "9.14" ./patches/ghc/ghc-9.10-merge-objects.patch + ++ fromUntil "9.12" "9.13" ./patches/ghc/ghc-9.12-Cabal-3.14.patch + ++ fromUntil "9.12" "9.13" ./patches/ghc/ghc-9.12-alex-3.5.2.0.patch # This patch will make windows stop emitting absolute relocations. This is one way in which binutils 2.36+ (with ASLR enabled), will just choke on the # assembly we generate because it's always absolute (32bit) addressing modes. @@ -338,7 +340,7 @@ in { # unbreak modern clang with proper _atomic declarations. ++ onAndroid (fromUntil "9.6" "9.6.5" ./patches/ghc/7db8c9927fae3369fc4ecff68f80c4cb32eea757.patch) - ++ onGhcjs (from "9.12" ./patches/ghc/ghc-9.12-ghcjs-rts-mem-heap8.patch) + ++ onGhcjs (fromUntil "9.12" "9.13" ./patches/ghc/ghc-9.12-ghcjs-rts-mem-heap8.patch) # Fix for `fatal error: 'rts/Types.h' file not found` when building `primitive` ++ onGhcjs (from "9.13" ./patches/ghc/ghc-9.13-ghcjs-rts-types.patch) diff --git a/overlays/patches/ghc/ghc-9.12-Cabal-3.14.patch b/overlays/patches/ghc/ghc-9.12-Cabal-3.14.patch new file mode 100644 index 0000000000..3eb8e07f77 --- /dev/null +++ b/overlays/patches/ghc/ghc-9.12-Cabal-3.14.patch @@ -0,0 +1,109 @@ +diff --git a/compiler/Setup.hs b/compiler/Setup.hs +index c7c0850383..3ce6624307 100644 +--- a/compiler/Setup.hs ++++ b/compiler/Setup.hs +@@ -1,3 +1,4 @@ ++{-# LANGUAGE CPP #-} + {-# LANGUAGE RecordWildCards #-} + module Main where + +@@ -11,6 +12,10 @@ import Distribution.Verbosity + import Distribution.Simple.Program + import Distribution.Simple.Utils + import Distribution.Simple.Setup ++import Distribution.Simple.PackageIndex ++#if MIN_VERSION_Cabal(3,14,0) ++import Distribution.Utils.Path (interpretSymbolicPath) ++#endif + + import System.IO + import System.Process +@@ -57,7 +62,11 @@ primopIncls = + ghcAutogen :: Verbosity -> LocalBuildInfo -> IO () + ghcAutogen verbosity lbi@LocalBuildInfo{..} = do + -- Get compiler/ root directory from the cabal file ++#if MIN_VERSION_Cabal(3,14,0) ++ let Just compilerRoot = takeDirectory . interpretSymbolicPath Nothing <$> pkgDescrFile ++#else + let Just compilerRoot = takeDirectory <$> pkgDescrFile ++#endif + + -- Require the necessary programs + (gcc ,withPrograms) <- requireProgram normal gccProgram withPrograms +@@ -77,10 +86,20 @@ ghcAutogen verbosity lbi@LocalBuildInfo{..} = do + -- Call genprimopcode to generate *.hs-incl + forM_ primopIncls $ \(file,command) -> do + contents <- readProcess "genprimopcode" [command] primopsStr ++#if MIN_VERSION_Cabal(3,14,0) ++ rewriteFileEx verbosity (interpretSymbolicPath Nothing (buildDir lbi) file) contents ++#elif MIN_VERSION_Cabal(3,11,0) ++ rewriteFileEx verbosity (buildDir lbi file) contents ++#else + rewriteFileEx verbosity (buildDir file) contents ++#endif + + -- Write GHC.Platform.Constants ++#if MIN_VERSION_Cabal(3,14,0) ++ let platformConstantsPath = interpretSymbolicPath Nothing (autogenPackageModulesDir lbi) "GHC/Platform/Constants.hs" ++#else + let platformConstantsPath = autogenPackageModulesDir lbi "GHC/Platform/Constants.hs" ++#endif + targetOS = case lookup "target os" settings of + Nothing -> error "no target os in settings" + Just os -> os +@@ -95,7 +114,11 @@ ghcAutogen verbosity lbi@LocalBuildInfo{..} = do + _ -> error "Couldn't find unique cabal library when building ghc" + + -- Write GHC.Settings.Config ++#if MIN_VERSION_Cabal(3,14,0) ++ configHsPath = interpretSymbolicPath Nothing (autogenPackageModulesDir lbi) "GHC/Settings/Config.hs" ++#else + configHsPath = autogenPackageModulesDir lbi "GHC/Settings/Config.hs" ++#endif + configHs = generateConfigHs cProjectUnitId settings + createDirectoryIfMissingVerbose verbosity True (takeDirectory configHsPath) + rewriteFileEx verbosity configHsPath configHs +diff --git a/libraries/ghc-boot/Setup.hs b/libraries/ghc-boot/Setup.hs +index 0995ee3f8f..73e6b3e5e7 100644 +--- a/libraries/ghc-boot/Setup.hs ++++ b/libraries/ghc-boot/Setup.hs +@@ -1,3 +1,4 @@ ++{-# LANGUAGE CPP #-} + {-# LANGUAGE RecordWildCards #-} + {-# LANGUAGE LambdaCase #-} + {-# LANGUAGE LambdaCase #-} +@@ -10,6 +11,9 @@ import Distribution.Verbosity + import Distribution.Simple.Program + import Distribution.Simple.Utils + import Distribution.Simple.Setup ++#if MIN_VERSION_Cabal(3,14,0) ++import Distribution.Utils.Path (interpretSymbolicPath) ++#endif + + import System.IO + import System.Directory +@@ -32,12 +36,24 @@ main = defaultMainWithHooks ghcHooks + ghcAutogen :: Verbosity -> LocalBuildInfo -> IO () + ghcAutogen verbosity lbi@LocalBuildInfo{..} = do + -- Get compiler/ root directory from the cabal file ++#if MIN_VERSION_Cabal(3,14,0) ++ let Just compilerRoot = takeDirectory . interpretSymbolicPath Nothing <$> pkgDescrFile ++#else + let Just compilerRoot = takeDirectory <$> pkgDescrFile ++#endif + + let platformHostFile = "GHC/Platform/Host.hs" ++#if MIN_VERSION_Cabal(3,14,0) ++ platformHostPath = interpretSymbolicPath Nothing (autogenPackageModulesDir lbi) platformHostFile ++#else + platformHostPath = autogenPackageModulesDir lbi platformHostFile ++#endif + ghcVersionFile = "GHC/Version.hs" ++#if MIN_VERSION_Cabal(3,14,0) ++ ghcVersionPath = interpretSymbolicPath Nothing (autogenPackageModulesDir lbi) ghcVersionFile ++#else + ghcVersionPath = autogenPackageModulesDir lbi ghcVersionFile ++#endif + + -- Get compiler settings + settings <- lookupEnv "HADRIAN_SETTINGS" >>= \case diff --git a/overlays/patches/ghc/ghc-9.12-alex-3.5.2.0.patch b/overlays/patches/ghc/ghc-9.12-alex-3.5.2.0.patch new file mode 100644 index 0000000000..6c45a05fff --- /dev/null +++ b/overlays/patches/ghc/ghc-9.12-alex-3.5.2.0.patch @@ -0,0 +1,27 @@ +diff --git a/compiler/GHC/Parser/Lexer.x b/compiler/GHC/Parser/Lexer.x +index fe08dc69cd..57157cd8bb 100644 +--- a/compiler/GHC/Parser/Lexer.x ++++ b/compiler/GHC/Parser/Lexer.x +@@ -41,6 +41,7 @@ + -- Alex "Haskell code fragment top" + + { ++{-# LANGUAGE CPP #-} + {-# LANGUAGE ViewPatterns #-} + {-# LANGUAGE LambdaCase #-} + {-# LANGUAGE MultiWayIf #-} +@@ -3471,10 +3472,14 @@ topNoLayoutContainsCommas [] = False + topNoLayoutContainsCommas (ALRLayout _ _ : ls) = topNoLayoutContainsCommas ls + topNoLayoutContainsCommas (ALRNoLayout b _ : _) = b + ++#ifdef MIN_TOOL_VERSION_alex ++#if !MIN_TOOL_VERSION_alex(3,5,2) + -- If the generated alexScan/alexScanUser functions are called multiple times + -- in this file, alexScanUser gets broken out into a separate function and + -- increases memory usage. Make sure GHC inlines this function and optimizes it. + {-# INLINE alexScanUser #-} ++#endif ++#endif + + lexToken :: P (PsLocated Token) + lexToken = do diff --git a/test/cabal.project.local b/test/cabal.project.local index b84eb85d66..c49e13c2dd 100644 --- a/test/cabal.project.local +++ b/test/cabal.project.local @@ -22,7 +22,7 @@ repository head.hackage.ghc.haskell.org f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89 26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d - --sha256: sha256-Tc0SzZeJtkhLr7Fi99RPXBpaW/74/wfUqnfz9E7TJKg= + --sha256: sha256-BXYLDqKdgRe/Spq81B4t4KbYRDJ//BZbHOAp4XF0IqQ= repository ghcjs-overlay url: https://raw.githubusercontent.com/input-output-hk/hackage-overlay-ghcjs/ffb32dce467b9a4d27be759fdd2740a6edd09d0b diff --git a/test/gi-gtk/default.nix b/test/gi-gtk/default.nix index 8ceb1e1f69..5cbfff16b6 100644 --- a/test/gi-gtk/default.nix +++ b/test/gi-gtk/default.nix @@ -27,7 +27,9 @@ in recurseIntoAttrs rec { # Cross compilation to aarch64 is also broken || stdenv.hostPlatform.isAarch64 && !stdenv.buildPlatform.isAarch64 # glu is marked ase broken for isAndroid - || stdenv.hostPlatform.isAndroid; + || stdenv.hostPlatform.isAndroid + # Skip until we update haskell.nix to Cabal 3.16 + || builtins.elem compiler-nix-name ["ghc91320251028"]; ifdInputs = { inherit (project) plan-nix;