Commit 53ee425e authored by Andreas Klebinger's avatar Andreas Klebinger

Always want config before use

This caused issues in parallel builds.
parent 4bbf6d3f
......@@ -290,7 +290,7 @@ buildRules nofib@Build{..} = do
return [ "-package-db", pkgdb, "-no-user-package-db" ]
buildDepsStamp %> \out -> do
configs <- mapM (liftIO . getTestConfig nofib) tests
configs <- mapM (getTestConfig nofib) tests
let deps = foldMap (\config -> words $ config "SRC_DEPS") configs
-- TODO: Invoking cabal in the way we do without any package argument fails.
root <- liftIO $ IO.makeAbsolute buildDepsRoot
......@@ -323,7 +323,7 @@ buildRules nofib@Build{..} = do
liftIO $ Ms.readFile (o <.> "compile.tsv")
-- Link executable
compileArgs <- liftIO $ getTestCompileArgs nofib test
compileArgs <- getTestCompileArgs nofib test
deps_args <- buildDepsArgs test
() <- withResource linkerResource 1 $
-- We pass the compiler_args as well, as we don't distinguish between link and compile time arguments
......@@ -362,7 +362,7 @@ buildRules nofib@Build{..} = do
-- Compile it
let ghc_rts_args = [ "+RTS", "--machine-readable", "-t"++o++".stats" ]
compileArgs <- liftIO $ getTestCompileArgs nofib test
compileArgs <- getTestCompileArgs nofib test
deps_args <- buildDepsArgs test
() <- cmd compiler $ ["-Rghc-timing","-c",src,"-w","-i"++obj,"-odir="++obj,"-hidir="++obj]
++ compileArgs ++ compiler_args ++ deps_args ++ ghc_rts_args
......@@ -381,7 +381,7 @@ buildRules nofib@Build{..} = do
"//Main.deps" %> \out -> do
let test = unoutput out
config <- readConfig' $ takeDirectory out </> "config.txt"
compileArgs <- liftIO $ getTestCompileArgs nofib test
compileArgs <- getTestCompileArgs nofib test
deps_args <- buildDepsArgs test
cmd_ compiler $
[ "-w"
......@@ -455,11 +455,11 @@ buildRules nofib@Build{..} = do
<> Ms.prefix (testLabel test <> ml "run" <> ml "rts stats") rtsStats
getTestConfig :: Nofib -> TestName -> IO (String -> String)
getTestConfig :: Nofib -> TestName -> Action (String -> String)
getTestConfig Build{..} test =
readConfig $ output </> testDir test </> "config.txt"
readConfig' $ output </> testDir test </> "config.txt"
getTestCompileArgs :: Nofib -> TestName -> IO [String]
getTestCompileArgs :: Nofib -> TestName -> Action [String]
getTestCompileArgs nofib@Build{..} test = do
config <- getTestConfig nofib test
return $ words (config "SRC_HC_OPTS")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment