Skip to content

Commit

Permalink
ghc-9.12.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
shayne-fletcher committed Dec 16, 2024
1 parent 0300c19 commit 8ef8c9d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ormolu-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: haskell-actions/run-ormolu@v16
with:
pattern: |
CI.hs
ghc-lib-gen/src/*.hs
# CI.hs
# ghc-lib-gen/src/*.hs
examples/ghc-lib-test-utils/src/*.hs
mode: check
22 changes: 14 additions & 8 deletions CI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ data DaFlavor = DaFlavor

-- Last tested gitlab.haskell.org/ghc/ghc.git at
current :: String
current = "caaf53881d5cc82ebff617f39ad5363429d2eccf" -- 2024-11-25
current = "bfacc086604c18e30758772a05a8c81e3a4e01bc" -- 2024-12-16

ghcFlavorOpt :: GhcFlavor -> String
ghcFlavorOpt = \case
Expand Down Expand Up @@ -349,13 +349,19 @@ buildDists ghcFlavor noGhcCheckout noBuilds versionSuffix = do
pkg_ghclib_parser = "ghc-lib-parser-" ++ version
ghcFlavorArg = ghcFlavorOpt ghcFlavor

system_ "cabal build exe:ghc-lib-gen"
system_ $ "cabal run exe:ghc-lib-gen -- ghc ../patches --ghc-lib-parser " ++ ghcFlavorArg ++ " " ++ cppOpts ghcFlavor
#if __GLASGOW_HASKELL__ < 912
let extraCabalFlags = ""
#else
let extraCabalFlags = "--allow-newer=\"hashable:base,unordered-containers:template-haskell\" "
#endif

system_ $ "cabal build " ++ extraCabalFlags ++ "exe:ghc-lib-gen"
system_ $ "cabal run " ++ extraCabalFlags ++ "exe:ghc-lib-gen -- ghc ../patches --ghc-lib-parser " ++ ghcFlavorArg ++ " " ++ cppOpts ghcFlavor
patchVersion version "ghc/ghc-lib-parser.cabal"
mkTarball pkg_ghclib_parser
renameDirectory pkg_ghclib_parser "ghc-lib-parser"
removeFile "ghc/ghc-lib-parser.cabal"
system_ $ "cabal run exe:ghc-lib-gen -- ghc ../patches --ghc-lib " ++ ghcFlavorArg ++ " " ++ cppOpts ghcFlavor ++ " --skip-init"
system_ $ "cabal run " ++ extraCabalFlags ++ "exe:ghc-lib-gen -- ghc ../patches --ghc-lib " ++ ghcFlavorArg ++ " " ++ cppOpts ghcFlavor ++ " --skip-init"
patchVersion version "ghc/ghc-lib.cabal"
patchConstraints version "ghc/ghc-lib.cabal"
mkTarball pkg_ghclib
Expand Down Expand Up @@ -413,16 +419,16 @@ buildDists ghcFlavor noGhcCheckout noBuilds versionSuffix = do

system_ $ "cd examples/ghc-lib-test-mini-hlint && cabal test --project-dir ../.. --test-show-details direct --test-options \"--color always --test-command ../../ghc-lib-test-mini-hlint " ++ ghcFlavorArg ++ "\""
system_ $ "cd examples/ghc-lib-test-mini-compile && cabal test --project-dir ../.. --test-show-details direct --test-options \"--color always --test-command ../../ghc-lib-test-mini-compile " ++ ghcFlavorArg ++ "\""
system_ "cabal exec -- ghc -ignore-dot-ghci -package=ghc-lib-parser -e \"print 1\""
system_ "cabal exec -- ghc -ignore-dot-ghci -package=ghc-lib -e \"print 1\""
system_ "cabal -v0 exec -- ghc -ignore-dot-ghci -package=ghc-lib-parser -e \"print 1\""
system_ "cabal -v0 exec -- ghc -ignore-dot-ghci -package=ghc-lib -e \"print 1\""

-- Something like, "8.8.1.20190828".
tag -- The return value of type 'IO string'.
where
writeCabalCmdFile :: String -> IO ()
writeCabalCmdFile exe = do
let filename = exe
cmd = "cabal run exe:" ++ exe ++ " --project-dir ../.. -- "
cmd = "cabal -v0 run exe:" ++ exe ++ " --project-dir ../.. -- "
writeFile filename cmd

cmd :: String -> IO ()
Expand Down Expand Up @@ -498,7 +504,7 @@ buildDists ghcFlavor noGhcCheckout noBuilds versionSuffix = do

branch :: GhcFlavor -> String
branch = \case
Ghc9121 -> "ghc-9.12"
Ghc9121 -> "ghc-9.12.1-release"
Ghc9101 -> "ghc-9.10.1-release"
Ghc984 -> "ghc-9.8.4-release"
Ghc983 -> "ghc-9.8.3-release"
Expand Down
26 changes: 19 additions & 7 deletions ghc-lib-gen/src/Ghclibgen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ ghcNumericVersion = do

cabalPackageDb :: String -> IO String
cabalPackageDb ghcNumericVersion = do
cabalStoreDir <- replace "\\" "\\\\" <$> systemOutput_ "cabal path --store-dir"
cabalStoreDir <- replace "\\" "\\\\" <$> systemOutput_ "cabal -v0 path --store-dir"
ghcInfo <- getGhcInfo
let ghcInfoMap = Map.fromList ghcInfo
let ghcDir =
Expand Down Expand Up @@ -1198,12 +1198,12 @@ baseBounds = \case
Ghc984 -> "base >= 4.17 && < 4.20" -- [ghc-9.4.1, ghc-9.10.1)
-- base-4.20.0.0
Ghc9101 -> "base >= 4.18 && < 4.21" -- [ghc-9.6.1, ghc-9.12.1)
-- base-4.20.0.0 TODO bump
Ghc9121 -> "base >= 4.18 && < 4.21" -- [ghc-9.6.1, ghc-9.12.1)
-- base-4.21.0.0 TODO bump
Ghc9121 -> "base >= 4.19 && < 4.22" -- [ghc-9.8.1, ghc-9.14.1)
GhcMaster ->
-- e.g. "9.11.20230119"
-- (c.f. 'rts/include/ghcversion.h')
"base >= 4.18 && < 4.21" -- [ghc-9.6.1, ghc-9.12.1)
"base >= 4.19 && < 4.22" -- [ghc-9.8.1, ghc-9.14.1)

-- Common build dependencies.
commonBuildDepends :: GhcFlavor -> Data.List.NonEmpty.NonEmpty String
Expand All @@ -1214,7 +1214,7 @@ commonBuildDepends ghcFlavor =
base = [baseBounds ghcFlavor]
specific
| ghcSeries ghcFlavor >= GHC_9_12 =
[ "ghc-prim > 0.2 && < 0.12",
[ "ghc-prim > 0.2 && < 0.14",
"containers >= 0.6.2.1 && < 0.8",
"bytestring >= 0.11.4 && < 0.13",
"time >= 1.4 && < 1.15",
Expand Down Expand Up @@ -1308,7 +1308,11 @@ libBinParserLibModules ghcFlavor = do
return (lib, [bin], parserModules, libModules)
where
keptGhcInternalModules :: [String]
#if __GLASGOW_HASKELL__ >= 912
keptGhcInternalModules = []
#else
keptGhcInternalModules = ["GHC.Internal.ForeignSrcLang", "GHC.Internal.LanguageExtensions", "GHC.Internal.Lexeme", "GHC.Internal.TH.Syntax", "GHC.Internal.TH.Ppr", "GHC.Internal.TH.PprLib", "GHC.Internal.TH.Lib.Map"]
#endif

filterGhcInternalModules :: [String] -> [String]
filterGhcInternalModules mods =
Expand Down Expand Up @@ -1546,12 +1550,20 @@ generatePrerequisites ghcFlavor = do
=<< readFile' "./mk/get-win32-tarballs.sh"
)

-- When there is a new GHC release it takes time for package bounds
-- to get updated.
#if __GLASGOW_HASKELL__ < 912
let hadrianExtraCabalFlags = ""
#else
let hadrianExtraCabalFlags = "--allow-newer "
#endif

system_ "bash -c ./boot"
system_ "bash -c \"./configure --enable-tarballs-autodownload\""
withCurrentDirectory "hadrian" $ do
system_ "cabal build exe:hadrian --ghc-options=-j"
system_ $ "cabal build " ++ hadrianExtraCabalFlags ++ "exe:hadrian --ghc-options=-j"
system_ . unwords . join $
[ [ "cabal run exe:hadrian --",
[ [ "cabal run " ++ hadrianExtraCabalFlags ++ "exe:hadrian --",
"--directory=..",
"--build-root=ghc-lib"
],
Expand Down

0 comments on commit 8ef8c9d

Please sign in to comment.