Description
Steps to reproduce
-
Set up a repro project with
stack new --bare repro
-
Add a file
templates/example.hamlet
<h1>Hi
-
Update
Lib.hs
to{-# LANGUAGE TemplateHaskell #-} module Lib ( someFunc ) where import Text.Blaze.Html.Renderer.Pretty import Text.Hamlet someFunc :: IO () someFunc = putStrLn $ renderHtml $(shamletFile "templates/example.hamlet")
(Add the
shakespeare
andblaze-html
dependencies as necessary.) -
Start up
stack build --file-watch
-
Modify the contents of
templates/example.hamlet
Expected
Modifying templates/example.hamlet
should trigger re-compilation.
Actual
It does not. However, if I add
extra-source-files:
- templates/*
To package.yaml
, it works as expected. This should not be necessary as this packaging field is only documented as related to including files in sdist
, not as a requirement for qAddDependentFile
to work.
Stack version
$ stack --version
Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2
Method of installation
https://aur.archlinux.org/packages/stack-static/
Notes
It's definitely an assumption on my part that this boils down to qAddDependentFile
. So I apologize if that's not actually the case. Another way to phrase it could be, external files referenced in TemplateHaskell don't cause re-compilation....
I've reproduced this bug with pretty much every file-reading TH function in a standard Yesod app (parseRoutesFile
, widgetFile
, etc).
I wouldn't have guessed this was Stack's responsibility either, but cocreature
in #haskell
encouraged me to report this bug here.