commercialhaskell / stack-ide

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

"Running" instructions has stack "invalid argument error" #17

Closed parsonsmatt closed 9 years ago

parsonsmatt commented 9 years ago

I installed stack-ide with the commands given in the README.md:

$ git clone git@github.com:fpco/ide-backend.git
$ git clone git@github.com:commercialhaskell/stack-ide.git
$ cd stack-ide
$ stack install \
    stack-ide \
    stack-ide-api \ 
    ../ide-backend/ide-backend \
    ../ide-backend/ide-backend-rts \
    ../ide-backend/ide-backend-server \
    ../ide-backend/ide-backend-common

Attempting to run stack ide gives the following error:

λ ~/Projects/stack-ide/stack-ide/ stack ide stack-ide
Invalid argument `ide'

Usage: stack [--version] [--help] [--docker*] ([--verbosity VERBOSITY] |
             [-v|--verbose]) ([--system-ghc] | [--no-system-ghc])
             ([--install-ghc] | [--no-install-ghc]) [--arch ARCH] [--os OS]
             [-j|--jobs JOBS] [--extra-include-dirs DIR] [--extra-lib-dirs DIR]
             ([--skip-ghc-check] | [--no-skip-ghc-check]) [--resolver RESOLVER]
             [--no-terminal] [--stack-yaml STACK-YAML] COMMAND

Running stack-ide appears to work just fine. This occurs after running stack upgrade --git, so I should be on the most recent stack. Is the intended usage stack-ide or stack ide?

snoyberg commented 9 years ago

I haven't used this myself, but I'm just guessing: should it be stack exec stack-ide?

parsonsmatt commented 9 years ago

That gives:

λ stack exec stack-ide
{"tag":"ResponseWelcome","contents":[0,1,0]}
stack-ide: user error (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).)

stack-ide all on it's own seems to be fine, though I haven't actually sent any requests yet:

λ stack-ide
{"tag":"ResponseWelcome","contents":[0,1,0]}
[blinking cursor]
drwebb commented 9 years ago

What is the output of your stack --version?

stack ide works fine with me

parsonsmatt commented 9 years ago
stack --version
Version 0.1.1.0, Git revision 2cac22d2a26dab6faa00c6f03edf5798affb7840

That actually isn't the most recent commit! I'll do another upgrade and report back

parsonsmatt commented 9 years ago

Doh! /usr/bin/stack was located before ~/.local/bin/stack. Uninstalling stack using apt-get and using the locally installed version works just fine. Thanks for the help!