haskell-mode icon indicating copy to clipboard operation
haskell-mode copied to clipboard

Haskell process command errored with: (wrong-type-argument stringp nil)

Open iitalics opened this issue 8 years ago • 11 comments

The above error happens whenever I try to load a buffer into the haskell interactive process (C-c C-l or haskell-process-load-file). I orginally thought it was an issue with ghc-mod, but now I have that installed so I have no idea how to even diagnose the problem. I have had this problem for quite some time now.

I'm running Arch Linux, GHC 8.2.1 using ghc-static. cabal is installed locally, statically from stack-static.

iitalics avatar Oct 26 '17 02:10 iitalics

I have exactly the same problem, running Arch Linux and GHC 8.2.1, Emacs 25.3 and the latest haskell-mode from GitHub

manufactory avatar Oct 27 '17 12:10 manufactory

Same here, Mint/Emacs25.

identicalsnowflake avatar Nov 01 '17 08:11 identicalsnowflake

Does the *haskell-process-log* buffer say anything?

What is your haskell-mode configuration?

ivan-m avatar Nov 01 '17 09:11 ivan-m

I don't see any buffer named *haskell-process-log* (do I have to enable it somewhere?) My .emacs file has this for loading haskell-mode:

(add-to-list 'load-path "~/Tools/haskell-mode/")
(require 'haskell-mode-autoloads)
(add-to-list 'Info-default-directory-list "~/Tools/haskell-mode/")
(add-hook 'haskell-mode-hook 'interactive-haskell-mode)

That Tools/haskell-mode is just cloning this repository and running make.

identicalsnowflake avatar Nov 01 '17 11:11 identicalsnowflake

I got it to work by adding this to my .emacs:

(setq haskell-process-type 'stack-ghci)
(setq haskell-process-path-ghci "stack")

However, I had no configuration before. It appears that it doesn't work without stack. I'm not sure why, and it would be nice if there was a better error message than given. Before, it would just spit the following to *Messages*:

Compiling: Main (s.hs)
Collecting type info for 1 module(s) ...
Haskell process command errored with: (wrong-type-argument stringp nil)

iitalics avatar Nov 02 '17 16:11 iitalics

Hello guys, I've also ran into the same issue and here's what my *haskell-process-log* says

("Starting inferior GHCi process ghci ..." "haskell" nil "ghci" "-ferror-spans")
-> Prelude.putStrLn ""
   :set -v1
   :set +c
-> :set prompt "\4"
-> :set prompt2 "λ| "
<- GHCi, version 8.2.1: http://www.haskell.org/ghc/  :? for help
   
<- Prel
<- ude> 
   Prelude> Prelude> Prelude> Some flags have not been recognized: prompt2, λ| 

emptylambda avatar Nov 15 '17 14:11 emptylambda

It seems that :set prompt2 is now called :set prompt-cont.

adamse avatar Nov 17 '17 21:11 adamse

I have the same problem. This https://github.com/haskell/haskell-mode/pull/1573 might help. As far as I understand until ghc 8.2.2 with -fshow-loaded-modules there is no way to load required into ghci. Please correct me if I'm wrong.

pvmart avatar Nov 23 '17 08:11 pvmart

@pvmart your patch works for me! C-c C-l loads successfully now and properly shows warnings (GHC 8.2.2).

identicalsnowflake avatar Nov 27 '17 18:11 identicalsnowflake

@pvmart Thanks for the patch! also working like a charm on my system

emptylambda avatar Jan 15 '18 08:01 emptylambda

with respect to adamse analysis above, I am seeing the same issue but the error message is (error "Unexpected response from haskell process)

I have thus updated #1496

I don't see the original problem on the latest version of haskell-mode so perhaps this issue can be closed?

GeorgeCo avatar Aug 11 '18 15:08 GeorgeCo