Description
If you remove a module and then run stack ghci
before stack build
, it fails with a Could not find module
error.
Hypothesis:
The build doesn't run before stack ghci
reads the modules, so it doesn't get a chance to re-write the .dump-hi files with the updated information (that the module does not exist), so stack ghci
is still reading the out-of-date information.
Notes from @chrisdone:
as a heads up the stack ghci code uses the build info, but runs the equiv. of
stack build —only-dependencies
to ensure that dependencies are available
at a guess, it seems that the build cache doesn’t get invalidated by simply reading it in the manner that stack ghci does, but i didn’t get niklas to test withstack build
to see if running that would trigger a cache invalidation
the building with—only-dependencies
was enabled to avoid ghci not being able to start when there’s a build error. i don’t like that fix, i’d prefer if the build just ran and if it fails then it should catch the exception and print the compile error but still launch ghci anyway in an optimistic way (edited)
It's likely that fixing #1065 will also fix this, but tracking separately since the symptoms are different.
(PAT-125)