-
Notifications
You must be signed in to change notification settings - Fork 342
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
Haskell-mode not respecting cabal sandboxes #253
Comments
Having this issue too. Fix needed. |
@Eilie change your repl to |
It doesn't help. I've changed ghci to cabal repl and after loading file within cabal sandbox I'm getting "cannot find module" errors for all external dependencies file having like "Data.Aeson". |
@ellie, I stopped doing it the way I was previous (shown above). Use the following in your .emacs to rebind. ;; rebind inferior mode to interactive mode
(eval-after-load "haskell-mode"
'(progn
(define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload)
(define-key haskell-mode-map (kbd "C-`") 'haskell-interactive-bring)
(define-key haskell-mode-map (kbd "C-c C-t") 'haskell-process-do-type)
(define-key haskell-mode-map (kbd "C-c C-i") 'haskell-process-do-info)
(define-key haskell-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
(define-key haskell-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear)
(define-key haskell-mode-map (kbd "C-c c") 'haskell-process-cabal)
(define-key haskell-mode-map (kbd "SPC") 'haskell-mode-contextual-space)))
;; custom haskell-mode settings
(custom-set-variables
'(haskell-process-log t)
'(haskell-process-type (quote cabal-repl)) ;; mui importante
'(inferior-haskell-wait-and-jump t)) |
@dmijo Thank you! That works fine for library(code inside "library" section of cabal file) but for executables(I have couple of executable with different main files) it fails when executable having additional build-depends. Haskell-mode suggests to add these dependencies from executable to library but that's not quite right since library doesn't actually depends on what executable depends if that makes sense. |
yea, you might have to manually intervene in some cases. Or just split the executables into their own projects. |
@dmjio you might wanna point out that by doing that, you change to the totally different |
@hvr, good point. I believe |
You can switch to different item in the .cabal file with You also need to remember to do a |
Thanks for pointing haskell-session-change-target out. |
@dmjio: Do you consider this fixed for your case? Can we close this issue or should there be a follow up pull request? |
To change the haskell-program-name variable, do: Change 'ghci' to 'cabal repl'. Click the 'Apply and Save' button. |
To change haskell-program-name from 'ghci' to 'cabal repl':
Click 'customize'. |
Haskell-process-type is more relevant.
|
After cabal-installing my project inside of a cabal sandbox (1.18.0.3) I am able to open a
cabal repl
and inspect the packages. When I open up emacs w/ haskell-mode andC-c C-l
to send to ghci I get :How do I get
haskell-mode
to respect cabal sandboxes?The text was updated successfully, but these errors were encountered: