Closed tomkludy closed 8 years ago
I was able to resolve this issue by upgrading my stack projects to resolver: lts-5.2, then stack clean, stack build, and atom seems to be working perfectly now!
Usually I encounter this error whenever I'm working on a project that has an incomplete .cabal file, so if anybody else is troubled by this error, where atom can't resolve dependencies you know are installed, make sure your .cabal file lists them as build deps, or rename the cabal file with a different extension while you're working
I'm still seeing this when firing up cabal with stack lts-5.4 on just a simple file set up to be in Haskell mode
@ford-prefect, try running stack build
in your project directory. Then try running ghc-mod check path-to-main.hs
. See if it works at all. At least we'll know if it's ghc-mod or this package.
+1 ghc-mod check Main.hs works fine
If ghc-mod check Main.hs works fine, then don't run Atom with stack exec atom
.
Edit: You can safely ignore this comment, this is a known bug in ghc-mod: https://github.com/DanielG/ghc-mod/issues/688
For me this issue came up when
hs-source-dirs
set to .
, such as https://github.com/sgraf812/cloben'Normal' project setups work as intended. I don't think this is an issue with haskell-ghc-mod
, but rather ghc-mod
itself.
Output of stack exec -- ghc-mod check cloben.hs
:
cabal: Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with
Cabal. Use the flag --package-db to specify a package database (it can be used
multiple times).
ghc-mod: readCreateProcess: cabal "configure" "--with-ghc=ghc" "--flags" "" (exit 1): failed
Output of ghc-mod check cloben.hs
(I've no global ghc installed):
cabal: Cannot find the program 'ghc'. User-specified path 'ghc' does not refer
to an executable and the program is not on the system path.
ghc-mod: readCreateProcess: cabal "configure" "--with-ghc=ghc" "--flags" "" (exit 1): failed
Running the same on regular project setups (e.g. source files under src/
) works like a charm.
The error in atom links to: https://github.com/atom-haskell/haskell-ghc-mod/issues/96
However, that issue is Closed and the resolution does not work for me. I do not have any 'Additional Path Directories' specified. I do use stack exclusively - no Haskell installed outside of stack - and I start atom with "stack exec atom". I get this error every time I open or save a file. I get the same error on both my desktop and my laptop, both OSX.
Full error report:
[Enter steps to reproduce below:]
Atom Version: 1.4.3 System: Mac OS X 10.11.3 Thrown From: haskell-ghc-mod package, v1.6.6
Stack Trace
Haskell-ghc-mod: ghc-mod interactive command info failed with error ghc-modi crashed
Commands
Config
Installed Packages