Skip to content

Commit 1447599

Browse files
committed
Fixes and add CI
1 parent 6f8d388 commit 1447599

File tree

5 files changed

+27
-8
lines changed

5 files changed

+27
-8
lines changed

.github/actions/setup-build/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ runs:
3737
ghc-version : ${{ inputs.ghc }}
3838
cabal-version: ${{ inputs.cabal }}
3939
enable-stack: false
40+
ghcup-release-channel: "https://raw.githubusercontent.com/haskell/ghcup-metadata/b9fd40eef5a6409a0742a5a248cda0cc24510d45/ghcup-prereleases-0.0.7.yaml"
4041

4142
- if: inputs.os == 'Windows'
4243
name: (Windows) Platform config
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[ "9.4.4" , "9.2.5" , "9.0.2" , "8.10.7" ]
1+
[ "9.6.0.20230210", "9.4.4" , "9.2.5" , "9.0.2" , "8.10.7" ]

cabal.project

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ package *
7171

7272
write-ghc-environment-files: never
7373

74-
index-state: 2023-02-19T00:00:01Z
74+
-- head.hackage doesn't like index-state
75+
if impl(ghc < 9.5)
76+
index-state: 2023-02-19T00:00:01Z
7577

7678
constraints:
7779
-- For GHC 9.4, older versions of entropy fail to build on Windows

ghcide/src/Development/IDE/Core/Preprocessor.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ runCpp env0 filename contents = withTempDir $ \dir -> do
204204
-- Happy case, file is not modified, so run CPP on it in-place
205205
-- which also makes things like relative #include files work
206206
-- and means location information is correct
207-
doCpp env1 True filename out
207+
doCpp env1 filename out
208208
liftIO $ Util.hGetStringBuffer out
209209

210210
Just contents -> do
@@ -218,7 +218,7 @@ runCpp env0 filename contents = withTempDir $ \dir -> do
218218
let inp = dir </> "___GHCIDE_MAGIC___"
219219
withBinaryFile inp WriteMode $ \h ->
220220
hPutStringBuffer h contents
221-
doCpp env2 True inp out
221+
doCpp env2 inp out
222222

223223
-- Fix up the filename in lines like:
224224
-- # 1 "C:/Temp/extra-dir-914611385186/___GHCIDE_MAGIC___"

ghcide/src/Development/IDE/GHC/CPP.hs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ import GHC.Settings
2727
import qualified DriverPipeline as Pipeline
2828
import ToolSettings
2929
#endif
30+
31+
#if MIN_VERSION_ghc(9,5,0)
32+
import qualified GHC.SysTools.Cpp as Pipeline
33+
#endif
34+
3035
#if MIN_VERSION_ghc(9,3,0)
3136
import qualified GHC.Driver.Pipeline.Execute as Pipeline
3237
#endif
@@ -40,12 +45,23 @@ addOptP f = alterToolSettings $ \s -> s
4045
fingerprintStrings ss = fingerprintFingerprints $ map fingerprintString ss
4146
alterToolSettings f dynFlags = dynFlags { toolSettings = f (toolSettings dynFlags) }
4247

43-
doCpp :: HscEnv -> Bool -> FilePath -> FilePath -> IO ()
44-
doCpp env raw input_fn output_fn =
48+
doCpp :: HscEnv -> FilePath -> FilePath -> IO ()
49+
doCpp env input_fn output_fn =
50+
-- See GHC commit a2f53ac8d968723417baadfab5be36a020ea6850
51+
-- this function/Pipeline.doCpp previously had a raw parameter
52+
-- always set to True that corresponded to these settings
53+
#if MIN_VERSION_ghc(9,2,0)
54+
4555
#if MIN_VERSION_ghc(9,5,0)
46-
void $ Pipeline.runCppPhase env input_fn output_fn -- TODO wz1000
56+
let cpp_opts = Pipeline.CppOpts
57+
{ cppUseCc = False
58+
, cppLinePragmas = True
59+
} in
4760
#elif MIN_VERSION_ghc(9,2,0)
48-
Pipeline.doCpp (hsc_logger env) (hsc_tmpfs env) (hsc_dflags env) (hsc_unit_env env) raw input_fn output_fn
61+
let cpp_opts = True in
62+
#endif
63+
Pipeline.doCpp (hsc_logger env) (hsc_tmpfs env) (hsc_dflags env) (hsc_unit_env env) cpp_opts input_fn output_fn
64+
4965
#else
5066
Pipeline.doCpp (hsc_dflags env) raw input_fn output_fn
5167
#endif

0 commit comments

Comments
 (0)