aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2019-08-06 02:06:54 +0200
committerDaniel Gröber (dxld) <dxld@darkboxed.org>2019-09-17 17:48:26 +0200
commit29c13da426a9009754f5d32351a9f54bccf3cbb5 (patch)
tree44e578b0dec3b06b8b455f41075bb82e1fdfd37b /tests
parentc70e8076803bd29d7675ed493ebb1ca246891b34 (diff)
Remove crusty old helper code
- Inplace component inlining really always was a nasty cludge, now that we have proper build-system support we can get rid of it. - GHC options subsets aren't really needed, we can split these up after parsing the options using the ghc library. - Dropped GHC 7.10, it seems unsupportable without the inplace component inlining, possibly a Stack/lib:Cabal bug, but it is quite old so time for it to go anyway. This is the second thing commit it was holing up too!
Diffstat (limited to 'tests')
-rw-r--r--tests/GhcSession.hs26
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/GhcSession.hs b/tests/GhcSession.hs
index a963ae4..2fdd3e2 100644
--- a/tests/GhcSession.hs
+++ b/tests/GhcSession.hs
@@ -324,8 +324,9 @@ test modProgs (psdImpl -> ProjSetupImpl{..}) topdir tmpdir projdir cabal_file
cs <- concat <$> runQuery (allUnits (Map.elems . uiComponents)) qe
- when (any ((==ProduceBuildOutput) . ciNeedsBuildOutput) cs) $
- psiBuild progs projdir
+
+ -- TODO: Cludge until we can just build the unit dependencies
+ psiBuild progs projdir
let pkgdir = takeDirectory cabal_file
homedir <- getHomeDirectory
@@ -343,7 +344,7 @@ test modProgs (psdImpl -> ProjSetupImpl{..}) topdir tmpdir projdir cabal_file
putStrLn sopts
hFlush stdout
- tr <- compileModule pkgdir ciNeedsBuildOutput ciEntrypoints ciSourceDirs opts'
+ tr <- compileModule pkgdir ciEntrypoints ciSourceDirs opts'
return $ tr ciComponentName
where
formatArg x
@@ -355,14 +356,14 @@ addCabalProject dir = do
writeFile (dir </> "cabal.project") "packages: .\n"
compileModule
- :: FilePath -> NeedsBuildOutput -> ChEntrypoint -> [FilePath] -> [String]
+ :: FilePath -> ChEntrypoint -> [FilePath] -> [String]
-> IO (ChComponentName -> FilePath -> String -> String -> TestResult)
-compileModule pkgdir nb ep srcdirs opts = do
+compileModule pkgdir ep srcdirs opts = do
cwd_before <- getCurrentDirectory
setCurrentDirectory pkgdir
flip E.finally (setCurrentDirectory cwd_before) $ do
- putStrLn $ "compiling: " ++ show ep ++ " (" ++ show nb ++ ")"
+ putStrLn $ "compiling: " ++ show ep
E.handle (\(ec :: ExitCode) -> print ec >> return (TestResult False)) $ do
@@ -371,9 +372,7 @@ compileModule pkgdir nb ep srcdirs opts = do
let printGhcEx e = GHC.printException e >> return (TestResult False)
handleSourceError printGhcEx $ do
- let target = case nb of
- ProduceBuildOutput -> HscNothing -- AZ: what should this be?
- NoBuildOutput -> HscInterpreted
+ let target = HscInterpreted -- TODO
dflags0 <- getSessionDynFlags
let dflags1 = dflags0 {
@@ -403,16 +402,17 @@ compileModule pkgdir nb ep srcdirs opts = do
-- TODO: this doesn't support Setup.lhs
["Setup.hs"]
- let ts' = case nb of
- NoBuildOutput -> map (\t -> t { targetAllowObjCode = False }) ts
- ProduceBuildOutput -> ts
+ -- Always compile targets as GHCi bytecode so the setContext call below
+ -- can always succeed
+ let ts' = map (\t -> t { targetAllowObjCode = False }) ts
liftIO $ putStrLn $ "targets: " ++ showPpr dflags2 ts'
setTargets ts'
_ <- load LoadAllTargets
- when (nb == NoBuildOutput) $ do
+-- when (nb == NoBuildOutput) $ do
+ do
setContext $ case ep of
ChLibEntrypoint ms ms' ss ->
map (IIModule . mkModuleName . unChModuleName) $ ms ++ ms' ++ ss