haskell - In emacs stack-ghci cannot load interface files but `stack build` from the command line does -


i can stack build project command line when try c-c c-l in emacs (with (custom-set-variables '(haskell-process-type 'stack-ghci))) error package modules import can't found.

/home/amcp011/bec/amcp011/accelerate/gpe/src/numeric/gpe/utils.hs:30:1: error:     failed load interface ‘data.array.accelerate’     locations searched:       data/array/accelerate.hs       data/array/accelerate.lhs       data/array/accelerate.hsig       data/array/accelerate.lhsig       /home/amcp011/bec/amcp011/accelerate/gpe/src/data/array/accelerate.hs       /home/amcp011/bec/amcp011/accelerate/gpe/src/data/array/accelerate.lhs       /home/amcp011/bec/amcp011/accelerate/gpe/src/data/array/accelerate.hsig       /home/amcp011/bec/amcp011/accelerate/gpe/src/data/array/accelerate.lhsig 

gpe.cabal:

build-depends:       base >= 4.7 && < 5                    , bytestring                    , bytestring-conversion                    , mtl                    , time                    , filepath                    , directory                    , accelerate                    , accelerate-io 

stack.yaml:

extra-deps: [accelerate-1.0.0.0             ,accelerate-io-1.0.0.0             ] 

i able compile project stack build (of course, after installing few system wide dependencies llvm, cuda, fftw3 etc.) , load fine c-c c-l in emacs.

here minimal emacs config worked me:

(defun haskell-mode-setup ()   (setq haskell-process-type 'stack-ghci))  (add-hook 'haskell-mode-hook 'interactive-haskell-mode) (add-hook 'haskell-mode-hook 'haskell-mode-setup) 

the ways able replicate issue having inf-haskell-mode, instead of interactive-haskell-mode, setting (setq haskell-process-type 'ghci). so, possible emacs doesn't find stack.

i'd recommend trying let haskell-mode know stack is, in case installed in non-common location: (setq haskell-process-path-stack "/path/to/stack").

alternatively, i've solved few issues in past related $path environment variable being not same set current user, 1 used system wide. install exec-path-from-shell emacs package , add (exec-path-from-shell-initialize) ~/.emacs.

also, if haven't done yet, inspecting haskell-mode log prove being useful. add (setq haskell-process-log t) haskell-mode-setup, result in buffer log.

notes:

  • in order compile package, had remove few lines stack.yaml, namely ones include local dirs /home/amcp011/local/, not included in repo , use system installed gcc instead of 1 rhel6.3.
  • if use other emacs packages besides haskell-mode, might cause of problem well. i've tested intero , flycheck without problems.
  • try upgrading newest stack upgrade , haskell-mode, maybe help. i've tested stack-1.5.1 , haskell-mode-20170824.1124 on emacs-25.2.2

Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -