Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

LSP fails with VSCode (installed from marketplace) #315

Closed
xldenis opened this issue Sep 2, 2017 · 6 comments
Closed

LSP fails with VSCode (installed from marketplace) #315

xldenis opened this issue Sep 2, 2017 · 6 comments

Comments

@xldenis
Copy link

xldenis commented Sep 2, 2017

Hey!

I just tried installing the extension from the marketplace (I saw the issue for that was recently closed). However whenever I open it up I get this error

[1 of 5] Compiling CabalHelper.Common ( CabalHelper/Common.hs, /Users/xavier/.ghc-mod/cabal-helper/CabalHelper/Common.o )
[2 of 5] Compiling CabalHelper.Licenses ( CabalHelper/Licenses.hs, /Users/xavier/.ghc-mod/cabal-helper/CabalHelper/Licenses.o )

CabalHelper/Licenses.hs:56:8: error:
    • Expecting one more argument to ‘CPackageIndex ModuleName’
      Expected a type, but ‘CPackageIndex ModuleName’ has kind ‘* -> *’
    • In the type signature:
        findTransitiveDependencies :: CPackageIndex ModuleName
                                      -> Set CInstalledPackageId -> Set CInstalledPackageId
   |
56 |     :: CPackageIndex Distribution.ModuleName.ModuleName
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

/Users/xavier/.stack/snapshots/x86_64-osx/nightly-2017-06-16/8.0.2/libexec/x86_64-osx-ghc-8.0.2/cabal-helper-0.7.3.0/cabal-helper-wrapper "--with-ghc=/Users/xavier/.stack/programs/x86_64-osx/ghc-8.2.1/bin/ghc" "--with-ghc-pkg=/Users/xavier/.stack/programs/x86_64-osx/ghc-8.2.1/bin/ghc-pkg" "--with-cabal=cabal" "/Users/xavier/Code/xldenis/misc" "/Users/xavier/Code/xldenis/misc/.stack-work/dist/x86_64-osx/Cabal-2.0.0.2" "package-db-stack" "entrypoints" "source-dirs" "ghc-options" "ghc-src-options" "ghc-pkg-options" "ghc-merged-pkg-options" "ghc-lang-options" "licenses" "flags" "config-flags" "non-default-config-flags" "compiler-version"

It's not clear why it's building cabal-helper nor why it's failing? I was able to run stack install cabal-helper without any issues so idk what it's doing there?

@DanielG
Copy link
Collaborator

DanielG commented Sep 4, 2017

See DanielG/ghc-mod#905

@Tehnix
Copy link
Collaborator

Tehnix commented Sep 5, 2017

So you don't have to dig around that much in the issue, which also links another issue, I'll repost how I got it fixed (although please note that I have no idea if this will affect other parts of your system, use at your own risk!):

To sum up how I fixed it (although still remains how it got there), I went to ~/.stack/programs/x86_64-osx/ghc-8.0.2/lib/ghc-8.0.2/package.conf.d where there was a Cabal-2.0.0.2-1HTE9d8rwAi7gJIdEHeKh7.conf present, along with Cabal-1.24.2.0.conf. I deleted Cabal-2.0.0.2-1HTE9d8rwAi7gJIdEHeKh7.conf and now ghc-mod works.

So:

  • $ rm ~/.stack/programs/x86_64-osx/ghc-8.0.2/lib/ghc-8.0.2/package.conf.d/Cabal-2.0.0.2*

@Tehnix
Copy link
Collaborator

Tehnix commented Nov 9, 2017

@xldenis were you able to check if the above works for you?

@xldenis
Copy link
Author

xldenis commented Nov 9, 2017

It doesn't sorry, I don't have that issue. Mainly because I am using cabal 2.0 and ghc 8.2.1. I believe I need to wait for the new version of cabal-helper to be released.

@xldenis
Copy link
Author

xldenis commented Nov 18, 2017

From what I understand this means that HIE is not compatible with GHC 8.2.1? At the very least, it's not compatible with any stackage release that includes 8.2.1 and therefore Cabal-2.0

@xldenis
Copy link
Author

xldenis commented Nov 18, 2017

Updating to latest master seems to have fixed this issue! 😄

I have new issues but I'll open up threads for those separately.

@xldenis xldenis closed this as completed Nov 18, 2017
@alanz alanz added this to the prehistory milestone Feb 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants