From 44b366e720cf0911a314b35491e0186f9c295dd1 Mon Sep 17 00:00:00 2001 From: Shayne Fletcher Date: Tue, 11 Jun 2019 08:58:16 -0400 Subject: [PATCH] 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) --- src/Development/IDE/Compat.hs | 15 ++------------- src/Development/IDE/Functions/CPP.hs | 3 --- src/Development/IDE/Functions/Compile.hs | 6 ------ src/Development/IDE/State/Rules.hs | 2 +- src/Development/IDE/UtilGHC.hs | 19 ------------------- 5 files changed, 3 insertions(+), 42 deletions(-) diff --git a/src/Development/IDE/Compat.hs b/src/Development/IDE/Compat.hs index d5e4da25..de2396a7 100644 --- a/src/Development/IDE/Compat.hs +++ b/src/Development/IDE/Compat.hs @@ -6,18 +6,11 @@ -- | Attempt at hiding the GHC version differences we can. module Development.IDE.Compat( HieFile(..), - HieFileResult(..), mkHieFile, writeHieFile, readHieFile ) where -#ifndef GHC_STABLE -import HieBin -import HieAst -import HieTypes -#else - import GHC import GhcPlugins import NameCache @@ -31,11 +24,7 @@ mkHieFile _ _ _ = return (HieFile () []) writeHieFile :: FilePath -> HieFile -> IO () writeHieFile _ _ = return () -readHieFile :: NameCache -> FilePath -> IO (HieFileResult, ()) -readHieFile _ _ = return (HieFileResult $ HieFile () [], ()) +readHieFile :: NameCache -> FilePath -> IO (HieFile, ()) +readHieFile _ _ = return (HieFile () [], ()) data HieFile = HieFile {hie_module :: (), hie_exports :: [AvailInfo]} - -data HieFileResult = HieFileResult {hie_file_result :: HieFile} - -#endif diff --git a/src/Development/IDE/Functions/CPP.hs b/src/Development/IDE/Functions/CPP.hs index d8bc036b..77592af9 100644 --- a/src/Development/IDE/Functions/CPP.hs +++ b/src/Development/IDE/Functions/CPP.hs @@ -50,9 +50,6 @@ doCpp dflags raw input_fn output_fn = do let cpp_prog args | raw = SysTools.runCpp dflags args | otherwise = SysTools.runCc -#ifndef GHC_STABLE - Nothing -#endif dflags (SysTools.Option "-E" : args) let target_defs = [] {- diff --git a/src/Development/IDE/Functions/Compile.hs b/src/Development/IDE/Functions/Compile.hs index 7cfdca05..695ae3fd 100644 --- a/src/Development/IDE/Functions/Compile.hs +++ b/src/Development/IDE/Functions/Compile.hs @@ -394,14 +394,8 @@ parseFileContents preprocessor filename contents = do return (contents, dflags) case unP Parser.parseModule (mkPState dflags contents loc) of -#ifdef GHC_STABLE PFailed _ locErr msgErr -> Ex.throwE $ mkErrorDoc dflags locErr msgErr -#else - PFailed s -> - -- A fatal parse error was encountered. - Ex.throwE $ toDiagnostics dflags $ snd $ getMessages s dflags -#endif POk pst rdr_module -> let hpm_annotations = (Map.fromListWith (++) $ annotations pst, diff --git a/src/Development/IDE/State/Rules.hs b/src/Development/IDE/State/Rules.hs index 626aac53..e41aca18 100644 --- a/src/Development/IDE/State/Rules.hs +++ b/src/Development/IDE/State/Rules.hs @@ -306,7 +306,7 @@ getHieFileRule = defineNoFile $ \(GetHieFile f) -> do u <- liftIO $ mkSplitUniqSupply 'a' let nameCache = initNameCache u [] - liftIO $ fmap (hie_file_result . fst) $ readHieFile nameCache f + liftIO $ fmap fst $ readHieFile nameCache f -- | A rule that wires per-file rules together mainRule :: Rules () diff --git a/src/Development/IDE/UtilGHC.hs b/src/Development/IDE/UtilGHC.hs index 30318ef4..84a93170 100644 --- a/src/Development/IDE/UtilGHC.hs +++ b/src/Development/IDE/UtilGHC.hs @@ -26,9 +26,6 @@ import Data.IORef import Control.Exception import FileCleanup import Platform -#ifndef GHC_STABLE -import ToolSettings -#endif ---------------------------------------------------------------------- -- GHC setup @@ -73,25 +70,9 @@ fakeDynFlags = defaultDynFlags settings ([], []) settings = Settings { sTargetPlatform = platform , sPlatformConstants = platformConstants -#ifdef GHC_STABLE , sProgramName = "ghc" , sProjectVersion = cProjectVersion , sOpt_P_fingerprint = fingerprint0 -#else - , sGhcNameVersion = GhcNameVersion - { ghcNameVersion_programName = "ghc" - , ghcNameVersion_projectVersion = cProjectVersion - } - , sFileSettings = FileSettings - { -- fileSettings_tmpDir = "." - } - , sPlatformMisc = PlatformMisc - { platformMisc_integerLibraryType = IntegerSimple - } - , sToolSettings = ToolSettings - { toolSettings_opt_P_fingerprint = fingerprint0 - } -#endif } platform = Platform { platformWordSize=8