Commit 381c3ae3 authored by Ben Gamari's avatar Ben Gamari 🐢

Bump Cabal submodule

(cherry picked from commit ff438786)

Metric Increase:
    haddock.Cabal
parent bd2d13ff
{-# 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))
Subproject commit 5d258537b754005d2a1d170b44d764b63ff4fc75
Subproject commit f697d3209990c3314efe840be54fb7c5a967e6ff
......@@ -39,8 +39,6 @@ expectedGhcOnlyExtensions :: [String]
expectedGhcOnlyExtensions = ["RelaxedLayout",
"AlternativeLayoutRule",
"AlternativeLayoutRuleTransitional",
"EmptyDataDeriving",
"GeneralisedNewtypeDeriving",
"CUSKs",
"ImportQualifiedPost"]
......
......@@ -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
......
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment