-
Notifications
You must be signed in to change notification settings - Fork 841
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
GHCI script shouldn't load packages separately #3309
Comments
@mgsloan, while dogfooding with the latest stack, I discovered that the default Here's my log: λ ~/hobby/stack/ master stack --version
Version 1.5.1, Git revision e6fde2ef177dd31d4d68bb204d4e0dc3c3920f81 (5118 commits) x86_64 hpack-0.18.1
λ ~/hobby/stack/ master stack ghci
Configuring GHCi with the following packages:
GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/lwm/dotfiles/dotfiles/ghc/ghci
Loaded GHCi configuration from /tmp/ghci20785/ghci-script
λ :show modules
λ :load src/Stack/Upload.hs
[1 of 1] Compiling Stack.Upload ( src/Stack/Upload.hs, interpreted )
Ok, modules loaded: Stack.Upload.
λ :show modules
Stack.Upload ( src/Stack/Upload.hs, interpreted ) |
@lwm Ah, good catch, silly mistake on my part. Fix pushed to master. |
Nice one! 🍻 |
#2457 added a change to load packages individually. This has caused some non-ideal behavior when loading multiple packages into ghci / intero. Also, I've observed that the approach doesn't work in general, its success is non-deterministic. In particular:
This causes it to output "Ok, modules loaded: " messages N types, where N = number of packages.
If an error occurs, it can be repeated upto N times, filling up your console with duplicated errors.
It doesn't order the packages based on dependency order, so if package A is before package B in the list, and A depends on B, by the time it asks to load B's modules, they've already been loaded. So sometimes the source path setting doesn't work. So, the primary motivation for that change doesn't always work.
Intero re-collects type info for every load statement. This is probably an issue with intero. But since it is
The setting of cwd does not replay on reload.
So generally, that change was a major downgrade in how
stack ghci
behaves, and it does not really properly support switching cwd.I'm working on a change to go back to pretty much how scripts were generated before, this is documenting the motivation for the change. It will still benefit from
:cd-ghc
in the case that intero is just loading one package, which I believe is the default in emacsThe text was updated successfully, but these errors were encountered: