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

Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible... #139

Closed varosi closed 8 years ago

varosi commented 8 years ago

On Windows 10 x64 and Stackage LTS 5.2 (GHC 7.10.3), when select a type in my stack based project I get:

-0.017s: ghc-modi said: cabal: Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with -0.017s: ghc-modi said: Cabal. Use the flag --package-db to specify a package database (it can be used -0.017s: ghc-modi said: multiple times).

lierdakil commented 8 years ago

First, avoid running Atom with stack exec. It is a hack, and everything should work without, provided you have stack in PATH (and if you don't, you can add it) Second, try to stack build your project first.

varosi commented 8 years ago

Will it find correct ghc-mod? Because I have on path: GHC 7.10.2 and ghc-mod 5.5 built with GHC 7.10.2, but project is based on LTS 5.2 with uses GHC 7.10.3.

lierdakil commented 8 years ago

Atom should automatically pick up stack's bin-path. Make sure you have 'Stack Sandbox' enabled in haskell-ghc-mod settings (it should be enabled by default).

varosi commented 8 years ago

It doesn't work. There is no cabal sandbox and ghc-mod is built, i.e.: stack exec ghc-mod -- --version works from project's root, but in Atom it doesn't show types and there is exclamation yellow mark in the bottom left corner.

2016-05-10 19:34 GMT+03:00 Nikolay Yakimov notifications@github.com:

Atom should automatically pick up stack's bin-path. Make sure you have 'Stack Sandbox' enabled in haskell-ghc-mod settings (it should be enabled by default).

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/atom-haskell/haskell-ghc-mod/issues/139#issuecomment-218215311

varosi commented 8 years ago

It's continue to check for cabal sandbox. When I tried "Haskell IDE | ghc-mod | Check" from menu it gave me this error: ghc-modi said: ghc-mod: can't find a package database at D:\Projects\Test.cabal-sandbox\x86_64-windows-ghc-7.10.2-packages.conf.d

2016-05-11 0:09 GMT+03:00 eng. Vassil Ognyanov Keremidchiev < varosi@gmail.com>:

It doesn't work. There is no cabal sandbox and ghc-mod is built, i.e.: stack exec ghc-mod -- --version works from project's root, but in Atom it doesn't show types and there is exclamation yellow mark in the bottom left corner.

2016-05-10 19:34 GMT+03:00 Nikolay Yakimov notifications@github.com:

Atom should automatically pick up stack's bin-path. Make sure you have 'Stack Sandbox' enabled in haskell-ghc-mod settings (it should be enabled by default).

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/atom-haskell/haskell-ghc-mod/issues/139#issuecomment-218215311

lierdakil commented 8 years ago

Things to try: 1) Remove dist/ from project root. ghc-mod assumes you want cabal if you have that 2) Make absolutely sure that you have stack executable in PATH 3) Remove cabal.sandbox.config from project root. It can mess with ghc-mod if you're using stack.

If everything else fails, enable 'Debug' in haskell-ghc-mod, and copy-paste dev.console output here ('View → Developer → Toggle Developer Tools' menu item). Make sure you try to check/show type/show info before copying output.

varosi commented 8 years ago

Those three points are alright and after enabling Debug I got that on type selection:

haskell-ghc-mod debug: Started interactive action block in D:\Projects\Test util.coffee:25 haskell-ghc-mod debug: Running ghc-modi command type D:\Projects\Test\src\NLP\POS\AttoparsecTagger.hs -- 17 37 util.coffee:29 haskell-ghc-mod warning: ghc-modi said: EXCEPTION: types: util.coffee:29 haskell-ghc-mod warning: ghc-modi said: <command line>: cannot satisfy -package-id attoparsec-0.13.0.1-3f4d2273bdd0a68a23b53503bd791240: util.coffee:29 haskell-ghc-mod warning: ghc-modi said: attoparsec-0.13.0.1-3f4d2273bdd0a68a23b53503bd791240 is unusable due to missing or recursive dependencies: util.coffee:29 haskell-ghc-mod warning: ghc-modi said: array-0.5.1.0-1e6afdd1db5c2d707efe995169e8d18a base-4.8.2.0-14035a44a8b95c6832da6dae1420f59e bytestring-0.10.6.0-342400f3bb78fee60dde2cecf10f8e3b containers-0.5.6.2-53be8e60d046855702cba277d921b48c deepseq-1.4.1.1-2c33acf73357f514df72284dd4549b44 scientific-0.3.4.4-9bb43ca1b549637f2d4715b309995c3d text-1.2.2.1-a8790720b026d1fe28baa6e14c0f00e3 transformers-0.4.2.0-560c443a4c8f3854b85644b981ff03b6 util.coffee:25 haskell-ghc-mod debug: Got response from ghc-modi: OK

util.coffee:25 haskell-ghc-mod debug: Ended interactive action block in D:\Projects\Test upi.coffee:156 Error: No type(…) util.coffee:29 haskell-ghc-mod warning: ghc-modi said: (use -v for more information)

2016-05-11 1:04 GMT+03:00 Nikolay Yakimov notifications@github.com:

Things to try: 1) Remove dist/ from project root. ghc-mod assumes you want cabal if you have that 2) Make absolutely sure that you have stack executable in PATH 3) Remove cabal.sandbox.config from project root. It can mess with ghc-mod if you're using stack.

If everything else fails, enable 'Debug' in haskell-ghc-mod, and copy-paste dev.console output here ('View → Developer → Toggle Developer Tools' menu item). Make sure you try to check/show type/show info before copying output.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/atom-haskell/haskell-ghc-mod/issues/139#issuecomment-218305875

lierdakil commented 8 years ago

Please post full debug output. It's hard to determine the root of the problem just by looking at error itself.

lierdakil commented 8 years ago

Also, did you try manually running stack build?

varosi commented 8 years ago

From command-line everything is working fine, so:

stack build

Is building correctly the project. After then I open Atom and I get those errors in Development console.

2016-05-12 20:44 GMT+03:00 Nikolay Yakimov notifications@github.com:

Also, did you try manually running stack build?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/atom-haskell/haskell-ghc-mod/issues/139#issuecomment-218832160

varosi commented 8 years ago

This issue is fixed in 1.13.2