summaryrefslogtreecommitdiff
path: root/utils/ghctags
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2016-05-04 14:55:59 -0700
committerEdward Z. Yang <ezyang@cs.stanford.edu>2016-08-08 14:14:42 -0700
commitfe19be2de14a5506c1af21dc4d574f5ffd6acbdf (patch)
treed0d9b439c53c220278f1f2dc31ea1bec4c31aa46 /utils/ghctags
parent4d9c22d01561bda90632d9a470fd2a2bb167658a (diff)
downloadhaskell-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/ghctags')
-rw-r--r--utils/ghctags/Main.hs12
1 files changed, 8 insertions, 4 deletions
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