hakyll 4.16.1.0 → 4.16.2.0
raw patch · 15 files changed
+203/−101 lines, 15 filesdep ~bytestringdep ~deepseqdep ~file-embedPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: bytestring, deepseq, file-embed, filepath, tasty, template-haskell, text, warp
API changes (from Hackage documentation)
Files
- CHANGELOG.md +8/−0
- hakyll.cabal +8/−6
- lib/Hakyll/Core/Runtime.hs +24/−0
- tests/Hakyll/Core/Runtime/Tests.hs +32/−3
- tests/Hakyll/Web/Pandoc/Biblio/Tests.hs +23/−20
- tests/data/biblio/cites-meijer-pandoc-2.0.0plus.golden +16/−0
- tests/data/biblio/cites-meijer-pandoc-3.0.0plus.golden +16/−0
- tests/data/biblio/cites-meijer-pandoc-3.1.8plus.golden +16/−0
- tests/data/biblio/cites-meijer-pandoc2.golden +0/−16
- tests/data/biblio/cites-meijer-pandoc3.golden +0/−16
- tests/data/biblio/cites-multiple-pandoc-2.0.0plus.golden +20/−0
- tests/data/biblio/cites-multiple-pandoc-3.0.0plus.golden +20/−0
- tests/data/biblio/cites-multiple-pandoc-3.1.8plus.golden +20/−0
- tests/data/biblio/cites-multiple-pandoc2.golden +0/−20
- tests/data/biblio/cites-multiple-pandoc3.golden +0/−20
CHANGELOG.md view
@@ -4,6 +4,14 @@ # Releases +## Hakyll 4.16.2.0 (2023-09-20)++- Add errors for multiple `match`es that are routed to the same file+ (contribution by Jasper van der Jeugt)+- Fix Hakyll.Web.Pandoc.Biblio tests failing with Pandoc 3.1.8 (contribution by+ Alexander Batischev)+- Bump `tasty` upper bound to 1.6 (contribution by Alexander Batischev)+ ## Hakyll 4.16.1.0 (2023-08-23) - Rewrite async scheduler; improves scaling and resource usage
hakyll.cabal view
@@ -1,5 +1,5 @@ Name: hakyll-Version: 4.16.1.0+Version: 4.16.2.0 Synopsis: A static website compiler library Description:@@ -60,10 +60,12 @@ Extra-source-files: CHANGELOG.md tests/data/biblio/chicago.csl- tests/data/biblio/cites-meijer-pandoc2.golden- tests/data/biblio/cites-meijer-pandoc3.golden- tests/data/biblio/cites-multiple-pandoc2.golden- tests/data/biblio/cites-multiple-pandoc3.golden+ tests/data/biblio/cites-meijer-pandoc-2.0.0plus.golden+ tests/data/biblio/cites-meijer-pandoc-3.0.0plus.golden+ tests/data/biblio/cites-meijer-pandoc-3.1.8plus.golden+ tests/data/biblio/cites-multiple-pandoc-2.0.0plus.golden+ tests/data/biblio/cites-multiple-pandoc-3.0.0plus.golden+ tests/data/biblio/cites-multiple-pandoc-3.1.8plus.golden tests/data/biblio/cites-multiple.markdown tests/data/biblio/default.html tests/data/biblio/page.markdown@@ -282,7 +284,7 @@ Build-Depends: hakyll, QuickCheck >= 2.8 && < 2.15,- tasty >= 0.11 && < 1.5,+ tasty >= 0.11 && < 1.6, tasty-golden >= 2.3 && < 2.4, tasty-hunit >= 0.9 && < 0.11, tasty-quickcheck >= 0.8 && < 0.11,
lib/Hakyll/Core/Runtime.hs view
@@ -137,6 +137,9 @@ schedulerDone :: !(Set Identifier) , -- | Any snapshots stored. schedulerSnapshots :: !(Set (Identifier, Snapshot))+ , -- | Any routed files and who wrote them. This is used to detect multiple+ -- writes to the same file, which can yield inconsistent results.+ schedulerRoutes :: !(Map FilePath Identifier) , -- | Currently blocked compilers. schedulerBlocked :: !(Set Identifier) , -- | Compilers that may resume on triggers@@ -160,6 +163,7 @@ schedulerQueue = Seq.empty schedulerWorking = Set.empty schedulerSnapshots = Set.empty+ schedulerRoutes = Map.empty schedulerBlocked = Set.empty schedulerTriggers = Map.empty schedulerStarved = 0@@ -345,6 +349,24 @@ --------------------------------------------------------------------------------+-- | Record that a specific identifier was routed to a specific filepath.+-- This is used to detect multiple (inconsistent) writes to the same file.+schedulerRoute+ :: Identifier+ -> FilePath+ -> Scheduler+ -> (Scheduler, ())+schedulerRoute id0 path scheduler0@Scheduler {..}+ | Just id1 <- Map.lookup path schedulerRoutes, id0 /= id1 =+ let msg = "multiple writes for route " ++ path ++ ": " +++ show id0 ++ " and " ++ show id1 in+ schedulerError (Just id0) msg scheduler0+ | otherwise =+ let routes = Map.insert path id0 schedulerRoutes in+ (scheduler0 {schedulerRoutes = routes}, ())+++-------------------------------------------------------------------------------- build :: RunMode -> ReaderT RuntimeRead IO () build mode = do logger <- runtimeLogger <$> ask@@ -479,6 +501,8 @@ case mroute of Nothing -> return () Just route -> do+ liftIO . IORef.atomicModifyIORef' scheduler $+ schedulerRoute id' route let path = destinationDirectory config </> route liftIO $ makeDirectories path liftIO $ write path item
tests/Hakyll/Core/Runtime/Tests.hs view
@@ -12,7 +12,7 @@ import System.Exit (ExitCode (..)) import System.FilePath ((</>)) import Test.Tasty (TestTree, testGroup)-import Test.Tasty.HUnit (Assertion, (@?=))+import Test.Tasty.HUnit (Assertion, assertBool, (@?=)) --------------------------------------------------------------------------------@@ -24,8 +24,15 @@ -------------------------------------------------------------------------------- tests :: TestTree-tests = testGroup "Hakyll.Core.Runtime.Tests" $- fromAssertions "run" [case01, case02, case03, case04, case05, case06]+tests = testGroup "Hakyll.Core.Runtime.Tests" $ fromAssertions "run"+ [ case01+ , case02+ , case03+ , case04+ , case05+ , case06+ , issue1000+ ] --------------------------------------------------------------------------------@@ -230,5 +237,27 @@ makeItem (text :: String) ec @?= ExitSuccess++ cleanTestEnv+++--------------------------------------------------------------------------------+issue1000 :: Assertion+issue1000 = do+ (logger, inMemLog) <- Logger.newInMem+ (ec, _) <- run RunModeNormal testConfiguration logger $ do+ match "*.md" $ do+ route $ setExtension "html"+ compile getResourceBody+ match "*.md" $ version "nav" $ do+ route $ setExtension "html"+ compile $ getResourceBody >>= traverse (pure . reverse)++ ec @?= ExitFailure 1+ msgs <- inMemLog+ assertBool "missing 'multiple writes' errors" $ not $ null $+ [ msg+ | (Logger.Error, msg) <- msgs, "multiple writes" `isInfixOf` msg+ ] cleanTestEnv
tests/Hakyll/Web/Pandoc/Biblio/Tests.hs view
@@ -66,13 +66,16 @@ cleanTestEnv return output)- - where - goldenTest = - if pandocMajorVersion == 2- then "cites-meijer-pandoc2.golden" - else "cites-meijer-pandoc3.golden" + where+ goldenTest =+#if MIN_VERSION_pandoc(3,1,8)+ "cites-meijer-pandoc-3.1.8plus.golden"+#elif MIN_VERSION_pandoc(3,0,0)+ "cites-meijer-pandoc-3.0.0plus.golden"+#else+ "cites-meijer-pandoc-2.0.0plus.golden"+#endif goldenTest02 :: TestTree goldenTest02 =@@ -107,10 +110,14 @@ return output) where- goldenTest = - if pandocMajorVersion == 2- then "cites-meijer-pandoc2.golden" - else "cites-meijer-pandoc3.golden"+ goldenTest =+#if MIN_VERSION_pandoc(3,1,8)+ "cites-meijer-pandoc-3.1.8plus.golden"+#elif MIN_VERSION_pandoc(3,0,0)+ "cites-meijer-pandoc-3.0.0plus.golden"+#else+ "cites-meijer-pandoc-2.0.0plus.golden"+#endif goldenTest03 :: TestTree goldenTest03 =@@ -147,15 +154,11 @@ return output) where- goldenTest = - if pandocMajorVersion == 2 - then "cites-multiple-pandoc2.golden" - else "cites-multiple-pandoc3.golden"-----------------------------------------------------------------------------------pandocMajorVersion :: Int-#if MIN_VERSION_pandoc(3,0,0)-pandocMajorVersion = 3+ goldenTest =+#if MIN_VERSION_pandoc(3,1,8)+ "cites-multiple-pandoc-3.1.8plus.golden"+#elif MIN_VERSION_pandoc(3,0,0)+ "cites-multiple-pandoc-3.0.0plus.golden" #else-pandocMajorVersion = 2 + "cites-multiple-pandoc-2.0.0plus.golden" #endif
+ tests/data/biblio/cites-meijer-pandoc-2.0.0plus.golden view
@@ -0,0 +1,16 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="utf-8">+ <title>This page cites a paper.</title>+ </head>+ <body>+ <h1>This page cites a paper.</h1>+ <p>I would like to cite one of my favourite papers <span class="citation" data-cites="meijer1991functional">(Meijer, Fokkinga, and Paterson 1991)</span> here.</p>+<div id="refs" class="references csl-bib-body hanging-indent" role="doc-bibliography">+<div id="ref-meijer1991functional" class="csl-entry" role="doc-biblioentry">+Meijer, Erik, Maarten Fokkinga, and Ross Paterson. 1991. <span>“Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire.”</span> In <em>Conference on Functional Programming Languages and Computer Architecture</em>, 124–44. Springer.+</div>+</div>+ </body>+</html>
+ tests/data/biblio/cites-meijer-pandoc-3.0.0plus.golden view
@@ -0,0 +1,16 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="utf-8">+ <title>This page cites a paper.</title>+ </head>+ <body>+ <h1>This page cites a paper.</h1>+ <p>I would like to cite one of my favourite papers <span class="citation" data-cites="meijer1991functional">(Meijer, Fokkinga, and Paterson 1991)</span> here.</p>+<div id="refs" class="references csl-bib-body hanging-indent" role="list">+<div id="ref-meijer1991functional" class="csl-entry" role="listitem">+Meijer, Erik, Maarten Fokkinga, and Ross Paterson. 1991. <span>“Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire.”</span> In <em>Conference on Functional Programming Languages and Computer Architecture</em>, 124–44. Springer.+</div>+</div>+ </body>+</html>
+ tests/data/biblio/cites-meijer-pandoc-3.1.8plus.golden view
@@ -0,0 +1,16 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="utf-8">+ <title>This page cites a paper.</title>+ </head>+ <body>+ <h1>This page cites a paper.</h1>+ <p>I would like to cite one of my favourite papers <span class="citation" data-cites="meijer1991functional">(Meijer, Fokkinga, and Paterson 1991)</span> here.</p>+<div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0" role="list">+<div id="ref-meijer1991functional" class="csl-entry" role="listitem">+Meijer, Erik, Maarten Fokkinga, and Ross Paterson. 1991. <span>“Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire.”</span> In <em>Conference on Functional Programming Languages and Computer Architecture</em>, 124–44. Springer.+</div>+</div>+ </body>+</html>
− tests/data/biblio/cites-meijer-pandoc2.golden
@@ -1,16 +0,0 @@-<!doctype html>-<html lang="en">- <head>- <meta charset="utf-8">- <title>This page cites a paper.</title>- </head>- <body>- <h1>This page cites a paper.</h1>- <p>I would like to cite one of my favourite papers <span class="citation" data-cites="meijer1991functional">(Meijer, Fokkinga, and Paterson 1991)</span> here.</p>-<div id="refs" class="references csl-bib-body hanging-indent" role="doc-bibliography">-<div id="ref-meijer1991functional" class="csl-entry" role="doc-biblioentry">-Meijer, Erik, Maarten Fokkinga, and Ross Paterson. 1991. <span>“Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire.”</span> In <em>Conference on Functional Programming Languages and Computer Architecture</em>, 124–44. Springer.-</div>-</div>- </body>-</html>
− tests/data/biblio/cites-meijer-pandoc3.golden
@@ -1,16 +0,0 @@-<!doctype html>-<html lang="en">- <head>- <meta charset="utf-8">- <title>This page cites a paper.</title>- </head>- <body>- <h1>This page cites a paper.</h1>- <p>I would like to cite one of my favourite papers <span class="citation" data-cites="meijer1991functional">(Meijer, Fokkinga, and Paterson 1991)</span> here.</p>-<div id="refs" class="references csl-bib-body hanging-indent" role="list">-<div id="ref-meijer1991functional" class="csl-entry" role="listitem">-Meijer, Erik, Maarten Fokkinga, and Ross Paterson. 1991. <span>“Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire.”</span> In <em>Conference on Functional Programming Languages and Computer Architecture</em>, 124–44. Springer.-</div>-</div>- </body>-</html>
+ tests/data/biblio/cites-multiple-pandoc-2.0.0plus.golden view
@@ -0,0 +1,20 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="utf-8">+ <title>This page cites a paper and a book.</title>+ </head>+ <body>+ <h1>This page cites a paper and a book.</h1>+ <p>I would like to cite one of my favourite papers <span class="citation" data-cites="meijer1991functional">(Meijer, Fokkinga, and Paterson 1991)</span> here.</p>+<p>And also a book <span class="citation" data-cites="lipovaca2012">(Lipovača 2012)</span>.</p>+<div id="refs" class="references csl-bib-body hanging-indent" role="doc-bibliography">+<div id="ref-lipovaca2012" class="csl-entry" role="doc-biblioentry">+Lipovača, Miran. 2012. <em>Learn You a Haskell for Great Good! A Beginner’s Guide</em>. San Francisco, CA: No Starch Press.+</div>+<div id="ref-meijer1991functional" class="csl-entry" role="doc-biblioentry">+Meijer, Erik, Maarten Fokkinga, and Ross Paterson. 1991. <span>“Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire.”</span> In <em>Conference on Functional Programming Languages and Computer Architecture</em>, 124–44. Springer.+</div>+</div>+ </body>+</html>
+ tests/data/biblio/cites-multiple-pandoc-3.0.0plus.golden view
@@ -0,0 +1,20 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="utf-8">+ <title>This page cites a paper and a book.</title>+ </head>+ <body>+ <h1>This page cites a paper and a book.</h1>+ <p>I would like to cite one of my favourite papers <span class="citation" data-cites="meijer1991functional">(Meijer, Fokkinga, and Paterson 1991)</span> here.</p>+<p>And also a book <span class="citation" data-cites="lipovaca2012">(Lipovača 2012)</span>.</p>+<div id="refs" class="references csl-bib-body hanging-indent" role="list">+<div id="ref-lipovaca2012" class="csl-entry" role="listitem">+Lipovača, Miran. 2012. <em>Learn You a Haskell for Great Good! A Beginner’s Guide</em>. San Francisco, CA: No Starch Press.+</div>+<div id="ref-meijer1991functional" class="csl-entry" role="listitem">+Meijer, Erik, Maarten Fokkinga, and Ross Paterson. 1991. <span>“Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire.”</span> In <em>Conference on Functional Programming Languages and Computer Architecture</em>, 124–44. Springer.+</div>+</div>+ </body>+</html>
+ tests/data/biblio/cites-multiple-pandoc-3.1.8plus.golden view
@@ -0,0 +1,20 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="utf-8">+ <title>This page cites a paper and a book.</title>+ </head>+ <body>+ <h1>This page cites a paper and a book.</h1>+ <p>I would like to cite one of my favourite papers <span class="citation" data-cites="meijer1991functional">(Meijer, Fokkinga, and Paterson 1991)</span> here.</p>+<p>And also a book <span class="citation" data-cites="lipovaca2012">(Lipovača 2012)</span>.</p>+<div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0" role="list">+<div id="ref-lipovaca2012" class="csl-entry" role="listitem">+Lipovača, Miran. 2012. <em>Learn You a Haskell for Great Good! A Beginner’s Guide</em>. San Francisco, CA: No Starch Press.+</div>+<div id="ref-meijer1991functional" class="csl-entry" role="listitem">+Meijer, Erik, Maarten Fokkinga, and Ross Paterson. 1991. <span>“Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire.”</span> In <em>Conference on Functional Programming Languages and Computer Architecture</em>, 124–44. Springer.+</div>+</div>+ </body>+</html>
− tests/data/biblio/cites-multiple-pandoc2.golden
@@ -1,20 +0,0 @@-<!doctype html>-<html lang="en">- <head>- <meta charset="utf-8">- <title>This page cites a paper and a book.</title>- </head>- <body>- <h1>This page cites a paper and a book.</h1>- <p>I would like to cite one of my favourite papers <span class="citation" data-cites="meijer1991functional">(Meijer, Fokkinga, and Paterson 1991)</span> here.</p>-<p>And also a book <span class="citation" data-cites="lipovaca2012">(Lipovača 2012)</span>.</p>-<div id="refs" class="references csl-bib-body hanging-indent" role="doc-bibliography">-<div id="ref-lipovaca2012" class="csl-entry" role="doc-biblioentry">-Lipovača, Miran. 2012. <em>Learn You a Haskell for Great Good! A Beginner’s Guide</em>. San Francisco, CA: No Starch Press.-</div>-<div id="ref-meijer1991functional" class="csl-entry" role="doc-biblioentry">-Meijer, Erik, Maarten Fokkinga, and Ross Paterson. 1991. <span>“Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire.”</span> In <em>Conference on Functional Programming Languages and Computer Architecture</em>, 124–44. Springer.-</div>-</div>- </body>-</html>
− tests/data/biblio/cites-multiple-pandoc3.golden
@@ -1,20 +0,0 @@-<!doctype html>-<html lang="en">- <head>- <meta charset="utf-8">- <title>This page cites a paper and a book.</title>- </head>- <body>- <h1>This page cites a paper and a book.</h1>- <p>I would like to cite one of my favourite papers <span class="citation" data-cites="meijer1991functional">(Meijer, Fokkinga, and Paterson 1991)</span> here.</p>-<p>And also a book <span class="citation" data-cites="lipovaca2012">(Lipovača 2012)</span>.</p>-<div id="refs" class="references csl-bib-body hanging-indent" role="list">-<div id="ref-lipovaca2012" class="csl-entry" role="listitem">-Lipovača, Miran. 2012. <em>Learn You a Haskell for Great Good! A Beginner’s Guide</em>. San Francisco, CA: No Starch Press.-</div>-<div id="ref-meijer1991functional" class="csl-entry" role="listitem">-Meijer, Erik, Maarten Fokkinga, and Ross Paterson. 1991. <span>“Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire.”</span> In <em>Conference on Functional Programming Languages and Computer Architecture</em>, 124–44. Springer.-</div>-</div>- </body>-</html>