-
Notifications
You must be signed in to change notification settings - Fork 17
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
Updating static files never triggers recompilation #118
Comments
When I run locally, all tests pass. I haven't looked at the individual test cases that are run. |
I've confirmed that this occurs even without Hamlet being involved: {-# LANGUAGE OverloadedStrings #-}
module Main where
import IdeSession
import Data.Monoid (mconcat)
import qualified Data.ByteString.Lazy.Char8 as L8
main :: IO ()
main = do
sess <- initSession (SessionInitParams Nothing) defaultSessionConfig
{ configDir = "."
}
let cb = \_ -> return ()
update = flip (updateSession sess) cb
let mainContents = L8.pack $ unlines
[ "{-# LANGUAGE TemplateHaskell #-}"
, "import Language.Haskell.TH.Syntax"
, "main = print ($(do"
, " qAddDependentFile \"foo.hamlet\""
, " s <- qRunIO $ readFile \"foo.hamlet\""
, " lift $ (read s :: Int)"
, " ) :: Int)"
]
update $ mconcat
[ updateModule "Main.hs" mainContents
, updateDataFile "foo.hamlet" "invalid"
]
-- Error message expected, invalid data file
getSourceErrors sess >>= print . length
update $ updateDataFile "foo.hamlet" "42"
-- No error message expected, but got one anyway
getSourceErrors sess >>= print . length
update $ updateModule "Main.hs" $ mainContents `L8.append` "\n\n-- Trigger a recompile"
-- No more error message
getSourceErrors sess >>= print . length
update $ updateDataFile "foo.hamlet" "invalid"
-- Error message expected, but recompilation is not triggered.
getSourceErrors sess >>= print . length |
Just for the record, this is a problem with ghc itself; see also https://github.com/fpco/fpco/issues/2338. |
We now have a fix for this (ie fix to ghc) in our experimental branch. See also #134 however. |
Confirmed that this is resolved by the ghc patch. |
This seems to be a resurfacing of #94. Using the same code from that issue (slightly updated to include SessionInitParams):
I would expect the last set of error messages to be non-empty due to the invalid Hamlet syntax. Instead, I'm getting no error messages. This seems to be the cause of a production bug: fpco/fpco#2338.
Pinging @jwiegley, we should make sure to get an isolation-runner test for this.
The text was updated successfully, but these errors were encountered: