on master help sign in
For some packages, build before calling haddock gtk2hs/gtk2hs#79
3b39177Michael Snoyman
Stackage/Test.hs+8
@@ -215,6 +215,10 @@ runTestSuite cabalVersion settings testdir docdir
215
215
216 -- Try building docs first in case tests have an expected failure.
216 -- Try building docs first in case tests have an expected failure.
217 when (buildDocs settings) $ do
217 when (buildDocs settings) $ do
218+ -- https://github.com/gtk2hs/gtk2hs/issues/79
219+ when (packageName `Set.member` buildBeforeHaddock) $
220+ getHandle AppendMode $ run "cabal" ["build"] dir
221+
218 hfs <- readIORef haddockFilesRef
222 hfs <- readIORef haddockFilesRef
219 let hfsOpts = flip map hfs $ \(pkgVer, hf) -> concat
223 let hfsOpts = flip map hfs $ \(pkgVer, hf) -> concat
220 [ "--haddock-options=--read-interface="
224 [ "--haddock-options=--read-interface="
@@ -271,6 +275,10 @@ runTestSuite cabalVersion settings testdir docdir
271 getHandle mode = withBinaryFile logfile mode
275 getHandle mode = withBinaryFile logfile mode
272 package = packageVersionString (packageName, spiVersion)
276 package = packageVersionString (packageName, spiVersion)
273
277
278+ buildBeforeHaddock = Set.fromList $ map PackageName $ words =<<
279+ [ "gio gtk"
280+ ]
281+
274copyBuiltInHaddocks docdir = do
282copyBuiltInHaddocks docdir = do
275 Just ghc <- findExecutable "ghc"
283 Just ghc <- findExecutable "ghc"
276 copyTree (takeDirectory ghc </> "../share/doc/ghc/html/libraries") docdir
284 copyTree (takeDirectory ghc </> "../share/doc/ghc/html/libraries") docdir