on master help sign in
Up-(actually down-)grade to ghc-lib-8.8.0.20190610 (#1576)

* Up-(actually down-)grade to ghc-lib-8.8.0.20190610 * A `#ifndef GHC_STABLE` removed. `ml_hie_file` must be set unconditionally * Pass Opt_WriteHie in xFlagsSet * Oops. Revert. This breaks Windows. Very confusing * Disable test; track in issue https://github.com/digital-asset/daml/issues/1582 * Remove Opt_WriteHie flag (Causes test failures trying to write into a read-only filesystem in CI)

commit44b366e720cf0911a314b35491e0186f9c295dd1 authorShayne Fletcher <shayne.fletcher@digitalasset.com> dateTue 11 Jun 2019, 08:58 (7 years ago) parent1d3d46e
5 files changed+3−42
src/Development/IDE/Compat.hs+2−13 src/Development/IDE/Functions/CPP.hs−3 src/Development/IDE/Functions/Compile.hs−6 src/Development/IDE/State/Rules.hs+1−1 src/Development/IDE/UtilGHC.hs−19
src/Development/IDE/Compat.hs+2−13
@@ -6,18 +6,11 @@
66-- | Attempt at hiding the GHC version differences we can.
77module Development.IDE.Compat(
88 HieFile(..),
9− HieFileResult(..),
109 mkHieFile,
1110 writeHieFile,
1211 readHieFile
1312 ) where
1413
15−#ifndef GHC_STABLE
16−import HieBin
17−import HieAst
18−import HieTypes
19−#else
20−
2114import GHC
2215import GhcPlugins
2316import NameCache
@@ -31,11 +24,7 @@ mkHieFile _ _ _ = return (HieFile () [])
3124writeHieFile :: FilePath -> HieFile -> IO ()
3225writeHieFile _ _ = return ()
3326
34−readHieFile :: NameCache -> FilePath -> IO (HieFileResult, ())
35−readHieFile _ _ = return (HieFileResult $ HieFile () [], ())
27+readHieFile :: NameCache -> FilePath -> IO (HieFile, ())
28+readHieFile _ _ = return (HieFile () [], ())
3629
3730data HieFile = HieFile {hie_module :: (), hie_exports :: [AvailInfo]}
38−
39−data HieFileResult = HieFileResult {hie_file_result :: HieFile}
40−
41−#endif
src/Development/IDE/Functions/CPP.hs−3
@@ -50,9 +50,6 @@ doCpp dflags raw input_fn output_fn = do
5050
5151 let cpp_prog args | raw = SysTools.runCpp dflags args
5252 | otherwise = SysTools.runCc
53−#ifndef GHC_STABLE
54− Nothing
55−#endif
5653 dflags (SysTools.Option "-E" : args)
5754
5855 let target_defs = [] {-
src/Development/IDE/Functions/Compile.hs−6
@@ -394,14 +394,8 @@ parseFileContents preprocessor filename contents = do
394394 return (contents, dflags)
395395
396396 case unP Parser.parseModule (mkPState dflags contents loc) of
397−#ifdef GHC_STABLE
398397 PFailed _ locErr msgErr ->
399398 Ex.throwE $ mkErrorDoc dflags locErr msgErr
400−#else
401− PFailed s ->
402− -- A fatal parse error was encountered.
403− Ex.throwE $ toDiagnostics dflags $ snd $ getMessages s dflags
404−#endif
405399 POk pst rdr_module ->
406400 let hpm_annotations =
407401 (Map.fromListWith (++) $ annotations pst,
src/Development/IDE/State/Rules.hs+1−1
@@ -306,7 +306,7 @@ getHieFileRule =
306306 defineNoFile $ \(GetHieFile f) -> do
307307 u <- liftIO $ mkSplitUniqSupply 'a'
308308 let nameCache = initNameCache u []
309− liftIO $ fmap (hie_file_result . fst) $ readHieFile nameCache f
309+ liftIO $ fmap fst $ readHieFile nameCache f
310310
311311-- | A rule that wires per-file rules together
312312mainRule :: Rules ()
src/Development/IDE/UtilGHC.hs−19
@@ -26,9 +26,6 @@ import Data.IORef
2626import Control.Exception
2727import FileCleanup
2828import Platform
29−#ifndef GHC_STABLE
30−import ToolSettings
31−#endif
3229
3330----------------------------------------------------------------------
3431-- GHC setup
@@ -73,25 +70,9 @@ fakeDynFlags = defaultDynFlags settings ([], [])
7370 settings = Settings
7471 { sTargetPlatform = platform
7572 , sPlatformConstants = platformConstants
76−#ifdef GHC_STABLE
7773 , sProgramName = "ghc"
7874 , sProjectVersion = cProjectVersion
7975 , sOpt_P_fingerprint = fingerprint0
80−#else
81− , sGhcNameVersion = GhcNameVersion
82− { ghcNameVersion_programName = "ghc"
83− , ghcNameVersion_projectVersion = cProjectVersion
84− }
85− , sFileSettings = FileSettings
86− { -- fileSettings_tmpDir = "."
87− }
88− , sPlatformMisc = PlatformMisc
89− { platformMisc_integerLibraryType = IntegerSimple
90− }
91− , sToolSettings = ToolSettings
92− { toolSettings_opt_P_fingerprint = fingerprint0
93− }
94−#endif
9576 }
9677 platform = Platform
9778 { platformWordSize=8