From ef3d20f83499cf129b1cacac07906b8d6188fc17 Mon Sep 17 00:00:00 2001 From: Matthew Pickering <matthewtpickering@gmail.com> Date: Wed, 1 Nov 2023 11:35:30 +0000 Subject: [PATCH] Compatibility with 9.8.1 as boot compiler This fixes several compatability issues when using 9.8.1 as the boot compiler. * An incorrect version guard on the stack decoding logic in ghc-heap * Some ghc-prim bounds need relaxing * ghc is no longer wired in, so we have to remove the -this-unit-id ghc call. Fixes #24077 --- hadrian/src/Settings/Packages.hs | 4 +++- libraries/ghc-heap/GHC/Exts/Stack.hs | 2 +- libraries/ghc-heap/GHC/Exts/Stack/Constants.hsc | 2 +- libraries/ghc-heap/GHC/Exts/Stack/Decode.hs | 2 +- libraries/ghc-heap/ghc-heap.cabal.in | 2 +- libraries/ghci/ghci.cabal.in | 2 +- linters/lint-whitespace/lint-whitespace.cabal | 2 +- linters/linters-common/linters-common.cabal | 2 +- 8 files changed, 10 insertions(+), 8 deletions(-) diff --git a/hadrian/src/Settings/Packages.hs b/hadrian/src/Settings/Packages.hs index 54b943ed58d9..cee1ee8b1d8e 100644 --- a/hadrian/src/Settings/Packages.hs +++ b/hadrian/src/Settings/Packages.hs @@ -10,6 +10,7 @@ import Settings.Builders.Common (wayCcArgs) import GHC.Toolchain.Target import GHC.Platform.ArchOS +import Data.Version.Extra -- | Package-specific command-line arguments. packageArgs :: Args @@ -33,6 +34,7 @@ packageArgs = do cursesLibraryDir <- getSetting CursesLibDir ffiIncludeDir <- getSetting FfiIncludeDir ffiLibraryDir <- getSetting FfiLibDir + stageVersion <- readVersion <$> (expr $ ghcVersionStage stage) mconcat --------------------------------- base --------------------------------- @@ -83,7 +85,7 @@ packageArgs = do -- not being fixed to `ghc`, when building stage0, we must set -- -this-unit-id to `ghc` because the boot compiler expects that. -- We do it through a cabal flag in ghc.cabal - , stage0 ? arg "+hadrian-stage0" + , stageVersion < makeVersion [9,8,1] ? arg "+hadrian-stage0" , flag StaticLibzstd `cabalFlag` "static-libzstd" ] diff --git a/libraries/ghc-heap/GHC/Exts/Stack.hs b/libraries/ghc-heap/GHC/Exts/Stack.hs index 90081a522a65..bc9f2402d0c9 100644 --- a/libraries/ghc-heap/GHC/Exts/Stack.hs +++ b/libraries/ghc-heap/GHC/Exts/Stack.hs @@ -1,5 +1,5 @@ {-# LANGUAGE CPP #-} -#if MIN_TOOL_VERSION_ghc(9,7,0) +#if MIN_TOOL_VERSION_ghc(9,9,0) {-# LANGUAGE RecordWildCards #-} module GHC.Exts.Stack diff --git a/libraries/ghc-heap/GHC/Exts/Stack/Constants.hsc b/libraries/ghc-heap/GHC/Exts/Stack/Constants.hsc index 19a4da9dc5ce..28ba7c6e9617 100644 --- a/libraries/ghc-heap/GHC/Exts/Stack/Constants.hsc +++ b/libraries/ghc-heap/GHC/Exts/Stack/Constants.hsc @@ -3,7 +3,7 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} module GHC.Exts.Stack.Constants where -#if MIN_TOOL_VERSION_ghc(9,7,0) +#if MIN_TOOL_VERSION_ghc(9,9,0) import Prelude diff --git a/libraries/ghc-heap/GHC/Exts/Stack/Decode.hs b/libraries/ghc-heap/GHC/Exts/Stack/Decode.hs index 8a01d12a324b..1c49a6eb7b97 100644 --- a/libraries/ghc-heap/GHC/Exts/Stack/Decode.hs +++ b/libraries/ghc-heap/GHC/Exts/Stack/Decode.hs @@ -1,5 +1,5 @@ {-# LANGUAGE CPP #-} -#if MIN_TOOL_VERSION_ghc(9,7,0) +#if MIN_TOOL_VERSION_ghc(9,9,0) {-# LANGUAGE BangPatterns #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE FlexibleInstances #-} diff --git a/libraries/ghc-heap/ghc-heap.cabal.in b/libraries/ghc-heap/ghc-heap.cabal.in index f4cb2dee2f9a..45d433fd7e02 100644 --- a/libraries/ghc-heap/ghc-heap.cabal.in +++ b/libraries/ghc-heap/ghc-heap.cabal.in @@ -23,7 +23,7 @@ library default-language: Haskell2010 build-depends: base >= 4.9.0 && < 5.0 - , ghc-prim > 0.2 && < 0.11 + , ghc-prim > 0.2 && < 0.12 , rts == 1.0.* , containers >= 0.6.2.1 && < 0.7 diff --git a/libraries/ghci/ghci.cabal.in b/libraries/ghci/ghci.cabal.in index 87da371f20c9..565b4198dea3 100644 --- a/libraries/ghci/ghci.cabal.in +++ b/libraries/ghci/ghci.cabal.in @@ -76,7 +76,7 @@ library rts, array == 0.5.*, base >= 4.8 && < 4.20, - ghc-prim >= 0.5.0 && < 0.11, + ghc-prim >= 0.5.0 && < 0.12, binary == 0.8.*, bytestring >= 0.10 && < 0.13, containers >= 0.5 && < 0.7, diff --git a/linters/lint-whitespace/lint-whitespace.cabal b/linters/lint-whitespace/lint-whitespace.cabal index 61e376d1f96e..e4fab0631e02 100644 --- a/linters/lint-whitespace/lint-whitespace.cabal +++ b/linters/lint-whitespace/lint-whitespace.cabal @@ -28,4 +28,4 @@ executable lint-whitespace base >= 4.14 && < 5, text - >= 1.2 && < 2.1, + >= 1.2 && < 3, diff --git a/linters/linters-common/linters-common.cabal b/linters/linters-common/linters-common.cabal index 02245750dd19..eea509a207c6 100644 --- a/linters/linters-common/linters-common.cabal +++ b/linters/linters-common/linters-common.cabal @@ -16,7 +16,7 @@ library base >= 4.14 && < 5, text - >= 1.2 && < 2.1, + >= 1.2 && < 3, deepseq >= 1.1, -- GitLab