on master help sign in
Some minor build improvements
827c674Michael Snoyman
Stackage2/BuildConstraints.hs+7−1
@@ -128,7 +128,8 @@ defaultBuildConstraints = do
128 defaultGlobalFlags = asMap $ mapFromList $
128 defaultGlobalFlags = asMap $ mapFromList $
129 map (, True) (map FlagName $ setToList $ Old.flags oldSettings mempty) ++
129 map (, True) (map FlagName $ setToList $ Old.flags oldSettings mempty) ++
130 map (, False) (map FlagName $ setToList $ Old.disabledFlags oldSettings)
130 map (, False) (map FlagName $ setToList $ Old.disabledFlags oldSettings)
131− expectedFailures = Old.defaultExpectedFailures oldGhcVer False
131+ expectedFailures = Old.defaultExpectedFailures oldGhcVer False ++
132+ newExpectedFailures
132 skippedTests =
133 skippedTests =
133 old ++ extraSkippedTests
134 old ++ extraSkippedTests
134 where
135 where
@@ -182,3 +183,8 @@ skippedBenchs = setFromList $ words =<<
182 [ "machines criterion-plus graphviz lifted-base pandoc stm-containers uuid"
183 [ "machines criterion-plus graphviz lifted-base pandoc stm-containers uuid"
183 , "cases hasql-postgres" -- pulls in criterion-plus, which has restrictive upper bounds
184 , "cases hasql-postgres" -- pulls in criterion-plus, which has restrictive upper bounds
184 ]
185 ]
186+
187+newExpectedFailures :: Set PackageName
188+newExpectedFailures = setFromList $ map PackageName $ words =<<
189+ [ "cautious-file" -- weird problems with cabal test
190+ ]
Stackage2/PerformBuild.hs+15−6
@@ -203,10 +203,6 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} =
203 . withTSem sbSem
203 . withTSem sbSem
204 wfd libComps buildLibrary
204 wfd libComps buildLibrary
205
205
206− -- Even if the tests later fail, we can allow other libraries to build
207− -- on top of our successful results
208− atomically $ putTMVar (piResult sbPackageInfo) True
209−
210 wfd testComps runTests
206 wfd testComps runTests
211
207
212 name = display $ piName sbPackageInfo
208 name = display $ piName sbPackageInfo
@@ -232,10 +228,13 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} =
232
228
233 log' t = do
229 log' t = do
234 i <- readTVarIO sbActive
230 i <- readTVarIO sbActive
231+ errs <- readTVarIO sbErrsVar
235 pbLog $ encodeUtf8 $ concat
232 pbLog $ encodeUtf8 $ concat
236 [ t
233 [ t
237− , " (active: "
234+ , " (pending: "
238 , tshow i
235 , tshow i
236+ , ", failures: "
237+ , tshow $ length errs
239 , ")\n"
238 , ")\n"
240 ]
239 ]
241 libOut = pbLogDir </> fpFromText namever </> "build.out"
240 libOut = pbLogDir </> fpFromText namever </> "build.out"
@@ -285,7 +284,11 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} =
285 withMVar sbRegisterMutex $ const $
284 withMVar sbRegisterMutex $ const $
286 run "cabal" ["register"]
285 run "cabal" ["register"]
287
286
287+ -- Even if the tests later fail, we can allow other libraries to build
288+ -- on top of our successful results
289+ atomically $ putTMVar (piResult sbPackageInfo) True
290+
288− when (pcHaddocks /= Don'tBuild) $ do
291+ when (pcHaddocks /= Don'tBuild && hasLibrary (ppDesc $ piPlan sbPackageInfo)) $ do
289 log' $ "Haddocks " ++ namever
292 log' $ "Haddocks " ++ namever
290 hfs <- readTVarIO sbHaddockFiles
293 hfs <- readTVarIO sbHaddockFiles
291 let hfsOpts = flip map (mapToList hfs) $ \(pkgVer, hf) -> concat
294 let hfsOpts = flip map (mapToList hfs) $ \(pkgVer, hf) -> concat
@@ -359,6 +362,12 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} =
359 Just bf -> bf
362 Just bf -> bf
360 Nothing -> BuildFailureException exc
363 Nothing -> BuildFailureException exc
361
364
365+hasLibrary :: SimpleDesc -> Bool
366+hasLibrary sd =
367+ any go (sdPackages sd) || any go (sdTools sd)
368+ where
369+ go = (CompLibrary `member`) . diComponents
370+
362renameOrCopy :: FilePath -> FilePath -> IO ()
371renameOrCopy :: FilePath -> FilePath -> IO ()
363renameOrCopy src dest = rename src dest `catchIO` \_ -> copyDir src dest
372renameOrCopy src dest = rename src dest `catchIO` \_ -> copyDir src dest
364
373