[GHC] #8276: Building Haddock documentation panics with perf build on x86_64 Linux

GHC ghc-devs
Sat Oct 5 17:44:19 UTC 2013


#8276: Building Haddock documentation panics with perf build on x86_64 Linux
---------------------------------------+----------------------------------
        Reporter:  jstolarek           |            Owner:  thoughtpolice
            Type:  bug                 |           Status:  new
        Priority:  highest             |        Milestone:  7.8.1
       Component:  Documentation       |          Version:  7.7
      Resolution:                      |         Keywords:
Operating System:  Unknown/Multiple    |     Architecture:  x86_64 (amd64)
 Type of failure:  Compile-time crash  |       Difficulty:  Unknown
       Test Case:                      |       Blocked By:
        Blocking:                      |  Related Tickets:
---------------------------------------+----------------------------------

Comment (by SimonHengel):

 Here is some (very simplified!) code from Doctest.  In Haddock we have
 something similar.
 {{{
 parse :: [String] -> IO [TypecheckedModule]
 parse args = bracket saveStaticFlagGlobals restoreStaticFlagGlobals $ \_
 -> do
   args_ <- fst <$> parseStaticFlags (map noLoc args)
   runGhc (Just libdir) $ do
     (dynflags, files, _) <- getSessionDynFlags >>= (`parseDynamicFlags`
 args_)
     _ <- setSessionDynFlags dynflags
     mapM (`guessTarget` Nothing) (map unLoc files) >>= setTargets
     mods <- depanal [] False
     let sortedMods = flattenSCCs (topSortModuleGraph False mods Nothing)
     mapM (parseModule >=> typecheckModule >=> loadModule) sortedMods
 }}}

 (both Doctest and Haddock accept arbitrary GHC flags)

 If we can safely ignore static flags altogether, and change this to

 {{{
 parse :: [String] -> IO [TypecheckedModule]
 parse args = runGhc (Just libdir) $ do
   (dynflags, files, _) <- getSessionDynFlags >>= (`parseDynamicFlags` map
 noLoc args)
   _ <- setSessionDynFlags dynflags
   mapM (`guessTarget` Nothing) (map unLoc files) >>= setTargets
   mods <- depanal [] False
   let sortedMods = flattenSCCs (topSortModuleGraph False mods Nothing)
   mapM (parseModule >=> typecheckModule >=> loadModule) sortedMods
 }}}

 then I have no need for
 {{{saveStaticFlagGlobals}}}/{{{restoreStaticFlagGlobals}}} anymore.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8276#comment:29>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list