Skip to content
This repository has been archived by the owner on Mar 14, 2021. It is now read-only.

Haskell-ghc-mod: ghc-mod command check failed with error Error #126

Closed
ghost opened this issue Mar 15, 2016 · 14 comments
Closed

Haskell-ghc-mod: ghc-mod command check failed with error Error #126

ghost opened this issue Mar 15, 2016 · 14 comments

Comments

@ghost
Copy link

ghost commented Mar 15, 2016

Make a file with this contents

module Main where

import Lib
import Control.Monad(forever)
import Data.Char (toLower)
import Data.Maybe (isJust)
import Data.List (intersperse)
import System.Exit(exitSuccess)
import System.Ramdom(randomRIO)

type WordList = [String]

minWordLength :: Int
minWordLength = 5

maxWordLength :: Int
maxWordLength = 9

allWords :: IO WordList
allWords = do
dict <- readfille ¨data/words
return (lines dict)

gameWords :: IO WordList
gameWords = do
aw <- allWords
return (filter gameLength aw)
where gameLength w =
let l = length (w :: String)
in l > winWordLength && l < maxWordLength

randomWord :: Wordlist -> IO String
randomWord wl = do
randomIndex <- randomIO ( 0, length wl - 1 )
return $ wl !! randomIndex

randomWord' :: IO String
randomWord' = gameWords >>= randomWord

.Save the file

Atom Version: 1.5.4
_System: Ubuntu 15.10
*_Thrown From: Atom Core
Stack Trace

Haskell-ghc-mod: ghc-mod command check failed with error Error

At caps: {"version":[5,5,0,0],"legacyInteractive":true,"fileMap":true,"rootExec":false,"quoteArgs":true,"optparse":true}
URI: /home/roelof/Documents/haskellbook/chapter_13/hangman/app/Main.hs
Args: --
message: spawn ghc-mod ENOENT
log:
-28.82s: Trying to run ghc-modi in /home/roelof/Documents/haskellbook/chapter_13/hangman
-28.819s: Checking for ghc-modi in /home/roelof/Documents/haskellbook/chapter_13/hangman
-28.819s: Found running ghc-modi instance for /home/roelof/Documents/haskellbook/chapter_13/hangman
-28.816s: Timeout
-28.768s: Trying to run ghc-modi in /home/roelof/Documents/haskellbook/chapter_13/hangman
-28.768s: Checking for ghc-modi in /home/roelof/Documents/haskellbook/chapter_13/hangman
-28.768s: Found running ghc-modi instance for /home/roelof/Documents/haskellbook/chapter_13/hangman
-28.768s: Timeout
-0.094s: running ghc-mod check,/home/roelof/Documents/haskellbook/chapter_13/hangman/app/Main.hs,-- with options.cwd = /home/roelof/Documents/haskellbook/chapter_13/hangman,options.env = [object Object],options.encoding = utf-8
-0.076s: running ghc-mod lint,/home/roelof/Documents/haskellbook/chapter_13/hangman/app/Main.hs,-- with options.cwd = /home/roelof/Documents/haskellbook/chapter_13/hangman,options.env = [object Object],options.encoding = utf-8
-0.063s: Main did-save triggered
-0.063s: Main updating
-0.063s: running ghc-mod browse,-d,--,Main with options.cwd = /home/roelof/Documents/haskellbook/chapter_13/hangman,options.env = [object Object],options.encoding = utf-8
-0.047s: Using fallback child_process because of spawn ghc-mod ENOENT
-0.029s: Using fallback child_process because of spawn ghc-mod ENOENT
-0.016s: Using fallback child_process because of spawn ghc-mod ENOENT
0s: Error: spawn ghc-mod ENOENT

Error: spawn ghc-mod ENOENT
at exports._errnoException (util.js:837:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at doNTCallback2 (node.js:441:9)
at process._tickCallback (node.js:355:17)

Commands

 -2:36.4.0 editor:newline (atom-text-editor.editor.is-focused)
 -1:46.3.0 core:move-right (atom-text-editor.editor.is-focused)
 -1:31.3.0 core:backspace (atom-text-editor.editor.is-focused)
 -1:27.9.0 core:move-left (atom-text-editor.editor.is-focused)

2x -1:26.3.0 core:move-right (atom-text-editor.editor.is-focused)
2x -1:20.2.0 editor:newline (atom-text-editor.editor.is-focused)
2x -1:18.8.0 core:move-left (atom-text-editor.editor.is-focused)
-1:17.9.0 core:move-down (atom-text-editor.editor.is-focused)
5x -1:17 core:move-up (atom-text-editor.editor.is-focused)
5x -1:15.7.0 core:move-down (atom-text-editor.editor.is-focused)
-0:44.2.0 editor:newline (atom-text-editor.editor.is-focused)
3x -0:41.9.0 core:backspace (atom-text-editor.editor.is-focused.autocomplete-active)
-0:30.5.0 core:move-down (atom-text-editor.editor.is-focused.autocomplete-active)
-0:29.7.0 autocomplete-plus:confirm (atom-text-editor.editor.is-focused.autocomplete-active)
2x -0:07.6.0 editor:newline (atom-text-editor.editor.is-focused)
-0:02.2.0 core:save (atom-text-editor.editor.is-focused)

Config

{
"core": {},
"editor": {
"invisibles": {}
}
}

Installed Packages

User

autocomplete-haskell, v0.6.2
haskell-ghc-mod, v1.11.0
ide-haskell, v1.5.3
ide-haskell-repl, v0.0.19
ide-haskell-stack, v0.0.3
language-haskell, v1.7.2

Dev

No dev packages

@lierdakil
Copy link
Contributor

Please update Atom and packages.

2016-06-17 5:08 GMT+03:00 2426021684 [email protected]:

Same on OS X


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#126 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AG8EZm0ASsZfky5g93g0L__f2XAIVYQPks5qMgG6gaJpZM4HxXr4
.

@romildo
Copy link

romildo commented Jun 17, 2016

I am getting a similar error with Atom 1.8.0 and the following installed packages:

[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

@lierdakil
Copy link
Contributor

Sanity check: did you install ghc-mod?
https://github.com/atom-haskell/ide-haskell#requirements

I need full logs to debug this (or frankly any other) issue. When Atom
reports an error, there's a clipboard icon next to 'View Issue'. Click it,
that will copy report text to clipborad, and then paste it here. Beware,
some low-sensetivity private information might be included (like system
paths, project names, module names, possibly some types).

2016-06-17 21:28 GMT+03:00 2426021684 [email protected]:

@lierdakil https://github.com/lierdakil updated same issue


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#126 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AG8EZs8qlSNYt6NYiTQMouHDei9dG7Bqks5qMudWgaJpZM4HxXr4
.

@romildo
Copy link

romildo commented Jun 18, 2016

Sanity check: did you install ghc-mod?

Yes, but I have not tested it alone first. ghc-mod is not working. Sorry for the noise.

@jjohnson382
Copy link

I'm getting a similar error and I deciphered my error message to be communicating

ghc-mod: <command line>: cannot satisfy -package-id aeson-0.9.0.1-e2091dbe652be71b5246681ed5c1a48b: 
    aeson-0.9.0.1-e2091dbe652be71b5246681ed5c1a48b is unusable due to missing or recursive dependencies:

@LoranceChen
Copy link

Also meet similar trouble. I'm use stack to build my project, with command stack exec atom can avoid this problem.
Hope can support some help to the problem.

@lierdakil
Copy link
Contributor

lierdakil commented Aug 21, 2016

Carefully read https://github.com/atom-haskell/haskell-ghc-mod/wiki/Using-with-stack. TL;DR: run stack build ghc-mod in your project directory; then make sure 'Stack Sandbox' is enabled in haskell-ghc-mod settings.

Also, make sure you're running at least Atom 1.8.0 and latest haskell-ghc-mod and ide-haskell packages. Old versions are not supported.

Please open new issues with detailed traces if you require help.

@buggymcbugfix
Copy link

This works, but remember to make sure you set the path to ghc mod to default:

If you enable 'Stack Sandbox' in haskell-ghc-mod settings (enabled by default), and leave 'Ghc Mod Path' as default ghc-mod (i.e. no actual path), Atom should automatically pick up local stack installation.

@VitaliZaharenko
Copy link

VitaliZaharenko commented Mar 3, 2017

  1. I've just created a new project with stack new and got this error.
  2. A couple of days before, I created an other project in the same way, and all worked fine. It was the only one difference. Stack created old project with lts-8.2, but the new one with lts-8.3. I tried to change version in stack.yaml to resolver: lts-8.2 and I've deleted lts-8.3 folder in .stack-work in a project folder, but error is still here.

Atom: 1.14.3 x64
Electron: 1.3.13
OS: Linux Mint
Thrown From: haskell-ghc-mod package 1.19.7

Stack Trace

Haskell-ghc-mod: ghc-mod command check failed with error Error

At caps: {"version":[5,7,0,0],"fileMap":true,"quoteArgs":true,"optparse":true,"typeConstraints":true,"browseParents":true,"interactiveCaseSplit":true,"importedFrom":false}
URI: /media/veracrypt1/Haskell/real-w-haskell/src/Lib.hs
Args: --
message: Command failed: /home/vitali/.cabal/bin/ghc-mod check /media/veracrypt1/Haskell/real-w-haskell/src/Lib.hs --
ghc-mod: /home/vitali/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/pkgdb/package.cache: GHC.PackageDb.readPackageDb: inappropriate type (Not a valid Unicode code point!)

log:
-4.847s: "Trying to run ghc-modi in /media/veracrypt1/Haskell/real-w-haskell"
-4.846s: "Checking for ghc-modi in /media/veracrypt1/Haskell/real-w-haskell"
-4.846s: "Spawning new ghc-modi instance for /media/veracrypt1/Haskell/real-w-haskell with",{"cwd":"/media/veracrypt1/Haskell/real-w-haskell","env":{"ATOM_HOME":"/home/vitali/.atom","NODE_PATH":"/usr/share/atom/resources/app.asar/exports","NODE_ENV":"production","LC_PAPER":"ru_RU.UTF-8","XDG_VTNR":"7","LC_ADDRESS":"ru_RU.UTF-8","XDG_SESSION_ID":"c1","SSH_AGENT_PID":"2089","rvm_bin_path":"/home/vitali/.rvm/bin","LC_MONETARY":"ru_RU.UTF-8","GIO_LAUNCHED_DESKTOP_FILE_PID":"20908","QT_STYLE_OVERRIDE":"gtk","GPG_AGENT_INFO":"/home/vitali/.gnupg/S.gpg-agent:0:1","DESKTOP_STARTUP_ID":"nemo-2273-vitali-notebook-/usr/share/atom/atom-155_TIME597380979","SHELL":"/bin/bash","XDG_SESSION_COOKIE":"2a5d5f96ef9147c0b35535562b32d0ff-1487614688.129437-1674860304","QT_LINUX_ACCESSIBILITY_ALWAYS_ON":"1","LC_NUMERIC":"ru_RU.UTF-8","GTK_MODULES":"gail:atk-bridge","rvm_stored_umask":"0022","USER":"vitali","LS_COLORS":"","QT_ACCESSIBILITY":"1","LC_TELEPHONE":"ru_RU.UTF-8","_system_type":"Linux","rvm_path":"/home/vitali/.rvm","INSIDE_NEMO_PYTHON":"","SSH_AUTH_SOCK":"/run/user/1000/keyring/ssh","SESSION_MANAGER":"local/vitali-notebook:@/tmp/.ICE-unix/2013,unix/vitali-notebook:/tmp/.ICE-unix/2013","USERNAME":"vitali","DEFAULTS_PATH":"/usr/share/gconf/cinnamon.default.path","GIO_LAUNCHED_DESKTOP_FILE":"/usr/share/applications/atom.desktop","XDG_CONFIG_DIRS":"/etc/xdg/xdg-cinnamon:/etc/xdg","rvm_prefix":"/home/vitali","GOOGLE_API_KEY":"AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q","PATH":"/media/veracrypt1/Haskell/real-w-haskell/.stack-work/install/x86_64-linux/lts-8.3/8.0.2/bin:/home/vitali/.stack/snapshots/x86_64-linux/lts-8.3/8.0.2/bin:/home/vitali/.stack/programs/x86_64-linux/ghc-8.0.2/bin:/home/vitali/.local/bin:/usr/local/heroku/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/vitali/.rvm/bin","DESKTOP_SESSION":"cinnamon","rvm_loaded_flag":"1","LC_IDENTIFICATION":"ru_RU.UTF-8","GDM_XSERVER_LOCATION":"local","PWD":"/home/vitali","LANG":"en_US.UTF-8","MANDATORY_PATH":"/usr/share/gconf/cinnamon.mandatory.path","LC_MEASUREMENT":"ru_RU.UTF-8","_system_arch":"x86_64","_system_version":"18","MDM_XSERVER_LOCATION":"local","GDMSESSION":"cinnamon","rvm_version":"1.27.0 (latest)","SHLVL":"1","HOME":"/home/vitali","XDG_SEAT":"seat0","GNOME_DESKTOP_SESSION_ID":"this-is-deprecated","GTK_OVERLAY_SCROLLING":"1","XDG_SESSION_DESKTOP":"cinnamon","LOGNAME":"vitali","XDG_DATA_DIRS":"/usr/share/cinnamon:/usr/share/gnome:/usr/local/share/:/usr/share/:/usr/share/mdm/","DBUS_SESSION_BUS_ADDRESS":"unix:abstract=/tmp/dbus-pFFGHbdwbi,guid=3f322819a6999eaf1abbca7b58ab32e1","LESSOPEN":"| /usr/bin/lesspipe %s","MDMSESSION":"cinnamon","WINDOWPATH":"7","DISPLAY":":0","XDG_RUNTIME_DIR":"/run/user/1000","MDM_LANG":"en_US.UTF-8","XDG_CURRENT_DESKTOP":"X-Cinnamon","LESSCLOSE":"/usr/bin/lesspipe %s %s","rvm_user_install_flag":"1","_system_name":"Mint","LC_NAME":"ru_RU.UTF-8","XAUTHORITY":"/home/vitali/.Xauthority","_":"/usr/bin/env"},"encoding":"utf-8","maxBuffer":null}
-4.845s: "Spawning new ghc-modi instance for /media/veracrypt1/Haskell/real-w-haskell with options = ",{"cwd":"/media/veracrypt1/Haskell/real-w-haskell","env":{"ATOM_HOME":"/home/vitali/.atom","NODE_PATH":"/usr/share/atom/resources/app.asar/exports","NODE_ENV":"production","LC_PAPER":"ru_RU.UTF-8","XDG_VTNR":"7","LC_ADDRESS":"ru_RU.UTF-8","XDG_SESSION_ID":"c1","SSH_AGENT_PID":"2089","rvm_bin_path":"/home/vitali/.rvm/bin","LC_MONETARY":"ru_RU.UTF-8","GIO_LAUNCHED_DESKTOP_FILE_PID":"20908","QT_STYLE_OVERRIDE":"gtk","GPG_AGENT_INFO":"/home/vitali/.gnupg/S.gpg-agent:0:1","DESKTOP_STARTUP_ID":"nemo-2273-vitali-notebook-/usr/share/atom/atom-155_TIME597380979","SHELL":"/bin/bash","XDG_SESSION_COOKIE":"2a5d5f96ef9147c0b35535562b32d0ff-1487614688.129437-1674860304","QT_LINUX_ACCESSIBILITY_ALWAYS_ON":"1","LC_NUMERIC":"ru_RU.UTF-8","GTK_MODULES":"gail:atk-bridge","rvm_stored_umask":"0022","USER":"vitali","LS_COLORS":"","QT_ACCESSIBILITY":"1","LC_TELEPHONE":"ru_RU.UTF-8","_system_type":"Linux","rvm_path":"/home/vitali/.rvm","INSIDE_NEMO_PYTHON":"","SSH_AUTH_SOCK":"/run/user/1000/keyring/ssh","SESSION_MANAGER":"local/vitali-notebook:@/tmp/.ICE-unix/2013,unix/vitali-notebook:/tmp/.ICE-unix/2013","USERNAME":"vitali","DEFAULTS_PATH":"/usr/share/gconf/cinnamon.default.path","GIO_LAUNCHED_DESKTOP_FILE":"/usr/share/applications/atom.desktop","XDG_CONFIG_DIRS":"/etc/xdg/xdg-cinnamon:/etc/xdg","rvm_prefix":"/home/vitali","GOOGLE_API_KEY":"AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q","PATH":"/media/veracrypt1/Haskell/real-w-haskell/.stack-work/install/x86_64-linux/lts-8.3/8.0.2/bin:/home/vitali/.stack/snapshots/x86_64-linux/lts-8.3/8.0.2/bin:/home/vitali/.stack/programs/x86_64-linux/ghc-8.0.2/bin:/home/vitali/.local/bin:/usr/local/heroku/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/vitali/.rvm/bin","DESKTOP_SESSION":"cinnamon","rvm_loaded_flag":"1","LC_IDENTIFICATION":"ru_RU.UTF-8","GDM_XSERVER_LOCATION":"local","PWD":"/home/vitali","LANG":"en_US.UTF-8","MANDATORY_PATH":"/usr/share/gconf/cinnamon.mandatory.path","LC_MEASUREMENT":"ru_RU.UTF-8","_system_arch":"x86_64","_system_version":"18","MDM_XSERVER_LOCATION":"local","GDMSESSION":"cinnamon","rvm_version":"1.27.0 (latest)","SHLVL":"1","HOME":"/home/vitali","XDG_SEAT":"seat0","GNOME_DESKTOP_SESSION_ID":"this-is-deprecated","GTK_OVERLAY_SCROLLING":"1","XDG_SESSION_DESKTOP":"cinnamon","LOGNAME":"vitali","XDG_DATA_DIRS":"/usr/share/cinnamon:/usr/share/gnome:/usr/local/share/:/usr/share/:/usr/share/mdm/","DBUS_SESSION_BUS_ADDRESS":"unix:abstract=/tmp/dbus-pFFGHbdwbi,guid=3f322819a6999eaf1abbca7b58ab32e1","LESSOPEN":"| /usr/bin/lesspipe %s","MDMSESSION":"cinnamon","WINDOWPATH":"7","DISPLAY":":0","XDG_RUNTIME_DIR":"/run/user/1000","MDM_LANG":"en_US.UTF-8","XDG_CURRENT_DESKTOP":"X-Cinnamon","LESSCLOSE":"/usr/bin/lesspipe %s %s","rvm_user_install_flag":"1","_system_name":"Mint","LC_NAME":"ru_RU.UTF-8","XAUTHORITY":"/home/vitali/.Xauthority","_":"/usr/bin/env"},"encoding":"utf-8","maxBuffer":null}
-4.824s: "Started interactive action block in /media/veracrypt1/Haskell/real-w-haskell"
-4.821s: "Running ghc-modi command type","/media/veracrypt1/Haskell/real-w-haskell/src/Lib.hs","-c","--",5,11
-4.576s: "ghc-modi said: Warning: File listed in real-w-haskell.cabal file does not exist: README.md"
-4.316s: "ghc-modi said: Warning: File listed in real-w-haskell.cabal file does not exist: README.md"
-4.186s: "ghc-modi said: real-w-haskell-0.1.0.0: configure (lib + exe)"
-3.638s: "ghc-modi said: Configuring real-w-haskell-0.1.0.0..."
-3.114s: "ghc-modi said: ghc-mod: /home/vitali/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/pkgdb/package.cache: GHC.PackageDb.readPackageDb: inappropriate type (Not a valid Unicode code point!)"
-3.092s: "ghc-modi said: EXCEPTION: types:"
-3.092s: "ghc-modi said:            /home/vitali/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/pkgdb/package.cache: GHC.PackageDb.readPackageDb: inappropriate type (Not a valid Unicode code point!)"
-3.091s: "Got response from ghc-modi:\nOK\n"
-3.091s: "Ended interactive action block in /media/veracrypt1/Haskell/real-w-haskell"
-3.09s: "Trying to run ghc-modi in /media/veracrypt1/Haskell/real-w-haskell"
-3.089s: "Checking for ghc-modi in /media/veracrypt1/Haskell/real-w-haskell"
-3.089s: "Found running ghc-modi instance for /media/veracrypt1/Haskell/real-w-haskell"
-3.089s: "Started interactive action block in /media/veracrypt1/Haskell/real-w-haskell"
-3.089s: "Running ghc-modi command info","/media/veracrypt1/Haskell/real-w-haskell/src/Lib.hs","--",""
-2.944s: "ghc-modi said: EXCEPTION: info:"
-2.944s: "ghc-modi said:                /home/vitali/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/pkgdb/package.cache: GHC.PackageDb.readPackageDb: inappropriate type (Not a valid Unicode code point!)"
-2.943s: "Got response from ghc-modi:\nCannot show info\nOK\n"
-2.943s: "Ended interactive action block in /media/veracrypt1/Haskell/real-w-haskell"
-0.391s: "Running /home/vitali/.cabal/bin/ghc-mod check,/media/veracrypt1/Haskell/real-w-haskell/src/Lib.hs,-- with opts = ",{"cwd":"/media/veracrypt1/Haskell/real-w-haskell","env":{"ATOM_HOME":"/home/vitali/.atom","NODE_PATH":"/usr/share/atom/resources/app.asar/exports","NODE_ENV":"production","LC_PAPER":"ru_RU.UTF-8","XDG_VTNR":"7","LC_ADDRESS":"ru_RU.UTF-8","XDG_SESSION_ID":"c1","SSH_AGENT_PID":"2089","rvm_bin_path":"/home/vitali/.rvm/bin","LC_MONETARY":"ru_RU.UTF-8","GIO_LAUNCHED_DESKTOP_FILE_PID":"20908","QT_STYLE_OVERRIDE":"gtk","GPG_AGENT_INFO":"/home/vitali/.gnupg/S.gpg-agent:0:1","DESKTOP_STARTUP_ID":"nemo-2273-vitali-notebook-/usr/share/atom/atom-155_TIME597380979","SHELL":"/bin/bash","XDG_SESSION_COOKIE":"2a5d5f96ef9147c0b35535562b32d0ff-1487614688.129437-1674860304","QT_LINUX_ACCESSIBILITY_ALWAYS_ON":"1","LC_NUMERIC":"ru_RU.UTF-8","GTK_MODULES":"gail:atk-bridge","rvm_stored_umask":"0022","USER":"vitali","LS_COLORS":"","QT_ACCESSIBILITY":"1","LC_TELEPHONE":"ru_RU.UTF-8","_system_type":"Linux","rvm_path":"/home/vitali/.rvm","INSIDE_NEMO_PYTHON":"","SSH_AUTH_SOCK":"/run/user/1000/keyring/ssh","SESSION_MANAGER":"local/vitali-notebook:@/tmp/.ICE-unix/2013,unix/vitali-notebook:/tmp/.ICE-unix/2013","USERNAME":"vitali","DEFAULTS_PATH":"/usr/share/gconf/cinnamon.default.path","GIO_LAUNCHED_DESKTOP_FILE":"/usr/share/applications/atom.desktop","XDG_CONFIG_DIRS":"/etc/xdg/xdg-cinnamon:/etc/xdg","rvm_prefix":"/home/vitali","GOOGLE_API_KEY":"AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q","PATH":"/media/veracrypt1/Haskell/real-w-haskell/.stack-work/install/x86_64-linux/lts-8.3/8.0.2/bin:/home/vitali/.stack/snapshots/x86_64-linux/lts-8.3/8.0.2/bin:/home/vitali/.stack/programs/x86_64-linux/ghc-8.0.2/bin:/home/vitali/.local/bin:/usr/local/heroku/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/vitali/.rvm/bin","DESKTOP_SESSION":"cinnamon","rvm_loaded_flag":"1","LC_IDENTIFICATION":"ru_RU.UTF-8","GDM_XSERVER_LOCATION":"local","PWD":"/home/vitali","LANG":"en_US.UTF-8","MANDATORY_PATH":"/usr/share/gconf/cinnamon.mandatory.path","LC_MEASUREMENT":"ru_RU.UTF-8","_system_arch":"x86_64","_system_version":"18","MDM_XSERVER_LOCATION":"local","GDMSESSION":"cinnamon","rvm_version":"1.27.0 (latest)","SHLVL":"1","HOME":"/home/vitali","XDG_SEAT":"seat0","GNOME_DESKTOP_SESSION_ID":"this-is-deprecated","GTK_OVERLAY_SCROLLING":"1","XDG_SESSION_DESKTOP":"cinnamon","LOGNAME":"vitali","XDG_DATA_DIRS":"/usr/share/cinnamon:/usr/share/gnome:/usr/local/share/:/usr/share/:/usr/share/mdm/","DBUS_SESSION_BUS_ADDRESS":"unix:abstract=/tmp/dbus-pFFGHbdwbi,guid=3f322819a6999eaf1abbca7b58ab32e1","LESSOPEN":"| /usr/bin/lesspipe %s","MDMSESSION":"cinnamon","WINDOWPATH":"7","DISPLAY":":0","XDG_RUNTIME_DIR":"/run/user/1000","MDM_LANG":"en_US.UTF-8","XDG_CURRENT_DESKTOP":"X-Cinnamon","LESSCLOSE":"/usr/bin/lesspipe %s %s","rvm_user_install_flag":"1","_system_name":"Mint","LC_NAME":"ru_RU.UTF-8","XAUTHORITY":"/home/vitali/.Xauthority","_":"/usr/bin/env"},"encoding":"utf-8","maxBuffer":null}
-0.376s: "Running /home/vitali/.cabal/bin/ghc-mod lint,/media/veracrypt1/Haskell/real-w-haskell/src/Lib.hs,-- with opts = ",{"cwd":"/media/veracrypt1/Haskell/real-w-haskell","env":{"ATOM_HOME":"/home/vitali/.atom","NODE_PATH":"/usr/share/atom/resources/app.asar/exports","NODE_ENV":"production","LC_PAPER":"ru_RU.UTF-8","XDG_VTNR":"7","LC_ADDRESS":"ru_RU.UTF-8","XDG_SESSION_ID":"c1","SSH_AGENT_PID":"2089","rvm_bin_path":"/home/vitali/.rvm/bin","LC_MONETARY":"ru_RU.UTF-8","GIO_LAUNCHED_DESKTOP_FILE_PID":"20908","QT_STYLE_OVERRIDE":"gtk","GPG_AGENT_INFO":"/home/vitali/.gnupg/S.gpg-agent:0:1","DESKTOP_STARTUP_ID":"nemo-2273-vitali-notebook-/usr/share/atom/atom-155_TIME597380979","SHELL":"/bin/bash","XDG_SESSION_COOKIE":"2a5d5f96ef9147c0b35535562b32d0ff-1487614688.129437-1674860304","QT_LINUX_ACCESSIBILITY_ALWAYS_ON":"1","LC_NUMERIC":"ru_RU.UTF-8","GTK_MODULES":"gail:atk-bridge","rvm_stored_umask":"0022","USER":"vitali","LS_COLORS":"","QT_ACCESSIBILITY":"1","LC_TELEPHONE":"ru_RU.UTF-8","_system_type":"Linux","rvm_path":"/home/vitali/.rvm","INSIDE_NEMO_PYTHON":"","SSH_AUTH_SOCK":"/run/user/1000/keyring/ssh","SESSION_MANAGER":"local/vitali-notebook:@/tmp/.ICE-unix/2013,unix/vitali-notebook:/tmp/.ICE-unix/2013","USERNAME":"vitali","DEFAULTS_PATH":"/usr/share/gconf/cinnamon.default.path","GIO_LAUNCHED_DESKTOP_FILE":"/usr/share/applications/atom.desktop","XDG_CONFIG_DIRS":"/etc/xdg/xdg-cinnamon:/etc/xdg","rvm_prefix":"/home/vitali","GOOGLE_API_KEY":"AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q","PATH":"/media/veracrypt1/Haskell/real-w-haskell/.stack-work/install/x86_64-linux/lts-8.3/8.0.2/bin:/home/vitali/.stack/snapshots/x86_64-linux/lts-8.3/8.0.2/bin:/home/vitali/.stack/programs/x86_64-linux/ghc-8.0.2/bin:/home/vitali/.local/bin:/usr/local/heroku/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/vitali/.rvm/bin","DESKTOP_SESSION":"cinnamon","rvm_loaded_flag":"1","LC_IDENTIFICATION":"ru_RU.UTF-8","GDM_XSERVER_LOCATION":"local","PWD":"/home/vitali","LANG":"en_US.UTF-8","MANDATORY_PATH":"/usr/share/gconf/cinnamon.mandatory.path","LC_MEASUREMENT":"ru_RU.UTF-8","_system_arch":"x86_64","_system_version":"18","MDM_XSERVER_LOCATION":"local","GDMSESSION":"cinnamon","rvm_version":"1.27.0 (latest)","SHLVL":"1","HOME":"/home/vitali","XDG_SEAT":"seat0","GNOME_DESKTOP_SESSION_ID":"this-is-deprecated","GTK_OVERLAY_SCROLLING":"1","XDG_SESSION_DESKTOP":"cinnamon","LOGNAME":"vitali","XDG_DATA_DIRS":"/usr/share/cinnamon:/usr/share/gnome:/usr/local/share/:/usr/share/:/usr/share/mdm/","DBUS_SESSION_BUS_ADDRESS":"unix:abstract=/tmp/dbus-pFFGHbdwbi,guid=3f322819a6999eaf1abbca7b58ab32e1","LESSOPEN":"| /usr/bin/lesspipe %s","MDMSESSION":"cinnamon","WINDOWPATH":"7","DISPLAY":":0","XDG_RUNTIME_DIR":"/run/user/1000","MDM_LANG":"en_US.UTF-8","XDG_CURRENT_DESKTOP":"X-Cinnamon","LESSCLOSE":"/usr/bin/lesspipe %s %s","rvm_user_install_flag":"1","_system_name":"Mint","LC_NAME":"ru_RU.UTF-8","XAUTHORITY":"/home/vitali/.Xauthority","_":"/usr/bin/env"},"encoding":"utf-8","maxBuffer":null}
-0.014s: "Got response from /home/vitali/.cabal/bin/ghc-mod lint,/media/veracrypt1/Haskell/real-w-haskell/src/Lib.hs,--",{"stdout":"","stderr":""}
-0.005s: "ghc-mod: /home/vitali/.stack/snapshots/x86_64-linux/lts-8.2/8.0.2/pkgdb/package.cache: GHC.PackageDb.readPackageDb: inappropriate type (Not a valid Unicode code point!)\n"
-0.004s: "Running /home/vitali/.cabal/bin/ghc-mod check,/media/veracrypt1/Haskell/real-w-haskell/src/Lib.hs,-- failed with ",{"killed":false,"code":1,"signal":null,"cmd":"/home/vitali/.cabal/bin/ghc-mod check /media/veracrypt1/Haskell/real-w-haskell/src/Lib.hs --"}
0s: {"killed":false,"code":1,"signal":null,"cmd":"/home/vitali/.cabal/bin/ghc-mod check /media/veracrypt1/Haskell/real-w-haskell/src/Lib.hs --"}

Error
    at /packages/haskell-ghc-mod/lib/util.coffee:60:26
    at ChildProcess.exithandler (child_process.js:225:5)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:493:12)

Commands

     -2:35.1.0 application:open-folder (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
  2x -0:52.9.0 tree-view:remove (span.name.icon.icon-file-directory)
     -0:32.3.0 core:save (input.hidden-input)

Non-Core Packages

autocomplete-haskell 0.7.2 
haskell-ghc-mod 1.19.7 
ide-haskell 1.9.4 
ide-haskell-cabal 1.8.1 
ide-haskell-repl 0.5.2 
language-haskell 1.12.1 

@lierdakil
Copy link
Contributor

@VitaliZaharenko, long story short, run stack build ghc-mod inside the project. Cabal-install and stack don't mix well. There is some movement towards automating that on ghc-mod side, but it's painfully slow-going, I'm sorry to say. So for now you'll have to do that manually.

@VitaliZaharenko
Copy link

Yes, this works. Thanks!

@peacememories
Copy link

peacememories commented May 29, 2017

This also happens with ghc-mod and ghc-modi installed via stack install and using cabal newbuild.

The problem might be that the parent directory contains a stack project, and ghc-mod seems to search parent directories? I used cabal newbuild for a standalone project and didn't experience the same problems.

##edit

nevermind, apparently ghc-mod just always expect the current project to be a stack project.

@pheara
Copy link

pheara commented Jun 3, 2017

Had to remove my user-global version (the one in ~/.local/bin/ on Linux) and stack install ghc-mod again from the project directory. Apparently the LTS/GHC versions where mismatching.

@peacememories
Copy link

Apparently some of this is triggered because I had ghc-mod installed via nix and am now using it via stack. Somewhere in my configuration something points to the nix store, but I don't know where.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants