commercialhaskell / stack-ide

Stack-based JSON interface to ide-backend
98 stars 23 forks source link

Stack ide doesn't work with stack on lts-3.0 #49

Closed rvion closed 9 years ago

rvion commented 9 years ago

Stack ide doesn't seem work with stack on lts-3.0

All details here https://github.com/lukexi/stack-ide-sublime/issues/9 (I previously thought it was on sublime-stack-ide side)

Repro

  1. pulled master of stack, stack-ide, and stack-ide-sublime
  2. reinstalled stack and stack-ide, after setting: resolver: lts-3.0 in all stack.yaml files
  3. generated brand new test project: stack new supernova && cd supernova && stack build && stack ide start supernova

and got that

➜  supernova  stack ide start supernova
supernova-0.1.0.0: configure (test)
Configuring supernova-0.1.0.0...
supernova-0.1.0.0: build (test)
Preprocessing library supernova-0.1.0.0...
[1 of 1] Compiling Lib              ( src/Lib.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Lib.o )
In-place registering supernova-0.1.0.0...
Preprocessing test suite 'supernova-test' for supernova-0.1.0.0...
[1 of 1] Compiling Main             ( test/Spec.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/supernova-test/supernova-test-tmp/Main.o )
Linking .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/supernova-test/supernova-test ...
supernova-0.1.0.0: Test running disabled by --no-run-tests flag.
{"tag":"ResponseWelcome","contents":[0,1,1]}
{"tag":"ResponseLog","contents":"[Info] Initializing ide-backend session @(ideba_HqZKAqZV4wa5sqhSD7XjZv:IdeSession.Update ./IdeSession/Update.hs:195:3)\n"}
{"tag":"ResponseLog","contents":"[Debug] Session dir = /Users/RemiVion/dev/supernova/supernova/session.78526 @(ideba_HqZKAqZV4wa5sqhSD7XjZv:IdeSession.Update ./IdeSession/Update.hs:208:3)\n"}
{"tag":"ResponseLog","contents":"[Debug] Dist dir = /Users/RemiVion/dev/supernova/supernova/.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/ @(ideba_HqZKAqZV4wa5sqhSD7XjZv:IdeSession.Update ./IdeSession/Update.hs:210:3)\n"}
{"tag":"ResponseLog","contents":"[Debug] Local working dir = /Users/RemiVion/dev/supernova/supernova/ @(ideba_HqZKAqZV4wa5sqhSD7XjZv:IdeSession.Update ./IdeSession/Update.hs:217:17)\n"}
{"tag":"ResponseLog","contents":"[Info] Searching for ide-backend-server on this path: /Users/RemiVion/dev/supernova/supernova/.stack-work/install/x86_64-osx/lts-3.0/7.10.2/bin/:/Users/RemiVion/.stack/snapshots/x86_64-osx/lts-3.0/7.10.2/bin/:/Users/RemiVion/.local/bin:/Users/RemiVion/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin @(ideba_HqZKAqZV4wa5sqhSD7XjZv:IdeSession.RPC.Client ./IdeSession/RPC/Client.hs:341:5)\n"}
{"tag":"ResponseLog","contents":"[Info] Found ide-backend-server - using this one: /Users/RemiVion/.local/bin/ide-backend-server @(ideba_HqZKAqZV4wa5sqhSD7XjZv:IdeSession.RPC.Client ./IdeSession/RPC/Client.hs:343:5)\n"}
{"tag":"ResponseLog","contents":"[Debug] Recompile required, starting... @(ideba_HqZKAqZV4wa5sqhSD7XjZv:IdeSession.Update.ExecuteSessionUpdate ./IdeSession/Update/ExecuteSessionUpdate.hs:223:5)\n"}
{"tag":"ResponseLog","contents":"[Info] Restarting session due to update requiring it. @(ideba_HqZKAqZV4wa5sqhSD7XjZv:IdeSession.Update ./IdeSession/Update.hs:422:11)\n"}
{"tag":"ResponseUpdateSession","contents":{"tag":"UpdateStatusRequiredRestart","contents":[]}}
{"tag":"ResponseLog","contents":"[Info] Restarting ide-backend-server @(ideba_HqZKAqZV4wa5sqhSD7XjZv:IdeSession.Update ./IdeSession/Update.hs:351:3)\n"}
{"tag":"ResponseLog","contents":"[Info] Searching for ide-backend-server on this path: /Users/RemiVion/dev/supernova/supernova/.stack-work/install/x86_64-osx/lts-3.0/7.10.2/bin/:/Users/RemiVion/.stack/snapshots/x86_64-osx/lts-3.0/7.10.2/bin/:/Users/RemiVion/.local/bin:/Users/RemiVion/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin @(ideba_HqZKAqZV4wa5sqhSD7XjZv:IdeSession.RPC.Client ./IdeSession/RPC/Client.hs:341:5)\n"}
{"tag":"ResponseLog","contents":"[Info] Found ide-backend-server - using this one: /Users/RemiVion/.local/bin/ide-backend-server @(ideba_HqZKAqZV4wa5sqhSD7XjZv:IdeSession.RPC.Client ./IdeSession/RPC/Client.hs:343:5)\n"}
{"tag":"ResponseLog","contents":"[Debug] Recompile required, starting... @(ideba_HqZKAqZV4wa5sqhSD7XjZv:IdeSession.Update.ExecuteSessionUpdate ./IdeSession/Update/ExecuteSessionUpdate.hs:223:5)\n"}
{"tag":"ResponseUpdateSession","contents":{"tag":"UpdateStatusDone","contents":[]}}  

{"tag":"RequestGetSourceErrors","contents":[]}
{"tag":"ResponseGetSourceErrors","contents":[{"errorSpan":{"tag":"TextSpan","contents":"<from GhcException>"},"errorKind":"KindError","errorMsg":"ide-backend-server: cannot compile this file to desired target: /Users/RemiVion/dev/supernova/supernova/supernova.cabal\nUsage: For basic information, try the `--help' option."}]}

:warning: as @lukexi pointed out:

errors sometimes don't appear til you nudge stack-ide with a query like {"tag":"RequestGetSourceErrors","contents":[]} which you can just paste on the command line

Indeed, to see the error, you have to paste {"tag":"RequestGetSourceErrors","contents":[]} into the shell

bixuanzju commented 9 years ago

Same problem here. I thought #48 fixed that, but appeared not the case in my machine.

chrisdone commented 9 years ago

Fixed this in https://github.com/commercialhaskell/stack/commit/6ac73da09cb43f3bf87a965968e547668f83beca.

Although I have now discovered a more ominous problem of the cabal_macros.h file somehow appearing in the module files leading to the same kind of result.

bixuanzju commented 9 years ago

@chrisdone Thanks, it works now for me :+1:

chrisdone commented 9 years ago

Yay, fixed the other issue too in https://github.com/commercialhaskell/stack/commit/1f0d45577aa314eae2ad3208dcfefcd26a599905.

rvion commented 9 years ago

confirmed ! Perfect :+1: