Skip to content
Snippets Groups Projects
Commit dd11cf2f authored by Oleg Grenrus's avatar Oleg Grenrus
Browse files

Use runnerPackageDbStack if --with-ghc is the same as cabal-testsuite is compiled with

This makes e.g. LibV09 test work properly
parent c65a379b
No related branches found
No related tags found
No related merge requests found
......@@ -285,13 +285,24 @@ runTestM mode m = withSystemTempDirectory "cabal-testsuite" $ \tmp_dir -> do
-- them up we must configure them
program_db <- configureAllKnownPrograms verbosity program_db3
let ghcAndRunnedGhcAreTheSame :: Bool
ghcAndRunnedGhcAreTheSame = fromMaybe False $ do
ghc_program <- lookupProgram ghcProgram program_db
runner_ghc_program <- lookupProgram ghcProgram (runnerProgramDb senv)
return $ programPath ghc_program == programPath runner_ghc_program
let db_stack =
case argGhcPath (testCommonArgs args) of
Nothing -> runnerPackageDbStack senv -- NB: canonicalized
-- Can't use the build package db stack since they
-- are all for the wrong versions! TODO: Make
-- this configurable
Just _ -> [GlobalPackageDB]
--
-- Oleg: if runner ghc and provided ghc are the same,
-- use runnerPackageDbStack. See 'hasCabalForGhc' check.
Just _
| ghcAndRunnedGhcAreTheSame -> runnerPackageDbStack senv
| otherwise -> [GlobalPackageDB]
env = TestEnv {
testSourceDir = script_dir,
testTmpDir = tmp_dir,
......
......@@ -830,9 +830,14 @@ hasCabalForGhc = do
(testVerbosity env)
ghcProgram
(runnerProgramDb (testScriptEnv env))
-- TODO: I guess, to be more robust what we should check for
-- specifically is that the Cabal library we want to use
-- will be picked up by the package db stack of ghc-program
-- liftIO $ putStrLn $ "ghc_program: " ++ show ghc_program
-- liftIO $ putStrLn $ "runner_ghc_program: " ++ show runner_ghc_program
return (programPath ghc_program == programPath runner_ghc_program)
-- | If you want to use a Custom setup with new-build, it needs to
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment