diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-05-04 14:55:59 -0700 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-08-08 14:14:42 -0700 |
commit | fe19be2de14a5506c1af21dc4d574f5ffd6acbdf (patch) | |
tree | d0d9b439c53c220278f1f2dc31ea1bec4c31aa46 /utils | |
parent | 4d9c22d01561bda90632d9a470fd2a2bb167658a (diff) | |
download | haskell-fe19be2de14a5506c1af21dc4d574f5ffd6acbdf.tar.gz |
Cabal submodule update.
There's a substantial bump to the haddock.Cabal allocation
stats, because we added 50% more modules, so of course allocations
are going to increase 50%. (But perhaps this is indicative of
some bad constant factor in Haddock related to modules.)
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: ggreif, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2442
Diffstat (limited to 'utils')
-rw-r--r-- | utils/ghc-cabal/Main.hs | 13 | ||||
-rw-r--r-- | utils/ghc-pkg/Main.hs | 18 | ||||
-rw-r--r-- | utils/ghctags/Main.hs | 12 |
3 files changed, 23 insertions, 20 deletions
diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs index 8cc1d1a34a..b833b640f8 100644 --- a/utils/ghc-cabal/Main.hs +++ b/utils/ghc-cabal/Main.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-} module Main (main) where @@ -150,16 +151,14 @@ doCopy directory distDir noGhcPrimHook f pd lbi us flags = let pd' | packageName pd == PackageName "ghc-prim" = - case libraries pd of - [lib] -> + case library pd of + Just lib -> let ghcPrim = fromJust (simpleParse "GHC.Prim") ems = filter (ghcPrim /=) (exposedModules lib) lib' = lib { exposedModules = ems } - in pd { libraries = [lib'] } - [] -> + in pd { library = Just lib' } + Nothing -> error "Expected a library, but none found" - _ -> - error "Expected a single library, but multiple found" | otherwise = pd in f pd' lbi us flags modHook relocatableBuild f pd lbi us flags @@ -326,7 +325,7 @@ generate directory distdir dll0Modules config_args comp = compiler lbi libBiModules lib = (libBuildInfo lib, libModules lib) exeBiModules exe = (buildInfo exe, ModuleName.main : exeModules exe) - biModuless = (map libBiModules $ libraries pd) + biModuless = (map libBiModules . maybeToList $ library pd) ++ (map exeBiModules $ executables pd) buildableBiModuless = filter isBuildable biModuless where isBuildable (bi', _) = buildable bi' diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs index e0625fec80..399522ad1c 100644 --- a/utils/ghc-pkg/Main.hs +++ b/utils/ghc-pkg/Main.hs @@ -1079,7 +1079,7 @@ type PackageCacheFormat = GhcPkg.InstalledPackageInfo PackageName UnitId ModuleName - OriginalModule + Module convertPackageInfoToCacheFormat :: InstalledPackageInfo -> PackageCacheFormat convertPackageInfoToCacheFormat pkg = @@ -1132,9 +1132,9 @@ instance GhcPkg.BinaryStringRep String where fromStringRep = fromUTF8 . BS.unpack toStringRep = BS.pack . toUTF8 -instance GhcPkg.DbModuleRep UnitId ModuleName OriginalModule where - fromDbModule (GhcPkg.DbModule uid mod_name) = OriginalModule uid mod_name - toDbModule (OriginalModule uid mod_name) = GhcPkg.DbModule uid mod_name +instance GhcPkg.DbModuleRep UnitId ModuleName Module where + fromDbModule (GhcPkg.DbModule uid mod_name) = Module uid mod_name + toDbModule (Module uid mod_name) = GhcPkg.DbModule uid mod_name -- ----------------------------------------------------------------------------- -- Exposing, Hiding, Trusting, Distrusting, Unregistering are all similar @@ -1741,7 +1741,7 @@ checkExposedModules db_stack pkg = where checkExposedModule (ExposedModule modl reexport) = do let checkOriginal = checkModuleFile pkg modl - checkReexport = checkOriginalModule "module reexport" db_stack pkg + checkReexport = checkModule "module reexport" db_stack pkg maybe checkOriginal checkReexport reexport -- | Validates the existence of an appropriate @hi@ file associated with @@ -1779,13 +1779,13 @@ checkDuplicateModules pkg -- implementation, then we should also check that the original module in -- question is NOT a signature (however, if it is a reexport, then it's fine -- for the original module to be a signature.) -checkOriginalModule :: String +checkModule :: String -> PackageDBStack -> InstalledPackageInfo - -> OriginalModule + -> Module -> Validate () -checkOriginalModule field_name db_stack pkg - (OriginalModule definingPkgId definingModule) = +checkModule field_name db_stack pkg + (Module definingPkgId definingModule) = let mpkg = if definingPkgId == installedUnitId pkg then Just pkg else PackageIndex.lookupUnitId ipix definingPkgId diff --git a/utils/ghctags/Main.hs b/utils/ghctags/Main.hs index 9a2ab2cccf..138687e5fa 100644 --- a/utils/ghctags/Main.hs +++ b/utils/ghctags/Main.hs @@ -23,6 +23,8 @@ import Distribution.Simple.Configure ( getPersistBuildConfig ) import Distribution.Simple.Program.GHC ( renderGhcOptions ) import Distribution.PackageDescription ( libBuildInfo ) import Distribution.Simple.LocalBuildInfo +import Distribution.Types.LocalBuildInfo ( componentNameTargets' ) +import Distribution.Types.TargetInfo import qualified Distribution.Verbosity as V import Control.Monad hiding (mapM) @@ -179,14 +181,16 @@ flagsFromCabal :: FilePath -> IO [String] flagsFromCabal distPref = do lbi <- getPersistBuildConfig distPref let pd = localPkgDescr lbi - case maybeGetDefaultLibraryLocalBuildInfo lbi of - Just clbi -> - let CLib lib = getComponent pd (componentLocalName clbi) + case componentNameTargets' pd lbi CLibName of + [target] -> + let clbi = targetCLBI target + CLib lib = getComponent pd (componentLocalName clbi) bi = libBuildInfo lib odir = buildDir lbi opts = componentGhcOptions V.normal lbi bi clbi odir in return $ renderGhcOptions (compiler lbi) (hostPlatform lbi) opts - _ -> error "no library" + [] -> error "no library" + _ -> error "more libraries than we know how to handle" ---------------------------------------------------------------- --- LOADING HASKELL SOURCE |