atom-haskell-archive / haskell-ghc-mod

haskell-ghc-mod atom package
https://atom.io/packages/haskell-ghc-mod
MIT License
69 stars 20 forks source link

ghc-mod failed to launch #221

Closed Emanon42 closed 6 years ago

Emanon42 commented 6 years ago

There is a similar issue, #218 also reported this error but it happened on OS X. The solution of #218 is run stack build ghc-mod but I never use stack. What should I do for this error?

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.19.6 x64 Electron: 1.6.9 OS: Ubuntu 16.04.3 Thrown From: haskell-ghc-mod package 2.1.0

Stack Trace

Haskell-ghc-mod: ghc-mod failed to launch. It is probably missing or misconfigured. ENOENT

At Error was: Error
spawn ~/.cabal/bin/ghc-mod ENOENT
Debug information:
{
  "dir": "/home/yueyang/haskell",
  "err": {
    "code": "ENOENT",
    "errno": "ENOENT",
    "syscall": "spawn ~/.cabal/bin/ghc-mod",
    "path": "~/.cabal/bin/ghc-mod",
    "spawnargs": [
      "version"
    ],
    "cmd": "~/.cabal/bin/ghc-mod version"
  },
  "opts": {
    "cwd": "/home/yueyang/haskell",
    "env": {
      "PATH": "/home/yueyang/bin:/home/yueyang/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
    },
    "encoding": "utf8",
    "maxBuffer": null
  }
}
Environment (filtered):
{
  "PATH": "/home/yueyang/bin:/home/yueyang/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
}

Error
    at CP.execFile (/packages/haskell-ghc-mod/lib/util.js:79:36)
    at exithandler (child_process.js:230:5)
    at ChildProcess.errorhandler (child_process.js:242:5)
    at emitOne (events.js:96:13)
    at ChildProcess.emit (events.js:188:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:213:12)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Commands

Non-Core Packages

autocomplete-haskell 1.0.1 
haskell-ghc-mod 2.1.0 
ide-haskell 2.0.5 
ide-haskell-cabal 2.0.2 
ide-haskell-repl 0.7.1 
language-haskell 1.14.1 
lierdakil commented 6 years ago

Install ghc-mod: https://atom-haskell.github.io/installation/installing-binary-dependencies/#with-cabal

Emanon42 commented 6 years ago

OK, issue is solved by simply add $HOME/username/.cabal/bin/ghc-mod to Ghc Mod Path.

lierdakil commented 6 years ago

Right. Sorry, I misread the error report there. Anyway, glad to see you solved that.

J4stMart commented 6 years ago

@Emanon42 What do you mean with "simply add $HOME/username/.cabal/bin/ghc-mod to Ghc Mod Path." I don't see how i would 'simply' do that. Can you tell me how to, I'm a bit of a noob with ghc

Emanon42 commented 6 years ago

@J4stMart in the setting of this plugin in atom, add this path to the box which asks the path of ghc-mod

lierdakil commented 6 years ago

FWIW, we have a documentation site, which, among other things, discusses best practices for bringing ghc-mod into Atom's search scope.