Commit 546f8b14 authored by Matthew Pickering's avatar Matthew Pickering Committed by Marge Bot

hadrian: Don't try to build iserv-prof if we don't have profiled libraries

Workaround for #19624
parent b06e457d
Pipeline #34058 canceled with stages
in 35 seconds
......@@ -17,6 +17,7 @@ import Settings.Builders.RunTest
import Settings.Program (programContext)
import Target
import Utilities
import Context.Type
ghcConfigHsPath :: FilePath
ghcConfigHsPath = "testsuite/mk/ghc-config.hs"
......@@ -211,12 +212,24 @@ needIservBins :: Action ()
needIservBins = do
testGhc <- testCompiler <$> userSetting defaultTestArgs
let stg = stageOf testGhc
rtsways <- interpretInContext (vanillaContext stg ghc) getRtsWays
need =<< traverse programPath
[ Context stg iserv w
| w <- [vanilla, profiling, dynamic]
, w `elem` rtsways
ws = [vanilla, profiling, dynamic]
progs <- catMaybes <$> mapM (canBuild stg) ws
need progs
-- Only build iserv binaries if all dependencies are built the right
-- way already. In particular this fixes the case of no_profiled_libs
-- not working with the testsuite, see #19624
canBuild stg w = do
contextDeps <- contextDependencies (Context stg iserv w)
ws <- forM contextDeps $ \c ->
interpretInContext c (getLibraryWays <>
if Context.Type.package c == rts
then getRtsWays
else mempty)
if (all (w `elem`) ws)
then Just <$> programPath (Context stg iserv w)
else return Nothing
pkgFile :: Stage -> Package -> Action FilePath
pkgFile stage pkg
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