1

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.

kaznak
  • 28
  • 5
  • 1
    This shouldn't be happening. (1) Is there anything else specified in your `stack.yaml` other than the resolver? If so, please [edit] the file into your question. (2) Just to make sure: only the four packages mentioned in the console output you posted get rebuilt, right? – duplode Apr 13 '18 at 02:35
  • Thank you duplode. (1) I fixed stack.yaml. This stack.yaml is generated one while I'm doing hakyll tutorial and contains lots of comments. (2) Yes, stack recompile 4 additional packages. I have tried this on completely new hakyll project now. stack is now compiling these 4 additionally. – kaznak Apr 13 '18 at 02:45

1 Answers1

4

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.

mgsloan
  • 3,245
  • 21
  • 20