mirror of
https://github.com/haskell/ghcide.git
synced 2024-12-17 23:22:04 +03:00
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)
This commit is contained in:
parent
1d3d46ea76
commit
44b366e720
@ -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
|
||||
|
@ -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 = [] {-
|
||||
|
@ -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,
|
||||
|
@ -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 ()
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user