begriffs / haskell-vim-now

One-line Haskell Vim install
MIT License
989 stars 101 forks source link

Getting the following error on Mac. #283

Open arbitary opened 6 years ago

arbitary commented 6 years ago

Installing helper binaries... stack --resolver lts-10.3 install ghc-mod --install-ghc --verbosity warning Plan construction failed. "stack --resolver lts-10.3 install ghc-mod --install-ghc --verbosity warning" failed with error 1 setup_haskell.hs failed with error 1. Aborting...

tmspzz commented 6 years ago

Same...

$ bash /tmp/haskell-vim-now.sh
--> Existing Haskell-Vim-Now installation detected at /Users/blender/.config/haskell-vim-now.
--- Syncing Haskell-Vim-Now with upstream...
Would you like to force a sync? THIS WILL REMOVE ANY LOCAL CHANGES!  [y/N]: y
HEAD is now at 974e41f installer support --nix parameter to be able running stack in nix-shell (#285)
Already up to date.
Current branch master is up to date.
--- No new packages needed for install...
--- Checking ctags' exuberance...
--- Setting git to use fully-pathed vim for messages...
--- Testing for broken Ruby interface in vim...
--- Test passed. Ruby interface is OK.
--- Backing up current vim config using timestamp 20180222_120001...
    /Users/blender/.config/haskell-vim-now/backup/.vim.20180222_120001
    /Users/blender/.config/haskell-vim-now/backup/.vimrc.20180222_120001
--- Creating vim config symlinks
    ~/.vimrc -> /Users/blender/.config/haskell-vim-now/.vimrc
    ~/.vim   -> /Users/blender/.config/haskell-vim-now/.vim
--- Installing plugins using vim-plug...
HvnArgs {hvnArgsNoHoogleDb = False, hvnArgsNoHelperBinaries = False}
Setting up GHC if needed...
    Stack bin path: /Users/blender/.local/bin
    Stack global path: /Users/blender/.stack
    Stack global config location: /Users/blender/.stack/global-project/stack.yaml
    Stack resolver: lts-9.11
    /Users/blender/.config/haskell-vim-now/.stack-bin -> /Users/blender/.local/bin
Installing helper binaries...
    stack --resolver lts-9.11 install ghc-mod --install-ghc --verbosity warning
    stack --resolver lts-7.24 install cabal-install --install-ghc --verbosity warning
    stack --resolver lts-8.14 install hindent --install-ghc --verbosity warning
name:                dependencies
version:             0.1.0.0
synopsis:            helper binaries for vim
homepage:            https://github.com/begriffs/haskell-vim-now
license:             MIT
author:              Joe Nelson
maintainer:          cred+github@begriffs.com
category:            Development
build-type:          Simple
cabal-version:       >=1.10

library
-- hscope 0.4 does not compile with most resolvers so use newer
  build-depends:       base >=4.9 && <4.11
                     , hscope > 0.4
                     , apply-refact
                     , codex
                     , hasktags
                     , hlint
                     , hoogle
                     , pointfree
                     , pointful
  default-language:    Haskell2010
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- ./

Selected resolver: lts-7.24
*** Resolver lts-7.24 will need external packages:
    codex not found
        - dependencies requires -any
    hasktags not found
        - dependencies requires -any
    hscope not found
        - dependencies requires >0.4
    pointfree not found
        - dependencies requires -any

Using resolver: lts-7.24
Solver requires that cabal be on your PATH
Try running 'stack install cabal-install'

"stack init --solver --resolver lts-7.24 --install-ghc" failed with error 1
*** setup_haskell.hs failed with error 1.
*** Aborting...
leifmetcalf commented 6 years ago

Getting the same error for ghc-mod on a fresh install of Ubuntu 18.04

begriffs commented 6 years ago

Sorry, I'm no longer doing free maintenance on my projects, but if anyone is interested in sponsoring the work I can look into getting this fixed. Also I'm happy to merge a pull request if someone else figures it out.

jship commented 6 years ago

Looks like the error from @arbitary and the one from @blender are not quite the same.

In @arbitary's case, it failed to install ghc-mod. ghc-mod has been notoriously difficult to successfully install as changes are made to GHC as well as ghc-mod's dependencies. A change was put in recently that, if it is working correctly, will allow the installer to continue even if ghc-mod fails to install. @arbitary: I recommend trying a completely clean haskell-vim-now install.

@leifmetcalf: You hit this on a fresh install of your OS (i.e. there were no traces left of an old haskell-vim-now installation)?

In @blender's case, the failure was from cabal not being on the PATH. haskell-vim-now assumes it is on the PATH if this line succeeds:

https://github.com/begriffs/haskell-vim-now/blob/974e41f49b3e142c5afaf7cf0b74be192ee5633f/scripts/setup_haskell.hs#L136

@blender: Can you see if you have a cabal binary under the path reported by stack path --local-bin and also make sure that the path reported by stack path --local-bin is in your system PATH?

tmspzz commented 6 years ago

@jship thanks for looking into this. I now get the following message:

"stack init --solver --resolver lts-7.24 --install-ghc" failed with error 1
*** setup_haskell.hs failed with error 1.
*** Aborting...

So, let's check:

$ stack path --local-bin
/Users/blender/.local/bin
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:~/Library/Python/2.7/bin:~/.local/bin
$ ls ~/.local/bin
total 982872
-rw-r--r--@  1 blender  staff   6.0K Jan 23 19:32 .DS_Store
lrwxr-xr-x   1 blender  staff    25B Apr 23 09:34 bin -> /Users/blender/.local/bin
-rwxr-xr-x   1 blender  staff    48M Apr 23 09:34 cabal
-rwxr-xr-x   1 blender  staff    44M May  6  2017 codex
drwxr-xr-x  11 blender  staff   374B Jul 11  2017 data
-rwxr-xr-x   1 blender  staff   118M Apr 23 09:34 ghc-mod
-rwxr-xr-x   1 blender  staff   1.8M Apr 23 09:34 ghc-modi
-rwxr-xr-x   1 blender  staff   2.9M Oct 15  2016 hasktags
-rwxr-xr-x   1 blender  staff    30M Apr 23 09:34 hindent
-rwxr-xr-x   1 blender  staff    24M Jul 11  2017 hlint
-rwxr-xr-x   1 blender  staff    45M Oct 15  2016 hoogle
-rwxr-xr-x   1 blender  staff   1.7M Oct 15  2016 intero
-rwxr-xr-x   1 blender  staff    69M Oct 15  2016 refactor
-rwxr-xr-x   1 blender  staff   8.4M Jan 25 12:01 stylish-haskell

I suppose ~/.local/bin is not being expanded correctly?

EDIT: I replaced ~/.local/bin with /Users/blender/.local/bin and it's now going further

and...

--- <---- HASKELL VIM NOW installation successfully finished ---->

🎉