summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-01-24 02:00:23 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2022-02-09 22:39:26 +0000
commit30a8ad85bfe369a1ec180ba44885ba119a23dd38 (patch)
tree476c3fa17b699d44e309f5a220189d17532e3877
parent1dbe5b2a97c41b3f24a48372ba25faeae08e8cd6 (diff)
downloadhaskell-30a8ad85bfe369a1ec180ba44885ba119a23dd38.tar.gz
Bump Cabal submodulewip/bump-cabal
Adapts GHC to the factoring-out of `Cabal-syntax`. Fixes #20991. Metric Decrease: haddock.Cabal
-rw-r--r--ghc.mk3
-rw-r--r--hadrian/src/Packages.hs5
-rw-r--r--hadrian/src/Settings/Default.hs1
m---------libraries/Cabal0
-rw-r--r--utils/ghc-cabal/Main.hs3
-rw-r--r--utils/ghc-cabal/ghc-cabal.cabal11
-rw-r--r--utils/ghc-cabal/ghc.mk14
-rw-r--r--utils/ghc-pkg/ghc-pkg.cabal.in1
8 files changed, 18 insertions, 20 deletions
diff --git a/ghc.mk b/ghc.mk
index cf4ca7dcad..683a04d571 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -420,7 +420,7 @@ else # CLEANING
# programs such as GHC and ghc-pkg, that we do not assume the stage0
# compiler already has installed (or up-to-date enough).
# Note that these must be given in topological order.
-PACKAGES_STAGE0 = binary transformers mtl hpc ghc-boot-th ghc-boot template-haskell text parsec Cabal/Cabal ghc-heap exceptions ghci
+PACKAGES_STAGE0 = binary transformers mtl hpc ghc-boot-th ghc-boot template-haskell text parsec Cabal/Cabal-syntax Cabal/Cabal ghc-heap exceptions ghci
ifeq "$(Windows_Host)" "NO"
PACKAGES_STAGE0 += terminfo
endif
@@ -454,6 +454,7 @@ PACKAGES_STAGE1 += mtl
PACKAGES_STAGE1 += ghc-boot
PACKAGES_STAGE1 += text
PACKAGES_STAGE1 += parsec
+PACKAGES_STAGE1 += Cabal/Cabal-syntax
PACKAGES_STAGE1 += Cabal/Cabal
PACKAGES_STAGE1 += ghc-compact
PACKAGES_STAGE1 += ghc-heap
diff --git a/hadrian/src/Packages.hs b/hadrian/src/Packages.hs
index cafea5ff69..a44e3cd95e 100644
--- a/hadrian/src/Packages.hs
+++ b/hadrian/src/Packages.hs
@@ -1,7 +1,7 @@
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
module Packages (
-- * GHC packages
- array, base, binary, bytestring, cabal, checkPpr,
+ array, base, binary, bytestring, cabal, cabalSyntax, checkPpr,
checkExact, countDeps,
compareSizes, compiler, containers, deepseq, deriveConstants, directory,
exceptions, filepath, genapply, genprimopcode, ghc, ghcBignum, ghcBoot, ghcBootTh,
@@ -32,7 +32,7 @@ import Oracles.Setting
-- packages and modify build default build conditions in "UserSettings".
ghcPackages :: [Package]
ghcPackages =
- [ array, base, binary, bytestring, cabal, checkPpr, checkExact, countDeps
+ [ array, base, binary, bytestring, cabalSyntax, cabal, checkPpr, checkExact, countDeps
, compareSizes, compiler, containers, deepseq, deriveConstants, directory
, exceptions, filepath, genapply, genprimopcode, ghc, ghcBignum, ghcBoot, ghcBootTh
, ghcCompact, ghcHeap, ghci, ghciWrapper, ghcPkg, ghcPrim, haddock, haskeline, hsc2hs
@@ -50,6 +50,7 @@ array = lib "array"
base = lib "base"
binary = lib "binary"
bytestring = lib "bytestring"
+cabalSyntax = lib "Cabal-syntax" `setPath` "libraries/Cabal/Cabal-syntax"
cabal = lib "Cabal" `setPath` "libraries/Cabal/Cabal"
checkPpr = util "check-ppr"
checkExact = util "check-exact"
diff --git a/hadrian/src/Settings/Default.hs b/hadrian/src/Settings/Default.hs
index 36a1ed0d8e..8c490347b9 100644
--- a/hadrian/src/Settings/Default.hs
+++ b/hadrian/src/Settings/Default.hs
@@ -62,6 +62,7 @@ stage0Packages :: Action [Package]
stage0Packages = do
cross <- flag CrossCompiling
return $ [ binary
+ , cabalSyntax
, cabal
, compareSizes
, compiler
diff --git a/libraries/Cabal b/libraries/Cabal
-Subproject 9d9fe65d1e6db56004a00f1908207d5ea4ed18d
+Subproject d638e33dbc056048b393964286c7fe394b2730d
diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs
index 0514af148d..20ee539e0a 100644
--- a/utils/ghc-cabal/Main.hs
+++ b/utils/ghc-cabal/Main.hs
@@ -8,12 +8,12 @@ import qualified Distribution.ModuleName as ModuleName
import Distribution.PackageDescription
import Distribution.PackageDescription.Check hiding (doesFileExist)
import Distribution.PackageDescription.Configuration
-import Distribution.PackageDescription.Parsec
import Distribution.Package
import Distribution.Simple
import Distribution.Simple.Configure
import Distribution.Simple.LocalBuildInfo
import Distribution.Simple.GHC
+import Distribution.Simple.PackageDescription
import Distribution.Simple.Program
import Distribution.Simple.Program.HcPkg
import Distribution.Simple.Setup (ConfigFlags(configStripLibs), fromFlagOrDefault, toFlag)
@@ -413,6 +413,7 @@ generate directory distdir config_args
mkLibraryRelDir "rts" = "rts/dist-install/build"
mkLibraryRelDir "ghc" = "compiler/stage2/build"
mkLibraryRelDir "Cabal" = "libraries/Cabal/Cabal/dist-install/build"
+ mkLibraryRelDir "Cabal-syntax" = "libraries/Cabal/Cabal-syntax/dist-install/build"
mkLibraryRelDir "containers" = "libraries/containers/containers/dist-install/build"
mkLibraryRelDir l = "libraries/" ++ l ++ "/dist-install/build"
libraryRelDirs = map mkLibraryRelDir transitiveDepNames
diff --git a/utils/ghc-cabal/ghc-cabal.cabal b/utils/ghc-cabal/ghc-cabal.cabal
index bdf638ee47..537b5e357b 100644
--- a/utils/ghc-cabal/ghc-cabal.cabal
+++ b/utils/ghc-cabal/ghc-cabal.cabal
@@ -19,8 +19,9 @@ Executable ghc-cabal
Default-Language: Haskell2010
Main-Is: Main.hs
- Build-Depends: base >= 3 && < 5,
- bytestring >= 0.10 && < 0.12,
- Cabal >= 3.2 && < 3.8,
- directory >= 1.1 && < 1.4,
- filepath >= 1.2 && < 1.5
+ Build-Depends: base >= 3 && < 5,
+ bytestring >= 0.10 && < 0.12,
+ Cabal >= 3.7 && < 3.8,
+ Cabal-syntax >= 3.7 && < 3.8,
+ directory >= 1.1 && < 1.4,
+ filepath >= 1.2 && < 1.5
diff --git a/utils/ghc-cabal/ghc.mk b/utils/ghc-cabal/ghc.mk
index ca1cda5307..035ee8adaa 100644
--- a/utils/ghc-cabal/ghc.mk
+++ b/utils/ghc-cabal/ghc.mk
@@ -37,21 +37,12 @@ ifneq "$(BINDIST)" "YES"
$(ghc-cabal_INPLACE) : $(ghc-cabal_DIST_BINARY) | $$(dir $$@)/.
"$(CP)" $< $@
-# Minor hack, since we can't reuse the `hs-suffix-rules-srcdir` macro
-ifneq ($(wildcard libraries/Cabal/Cabal/src/Distribution/Fields/Lexer.x),)
-# Lexer.x exists so we have to call Alex ourselves
-CABAL_LEXER_DEP := bootstrapping/Cabal/src/Distribution/Fields/Lexer.hs
-
-bootstrapping/Cabal/src/Distribution/Fields/Lexer.hs: libraries/Cabal/Cabal/src/Distribution/Fields/Lexer.x
- mkdir -p bootstrapping/Cabal/src/Distribution/Fields
- $(call cmd,ALEX) $< -o $@
-else
-CABAL_LEXER_DEP := libraries/Cabal/Cabal/src/Distribution/Fields/Lexer.hs
-endif
+CABAL_LEXER_DEP := libraries/Cabal/Cabal-syntax/src/Distribution/Fields/Lexer.hs
$(ghc-cabal_DIST_BINARY): $(wildcard libraries/Cabal/Cabal/src/Distribution/*/*/*.hs)
$(ghc-cabal_DIST_BINARY): $(wildcard libraries/Cabal/Cabal/src/Distribution/*/*.hs)
$(ghc-cabal_DIST_BINARY): $(wildcard libraries/Cabal/Cabal/src/Distribution/*.hs)
+$(ghc-cabal_DIST_BINARY): $(wildcard libraries/Cabal/Cabal-syntax/src/Distribution/*.hs)
# N.B. Compile with -O0 since this is not a performance-critical executable
# and the Cabal takes nearly twice as long to build with -O1. See #16817.
@@ -73,6 +64,7 @@ $(ghc-cabal_DIST_BINARY): $(CABAL_LEXER_DEP) utils/ghc-cabal/Main.hs $(TOUCH_DEP
-hidir bootstrapping \
$(CABAL_LEXER_DEP) \
-ilibraries/Cabal/Cabal/src \
+ -ilibraries/Cabal/Cabal-syntax/src \
-ilibraries/binary/src \
-ilibraries/filepath \
-ilibraries/hpc \
diff --git a/utils/ghc-pkg/ghc-pkg.cabal.in b/utils/ghc-pkg/ghc-pkg.cabal.in
index d299c98372..4d9402c2d3 100644
--- a/utils/ghc-pkg/ghc-pkg.cabal.in
+++ b/utils/ghc-pkg/ghc-pkg.cabal.in
@@ -31,6 +31,7 @@ Executable ghc-pkg
containers,
filepath,
Cabal,
+ Cabal-syntax,
binary,
ghc-boot,
bytestring