You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you remove a module from a project and erase all mentions of it from the cabal file and other source files, stack ghci may still attempt to load it (and fail).
This happens because Stack.Package.getDependencies will resurrect the dead module name from a stale interface file.
I don't really know what to do about this, but it sure was annoying and took me quite some time to figure out.
That definitely sounds like a bug. I think at one point it was the other way around (where modules left out of the .cabal file but referenced by source files wouldn't get loaded), but this is going a bit too far :)
Does running stack build and then stack ghci again help? In theory, the stack build should refresh the interface files and remove mentions of the removed module. Although stack ghci should be running the build first anyway, unless you're passing in --no-build.
In my case, the code wasn't buildable. It contained some errors that I was going to fix with the help of ghci. So, I guess stack did try to build it but failed.
Yup, that explains it! Perhaps for the GHCI case we could have it skip any unlisted module which can't be found on the file system. In any case, we could make the warning in case of failed pre-GHCi build more clear that there can be inconsistent results.
If you remove a module from a project and erase all mentions of it from the cabal file and other source files,
stack ghci
may still attempt to load it (and fail).This happens because
Stack.Package.getDependencies
will resurrect the dead module name from a stale interface file.I don't really know what to do about this, but it sure was annoying and took me quite some time to figure out.
The text was updated successfully, but these errors were encountered: