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

Haskell-ghc-mod: ghc-mod command browse failed with error Error #161

Closed uXs closed 8 years ago

uXs commented 8 years ago

[Enter steps to reproduce below:]

I tried to install Atom & Ide-Haskell according to the instructions at https://atom.io/packages/ide-haskell. Now whenever I start Atom I get this error.

(Note: I removed most path and environment info because it seemed to contain private data.)

Atom Version: 1.8.0 System: Microsoft Windows 10 Home Thrown From: haskell-ghc-mod package, v1.14.6

Stack Trace

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

At caps: undefined
URI: undefined
Args: -d,-p,--,Lib
message: Command failed: ghc-mod browse -d -p -- Lib
Invalid option `-p'

Usage: ghc-mod browse [-o|--operators] [-d|--detailed] [-q|--qualified] MODULE
  List symbols in a module

log:
-0.317s: "Main created"
-0.317s: "Main updating"
-0.317s: "getProcessOptions(C:\\Users\\uXs\\TestProject)"
-0.316s: "Looking for cabal sandbox..."
-0.315s: "Looking for stack sandbox..."
-0.315s: "Running stack with PATH [snip]
-0.314s: "Running stack path,--snapshot-install-root,--local-install-root with opts = ",{"encoding":"utf-8","stdio":"pipe","cwd":"C:\\Users\\uXs\\TestProject","env":[snip]
-0.311s: "Main buffer is set"
-0.31s: "Lib created"
-0.31s: "Lib updating"
-0.31s: "Prelude created"
-0.31s: "Prelude updating"
-0.31s: "Lib moduleName mismatch: Main != Lib"
-0.31s: "Prelude moduleName mismatch: Main != Prelude"
-0.265s: "Reading cabal sandbox config failed with ",{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\uXs\\TestProject\\cabal.sandbox.config"}
-0.265s: "No cabal sandbox found"
-0.069s: "Got response from stack path,--snapshot-install-root,--local-install-root",{"stdout":"snapshot-install-root: C:\\Users\\uXs\\AppData\\Roaming\\stack\\snapshots\\09b8ef97\r\nlocal-install-root: C:\\Users\\uXs\\TestProject\\.stack-work\\install\\9a7902b4\r\n","stderr":""}
-0.069s: "Found stack sandbox ","C:\\Users\\uXs\\TestProject\\.stack-work\\install\\9a7902b4\\bin","C:\\Users\\uXs\\AppData\\Roaming\\stack\\snapshots\\09b8ef97\\bin"
-0.069s: "PATH = C:\\Users\\uXs\\TestProject\\.stack-work\\install\\9a7902b4\\bin;C:\\Users\\uXs\\AppData\\Roaming\\stack\\snapshots\\09b8ef97\\bin;[snip]"
-0.068s: "Running ghc-mod version with opts = ",{"timeout":5000,"cwd":"C:\\Users\\uXs\\TestProject","env":[snip]
-0.05s: "Got response from ghc-mod version",{"stdout":"ghc-mod version 5.5.0.0 compiled by GHC 7.10.3\r\n","stderr":""}
-0.05s: "Ghc-mod 5,5,0,0 built with 7.10.3"
-0.05s: "{\"version\":[5,5,0,0],\"fileMap\":true,\"quoteArgs\":true,\"optparse\":true,\"typeConstraints\":true,\"browseParents\":true,\"interactiveCaseSplit\":true}"
-0.05s: "Running stack ghc,--,--version with opts = ",{"timeout":5000,"cwd":"C:\\Users\\uXs\\TestProject","env":[snip]
-0.047s: "Running ghc --version with opts = ",{"timeout":5000,"cwd":"C:\\Users\\uXs\\TestProject","env":[snip]
-0.043s: "Running ghc --version failed with ",{"code":"ENOENT","errno":"ENOENT","syscall":"spawn ghc","path":"ghc","spawnargs":["--version"],"cmd":"ghc --version"}
-0.027s: {"code":"ENOENT","errno":"ENOENT","syscall":"spawn ghc","path":"ghc","spawnargs":["--version"],"cmd":"ghc --version"}
-0.021s: "Running ghc-mod browse,-d,-p,--,Lib with opts = ",{"cwd":"C:\\Users\\uXs\\TestProject","env":[snip]
-0.019s: "Running ghc-mod browse,-d,-p,--,Main with opts = ",{"cwd":"C:\\Users\\uXs\\TestProject","env":[snip]
-0.001s: "Invalid option `-p'\r\n\r\nUsage: ghc-mod browse [-o|--operators] [-d|--detailed] [-q|--qualified] MODULE\r\n  List symbols in a module\r\n"
-0.001s: "Running ghc-mod browse,-d,-p,--,Lib failed with ",{"killed":false,"code":1,"signal":null,"cmd":"ghc-mod browse -d -p -- Lib"}
0s: "Error: Command failed: ghc-mod browse -d -p -- Lib\nInvalid option `-p'\r\n\r\nUsage: ghc-mod browse [-o|--operators] [-d|--detailed] [-q|--qualified] MODULE\r\n  List symbols in a module\r\n"

Error
    at file:///C:/Users/uXs/.atom/packages/haskell-ghc-mod/lib/util.coffee:60:26
    at ChildProcess.exithandler (child_process.js:232:5)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:818:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

Commands

Config

{
  "core": {},
  "haskell-ghc-mod": {
    "experimental": true,
    "highlightTooltips": false
  }
}

Installed Packages

# User
autocomplete-haskell, v0.6.5
haskell-ghc-mod, v1.14.6
ide-haskell, v1.6.5
ide-haskell-cabal, v1.4.1
language-haskell, v1.7.17

# Dev
No dev packages

Any ideas?

lierdakil commented 8 years ago

Disable experimental option in hgm config. You need to build ghc-mod from 5.6 branch in github repo for that to work.

uXs commented 8 years ago

That works, thanks!

galderz commented 7 years ago

I'm having same issue but with experimental disabled, any ideas?

lierdakil commented 7 years ago

@galderz, please create a new issue and include traces. I'm suspecting it's a different issue with similar symptoms.

To copy formatted traces to clipboard: atom-report

then just paste those here.