Skip to content

Commit

Permalink
alex < 3.5.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shayne-fletcher committed Dec 31, 2024
1 parent 4aa72b9 commit 245912d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
14 changes: 4 additions & 10 deletions CI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ data DaFlavor = DaFlavor

-- Last tested gitlab.haskell.org/ghc/ghc.git at
current :: String
current = "8b266671bcfe9ef5a25f0a78ea7dcca68b78dc32" -- 2024-12-19
current = "278a53ee698d961d97afb60be9db2d8bf60b4074" -- 2024-12-30

ghcFlavorOpt :: GhcFlavor -> String
ghcFlavorOpt = \case
Expand Down Expand Up @@ -358,19 +358,13 @@ buildDists ghcFlavor noGhcCheckout noBuilds versionSuffix = do
pkg_ghclib_parser = "ghc-lib-parser-" ++ version
ghcFlavorArg = ghcFlavorOpt 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
system_ $ "cabal build " ++ "exe:ghc-lib-gen"
system_ $ "cabal run " ++ "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 " ++ extraCabalFlags ++ "exe:ghc-lib-gen -- ghc ../patches --ghc-lib " ++ ghcFlavorArg ++ " " ++ cppOpts ghcFlavor ++ " --skip-init"
system_ $ "cabal run " ++ "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
4 changes: 2 additions & 2 deletions ghc-lib-gen.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ executable ghc-lib-gen
executable ghc-lib-build-tool
import: base
if impl (ghc > 9.12.0)
build-tool-depends: alex:alex, happy:happy == 1.20.* || == 2.0.2 || >= 2.1.2 && < 2.2
build-tool-depends: alex:alex < 3.5.2.0, happy:happy == 1.20.* || == 2.0.2 || >= 2.1.2 && < 2.2
else
build-tool-depends: alex:alex, happy:happy < 2.0
build-tool-depends: alex:alex < 3.5.2.0, happy:happy < 2.0
build-depends:
directory, filepath, time, extra, optparse-applicative
if flag(semaphore-compat)
Expand Down
6 changes: 3 additions & 3 deletions ghc-lib-gen/src/Ghclibgen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ libBinParserLibModules ghcFlavor = do

happyBounds :: GhcFlavor -> String
happyBounds ghcFlavor
| series < GHC_9_8 = "== 1.20.*"
| series < GHC_9_8 = "< 1.21"
| otherwise = "== 1.20.* || == 2.0.2 || >= 2.1.2 && < 2.2" -- c.f. m4/fptools_happy.m4
where
series = ghcSeries ghcFlavor
Expand Down Expand Up @@ -1393,7 +1393,7 @@ generateGhcLibCabal ghcFlavor customCppOpts = do
" build-depends:"
],
indent2 (Data.List.NonEmpty.toList (withCommas (ghcLibBuildDepends ghcFlavor))),
[" build-tool-depends: alex:alex >= 3.1, " ++ "happy:happy " ++ happyBounds ghcFlavor],
[" build-tool-depends: alex:alex >= 3.1 && < 3.5.2.0, " ++ "happy:happy " ++ happyBounds ghcFlavor],
[" other-extensions:"],
indent2 (askField lib "other-extensions:"),
[" default-extensions:"],
Expand Down Expand Up @@ -1513,7 +1513,7 @@ generateGhcLibParserCabal ghcFlavor customCppOpts = do
[ " if impl(ghc >= 9.10)",
" build-depends: ghc-internal"
],
[" build-tool-depends: alex:alex >= 3.1, " ++ "happy:happy " ++ happyBounds ghcFlavor],
[" build-tool-depends: alex:alex >= 3.1 && < 3.5.2.0, " ++ "happy:happy " ++ happyBounds ghcFlavor],
[" other-extensions:"],
indent2 (askField lib "other-extensions:"),
[" default-extensions:"],
Expand Down

0 comments on commit 245912d

Please sign in to comment.