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

ghc-mod not detecting user libraries in stack implicit global environment #850

Open
SirensOfTitan opened this issue Nov 21, 2016 · 6 comments

Comments

@SirensOfTitan
Copy link

i.e.

stack exec -- ghc-mod check {someFile}

detects globally installed libraries like Test.QuickCheck.Checkers, but

ghc-mod check {someFile}

... does not.

I have no hidden cabal directories between where I'm running things and my home directory. I'm trying to use ghc-mod with the ide-haskell atom package with poor results because of this.

Am I missing something and am just stupid, or should ghc-mod work with implicit global without the stack prefixing?

@SirensOfTitan
Copy link
Author

Additional information:
ghc-mod debug

ghc-mod: ghc: readCreateProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

ghc-mod --version

ghc-mod version 5.6.0.0 compiled by GHC 8.0.1

stack ghc -- --version

Run from outside a project, using implicit global project config
Using resolver: lts-7.9 from implicit global project's config file: /Users/colep/.stack/global-project/stack.yaml
The Glorious Glasgow Haskell Compilation System, version 8.0.1

stack exec ghc-mod debug

Run from outside a project, using implicit global project config
Using resolver: lts-7.9 from implicit global project's config file: /Users/colep/.stack/global-project/stack.yaml
Version:              ghc-mod-5.6.0.0
Library GHC Version:  8.0.1
System GHC Version:   8.0.1
Root directory:       /Users/colep
Current directory:    /Users/colep
GHC Package flags:
    -i/Users/colep -i/Users/colep -global-package-db -user-package-db
    -Wall
GHC System libraries: /Users/colep/.stack/programs/x86_64-osx/ghc-8.0.1/lib/ghc-8.0.1

@DanielG
Copy link
Owner

DanielG commented Nov 21, 2016

I thought you can make ide-haskell always run ghc-mod via stack exec, what's the problem if that's working?

@lierdakil would know better.

@lierdakil
Copy link
Collaborator

lierdakil commented Nov 22, 2016

I try to avoid running ghc-mod via stack exec for various reasons. Long story short, overall it creates more problems than it solves (primarily related to cabal/stack mixing).

That said, ide-haskell doesn't work all that well without a cabalfile, i.e. without a well-defined project, anyway.

The most straightforward band-aid at this point would be to just run Atom via stack exec atom or something similar.

@DanielG
Copy link
Owner

DanielG commented Nov 22, 2016

Have you tried the stack exec ghc-mod route recently, i.e. since 5.6 since I made the stack detection a whole lot more robust if you haven't seen it: 2f31cf4

@lierdakil
Copy link
Collaborator

lierdakil commented Nov 22, 2016

Yeah, I've seen it, but apparently forgot about that. Problem is, stack exec ghc-mod will always use stack. Which means I have to decide if it's a stack project before invoking ghc-mod. Which I will probably just make user choose, eventually. But until then I'm relying on ghc-mod's autodetection.

@lierdakil
Copy link
Collaborator

Also, I do have to support ghc-mod-5.5, since 5.6 isn't in stack's lts-6.* (ghc 7.10 branch), and ghc 8.0 has some problems.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants