Some minor build improvements

This commit is contained in:
Michael Snoyman 2014-12-11 23:13:48 +02:00
parent 33b2e1540a
commit 827c6748c8
2 changed files with 22 additions and 7 deletions

View File

@ -128,7 +128,8 @@ defaultBuildConstraints = do
defaultGlobalFlags = asMap $ mapFromList $
map (, True) (map FlagName $ setToList $ Old.flags oldSettings mempty) ++
map (, False) (map FlagName $ setToList $ Old.disabledFlags oldSettings)
expectedFailures = Old.defaultExpectedFailures oldGhcVer False
expectedFailures = Old.defaultExpectedFailures oldGhcVer False ++
newExpectedFailures
skippedTests =
old ++ extraSkippedTests
where
@ -182,3 +183,8 @@ skippedBenchs = setFromList $ words =<<
[ "machines criterion-plus graphviz lifted-base pandoc stm-containers uuid"
, "cases hasql-postgres" -- pulls in criterion-plus, which has restrictive upper bounds
]
newExpectedFailures :: Set PackageName
newExpectedFailures = setFromList $ map PackageName $ words =<<
[ "cautious-file" -- weird problems with cabal test
]

View File

@ -203,10 +203,6 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} =
. withTSem sbSem
wfd libComps buildLibrary
-- Even if the tests later fail, we can allow other libraries to build
-- on top of our successful results
atomically $ putTMVar (piResult sbPackageInfo) True
wfd testComps runTests
name = display $ piName sbPackageInfo
@ -232,10 +228,13 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} =
log' t = do
i <- readTVarIO sbActive
errs <- readTVarIO sbErrsVar
pbLog $ encodeUtf8 $ concat
[ t
, " (active: "
, " (pending: "
, tshow i
, ", failures: "
, tshow $ length errs
, ")\n"
]
libOut = pbLogDir </> fpFromText namever </> "build.out"
@ -285,7 +284,11 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} =
withMVar sbRegisterMutex $ const $
run "cabal" ["register"]
when (pcHaddocks /= Don'tBuild) $ do
-- Even if the tests later fail, we can allow other libraries to build
-- on top of our successful results
atomically $ putTMVar (piResult sbPackageInfo) True
when (pcHaddocks /= Don'tBuild && hasLibrary (ppDesc $ piPlan sbPackageInfo)) $ do
log' $ "Haddocks " ++ namever
hfs <- readTVarIO sbHaddockFiles
let hfsOpts = flip map (mapToList hfs) $ \(pkgVer, hf) -> concat
@ -359,6 +362,12 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} =
Just bf -> bf
Nothing -> BuildFailureException exc
hasLibrary :: SimpleDesc -> Bool
hasLibrary sd =
any go (sdPackages sd) || any go (sdTools sd)
where
go = (CompLibrary `member`) . diComponents
renameOrCopy :: FilePath -> FilePath -> IO ()
renameOrCopy src dest = rename src dest `catchIO` \_ -> copyDir src dest