-
Notifications
You must be signed in to change notification settings - Fork 842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
qAddDependentFile doesn't cause re-compilation without extra-source-files #4360
Comments
I'm on my phone and can't search, but I'm fairly certain this is a bug that's been fixed on master. There was a change in the format of output from GHC. |
Yeah, I was referring to this: https://www.haskell.org/cabal/users-guide/developing-packages.html#pkg-field-extra-source-files |
@pbrisbin Do check the new version, when you get a chance — that should fix it. |
Ok, I can reproduce |
The change that should fix this is only on the master branch, not on 1.9. |
Unfortunately, it appears that fix does not solve this issue. In GHC 8.2 and earlier, the |
The workaround suggested by @pbrisbin to add the templates to Stack has lost the association between template file and Haskell module. This is because starting in GHC 8.4, GHC does not seem to report template files in the If you add the template file to |
Hmm shakespeare explicitly reports its files to GHC as dependent files. This is starting to look like a GHC bug. I will investigate further. |
@ygale only the version |
@tolysz Ahh yes that was it. Thanks!! In summary: To resolve this issue you need:
As of this writing stack 1.9.3 is not yet released. For now, you can build stack 1.9.2 from the stable branch on github and it will work. If you use Stackage LTS, upgrade to at least 12.14, currently the latest, to get the right version of shakespeare. Or specify A million thanks to the stack team for getting this fixed! |
Steps to reproduce
Set up a repro project with
stack new --bare repro
Add a file
templates/example.hamlet
Update
Lib.hs
to(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
To
package.yaml
, it works as expected. This should not be necessary as this packaging field is only documented as related to including files insdist
, not as a requirement forqAddDependentFile
to work.Stack version
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.The text was updated successfully, but these errors were encountered: