I'm now learning hakyll static site generator with stack.
When I execute stack build
in the directory of my Hakyll site to rebuild site.hs
, stack also rebuilds and copy/register dependencies each time, as shown below:
$ stack --version
Version 1.6.5, Git revision 24ab0d6ff07f28276e082c3ce74dfdeb1a2ca9e9 (5514 commits) x86_64 hpack-0.20.0
$ grep -Ev '^[[:space:]]*#' stack.yaml | uniq
resolver: lts-11.4
packages:
- .
$ stack build
haddock-library-1.4.5: configure
haddock-library-1.4.5: build
haddock-library-1.4.5: copy/register
pandoc-2.1.2: configure
pandoc-2.1.2: build
pandoc-2.1.2: copy/register
pandoc-citeproc-0.14.3: configure
pandoc-citeproc-0.14.3: build
pandoc-citeproc-0.14.3: copy/register
hakyll-4.12.1.0: configure
hakyll-4.12.1.0: build
hakyll-4.12.1.0: copy/register
... and site.hs.compilation ...
This is odd to me, because I have never changed those packages.
The rebuild takes quite long even for very small changes on site.hs
.
Why does stack rebuild those packages? And is there any way to reduce this rebuild time?
Thank you.
There is a discussion of this here https://github.com/commercialhaskell/stack/issues/3899 . It's a known issue triggered by newer versions of haddock using sub-libraries. There's a PR open fixing the issue, but it hasn't been merged yet.