summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-06-04 20:37:31 -0400
committerBen Gamari <ben@smart-cactus.org>2019-06-12 08:19:59 -0400
commit381c3ae31b68019177f1cd20cb4da2f9d3b7d6c6 (patch)
tree4d3110e3035a37536cd463046ce5c23d8e00151a
parentbd2d13ff778a4b1b5d793c99229cccfb64d792f3 (diff)
downloadhaskell-381c3ae31b68019177f1cd20cb4da2f9d3b7d6c6.tar.gz
Bump Cabal submodule
(cherry picked from commit ff438786613f07df9b2d43eaeac49b13815d849d) Metric Increase: haddock.Cabal
-rw-r--r--hadrian/src/Hadrian/Haskell/Cabal/Parse.hs20
m---------libraries/Cabal0
-rw-r--r--testsuite/tests/driver/T4437.hs2
-rw-r--r--utils/ghc-cabal/Main.hs21
-rw-r--r--utils/ghctags/ghctags.cabal23
5 files changed, 58 insertions, 8 deletions
diff --git a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
index 347aa99b15..1c54a4e5d6 100644
--- a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
+++ b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
@@ -1,4 +1,3 @@
-{-# OPTIONS_GHC -Wno-deprecations #-}
-----------------------------------------------------------------------------
-- |
-- Module : Hadrian.Haskell.Cabal.Parse
@@ -17,6 +16,7 @@ module Hadrian.Haskell.Cabal.Parse (
import Data.Bifunctor
import Data.List.Extra
import Development.Shake
+import qualified Distribution.Compat.Graph as Graph
import qualified Distribution.ModuleName as C
import qualified Distribution.Package as C
import qualified Distribution.PackageDescription as C
@@ -30,6 +30,7 @@ import qualified Distribution.Simple.Utils as C
import qualified Distribution.Simple.Program.Types as C
import qualified Distribution.Simple.Configure as C (getPersistBuildConfig)
import qualified Distribution.Simple.Build as C
+import qualified Distribution.Types.ComponentLocalBuildInfo as C
import qualified Distribution.Types.ComponentRequestedSpec as C
import qualified Distribution.InstalledPackageInfo as Installed
import qualified Distribution.Simple.PackageIndex as C
@@ -219,7 +220,7 @@ resolveContextData context@Context {..} = do
-- TODO: Get rid of deprecated 'externalPackageDeps' and drop -Wno-deprecations
-- See: https://github.com/snowleopard/hadrian/issues/548
- let extDeps = C.externalPackageDeps lbi'
+ let extDeps = externalPackageDeps lbi'
deps = map (C.display . snd) extDeps
depDirect = map (fromMaybe (error "resolveContextData: depDirect failed")
. C.lookupUnitId (C.installedPkgs lbi') . fst) extDeps
@@ -306,7 +307,20 @@ buildAutogenFiles context = do
getHookedBuildInfo :: [FilePath] -> IO C.HookedBuildInfo
getHookedBuildInfo [] = return C.emptyHookedBuildInfo
getHookedBuildInfo (baseDir:baseDirs) = do
- maybeInfoFile <- C.findHookedPackageDesc baseDir
+ maybeInfoFile <- C.findHookedPackageDesc C.normal baseDir
case maybeInfoFile of
Nothing -> getHookedBuildInfo baseDirs
Just infoFile -> C.readHookedBuildInfo C.silent infoFile
+
+externalPackageDeps :: C.LocalBuildInfo -> [(C.UnitId, C.MungedPackageId)]
+externalPackageDeps lbi =
+ -- TODO: what about non-buildable components?
+ nub [ (ipkgid, pkgid)
+ | clbi <- Graph.toList (C.componentGraph lbi)
+ , (ipkgid, pkgid) <- C.componentPackageDeps clbi
+ , not (internal ipkgid) ]
+ where
+ -- True if this dependency is an internal one (depends on the library
+ -- defined in the same package).
+ internal ipkgid = any ((==ipkgid) . C.componentUnitId) (Graph.toList (C.componentGraph lbi))
+
diff --git a/libraries/Cabal b/libraries/Cabal
-Subproject 5d258537b754005d2a1d170b44d764b63ff4fc7
+Subproject f697d3209990c3314efe840be54fb7c5a967e6f
diff --git a/testsuite/tests/driver/T4437.hs b/testsuite/tests/driver/T4437.hs
index b8ef646a9b..09caa7f3c4 100644
--- a/testsuite/tests/driver/T4437.hs
+++ b/testsuite/tests/driver/T4437.hs
@@ -39,8 +39,6 @@ expectedGhcOnlyExtensions :: [String]
expectedGhcOnlyExtensions = ["RelaxedLayout",
"AlternativeLayoutRule",
"AlternativeLayoutRuleTransitional",
- "EmptyDataDeriving",
- "GeneralisedNewtypeDeriving",
"CUSKs",
"ImportQualifiedPost"]
diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs
index 8b776499fd..0782ead535 100644
--- a/utils/ghc-cabal/Main.hs
+++ b/utils/ghc-cabal/Main.hs
@@ -19,8 +19,10 @@ import Distribution.Simple.Utils (defaultPackageDesc, findHookedPackageDesc, wri
toUTF8LBS)
import Distribution.Simple.Build (writeAutogenFiles)
import Distribution.Simple.Register
+import qualified Distribution.Compat.Graph as Graph
import Distribution.Text
import Distribution.Types.MungedPackageId
+import Distribution.Types.LocalBuildInfo
import Distribution.Verbosity
import qualified Distribution.InstalledPackageInfo as Installed
import qualified Distribution.Simple.PackageIndex as PackageIndex
@@ -251,6 +253,18 @@ updateInstallDirTemplates relocatableBuild myPrefix myLibdir myDocdir idts
htmldir = toPathTemplate "$docdir"
}
+externalPackageDeps :: LocalBuildInfo -> [(UnitId, MungedPackageId)]
+externalPackageDeps lbi =
+ -- TODO: what about non-buildable components?
+ nub [ (ipkgid, pkgid)
+ | clbi <- Graph.toList (componentGraph lbi)
+ , (ipkgid, pkgid) <- componentPackageDeps clbi
+ , not (internal ipkgid) ]
+ where
+ -- True if this dependency is an internal one (depends on the library
+ -- defined in the same package).
+ internal ipkgid = any ((==ipkgid) . componentUnitId) (Graph.toList (componentGraph lbi))
+
generate :: FilePath -> FilePath -> [String] -> IO ()
generate directory distdir config_args
= withCurrentDirectory directory
@@ -274,8 +288,8 @@ generate directory distdir config_args
-- cabal 2.2+ will expect it, but fallback to the old default
-- location if we don't find any. This is the case of the
-- bindist, which doesn't ship the $dist/build folder.
- maybe_infoFile <- findHookedPackageDesc (cwd </> distdir </> "build")
- <|> defaultHookedPackageDesc
+ maybe_infoFile <- findHookedPackageDesc verbosity (cwd </> distdir </> "build")
+ <|> fmap Just (defaultPackageDesc verbosity)
case maybe_infoFile of
Nothing -> return emptyHookedBuildInfo
Just infoFile -> readHookedBuildInfo verbosity infoFile
@@ -307,8 +321,9 @@ generate directory distdir config_args
let
comp = compiler lbi
- libBiModules lib = (libBuildInfo lib, libModules lib)
+ libBiModules lib = (libBuildInfo lib, foldMap (allLibModules lib) (componentNameCLBIs lbi $ CLibName defaultLibName))
exeBiModules exe = (buildInfo exe, ModuleName.main : exeModules exe)
+ biModuless :: [(BuildInfo, [ModuleName.ModuleName])]
biModuless = (map libBiModules . maybeToList $ library pd)
++ (map exeBiModules $ executables pd)
buildableBiModuless = filter isBuildable biModuless
diff --git a/utils/ghctags/ghctags.cabal b/utils/ghctags/ghctags.cabal
new file mode 100644
index 0000000000..c315b8b50b
--- /dev/null
+++ b/utils/ghctags/ghctags.cabal
@@ -0,0 +1,23 @@
+Name: ghctags
+Version: 0.1
+Copyright: XXX
+License: BSD3
+-- XXX License-File: LICENSE
+Author: XXX
+Maintainer: XXX
+Synopsis: A simple generator of vi- and emacs-compatible TAGS files.
+Description: XXX
+Category: Development
+build-type: Simple
+cabal-version: >=1.10
+
+Executable ghctags
+ Default-Language: Haskell2010
+
+ Main-Is: Main.hs
+
+ Build-Depends: base >= 4 && < 5,
+ containers,
+ Cabal >= 3.0 && <3.1,
+ ghc
+