Closed elldritch closed 8 years ago
You could play with additionalPathDirectories
setting, which prepends those to PATH before running ghc-mod. That said, Stack support in ghc-mod is limited at best, see https://github.com/kazu-yamamoto/ghc-mod/issues/498
That totally a bug in ghc-mod. Honestly I forgot we were using the executables in cabal-helper ;)
That issue was fixed. And ghc-mod works with stack now, but I haven't got it working in Atom yet… Note that newer update to ghc-mod is available, but this Atom package still says "Supported ghc-mod versions are from 4.1.0 to 5.2.1.2." — is that enforced or just outdated docs?
That's not enforced, but 5.3.0.0 isn't supported officially (although it works most of the time, it sometimes doesn't, and I can't do much about that here). If there was another release, I've missed it, and will update docs accordingly after testing. 7 сент. 2015 г. 11:29 пользователь "Aaron Wolf" notifications@github.com написал:
That issue was fixed. And ghc-mod works with stack now, but I haven't got it working in Atom yet… Note that newer update to ghc-mod is available, but this Atom package still says "Supported ghc-mod versions are from 4.1.0 to 5.2.1.2." — is that enforced or just outdated docs?
— Reply to this email directly or view it on GitHub https://github.com/atom-haskell/haskell-ghc-mod/issues/44#issuecomment-138232928 .
The latest git version of ghc-mod is required for supporting Stack right now. The next full hackage release will include those fixes. So, for this to fully work, we will need both that update to ghc-mod and for this to work with it.
I tested with the latest git ghc-mod and running Atom did make ghc-mod do a lot of CPU work, but I didn't successfully get any useful results in Atom.
Look, current development branch is obviously not supported officially, since I have no control over ghc-mod repo. To be frank, I don't have time to hotfix all compatibility issues before actual release, it's that simple. When it does release, I will rush to get it working. Until release, everything in ghc-mod is subject to sudden change. If you're desperate, PRs are always welcome. Sorry, but I just can't help here.
2015-09-07 20:31 GMT+03:00 Aaron Wolf notifications@github.com:
The latest git version of ghc-mod is required for supporting Stack right now. The next full hackage release will include those fixes. So, for this to fully work, we will need both that update to ghc-mod and for this to work with it.
I tested with the latest git ghc-mod and running Atom did make ghc-mod do a lot of CPU work, but I didn't successfully get any useful results in Atom.
— Reply to this email directly or view it on GitHub https://github.com/atom-haskell/haskell-ghc-mod/issues/44#issuecomment-138346345 .
I wasn't asking you to do anything right now, I was clarifying for the ticket's reference sake what the status is. And I did want to know for reference whether there was a coded block about versions versus just being in the docs. Thanks
@lierdakil the next release is probably going out soon so you should catch up before that happens ;)
Okay, I've tested current HEAD at the moment (ce1d9d1), and it works with Atom pretty much like it should. Didn't try with stack though. @wolftune, could you check if it works with cabal projects for you? If not, could you enable 'Debug' option in haskell-ghc-mod settings and post dev. console output?
holy moly, it worked! @DanielG as soon as this ghc-mod update is released to hackage, I think it will work to even try installing with Stack, and this should generally then be all set, this ticket will be done!
I must say, as much as this works, it's pretty slow and resource-intense, but maybe pretty usable on a more powerful computer.
@wolftune make sure you're using this (https://github.com/kazu-yamamoto/ghc-mod/commit/64379a7c56f4e1d6efa44439ec9be8e644b43faa) commit it fixes reloads being super slow.
@DanielG I did have that already, and yes, I would not describe it as "super slow" just as "quite slow". It's like laggy and such. I wish I had some better indication of the process and wish it was really quite fast, but it's definitely better than "super slow".
Type/info queries are expected to be slowish the first time around, but if you're using ghc-modi backend, then subsequent queries should be relatively fast. On really big projects it can still take a second or two though, according to my experience.
Check and lint are not meant to be fast (I.e. I use non-interactive interface for those, as it's more robust, although can be considerably slower), so those can take a little while.
Not sure if I can do much about it on my end. 11 сент. 2015 г. 11:52 пользователь "Aaron Wolf" notifications@github.com написал:
@DanielG https://github.com/DanielG I did have that already, and yes, I would not describe it as "super slow" just as "quite slow". It's like laggy and such. I wish I had some better indication of the process and wish it was really quite fast, but it's definitely better than "super slow".
— Reply to this email directly or view it on GitHub https://github.com/atom-haskell/haskell-ghc-mod/issues/44#issuecomment-139491253 .
@lierdakil I tested it too and as you said Type/Info queries on non stack projects worked like you described(like 1-2 seconds), but I agree with @wolftune 's description of the stack projects problem, it is definitely "quite slow" as in 10 seconds now, as compared to 30 seconds "super slow" - before https://github.com/kazu-yamamoto/ghc-mod/commit/64379a7c56f4e1d6efa44439ec9be8e644b43faa landed.
How can I use haskell-ghc-mod
in stack-based project? I haven't cabal-install
, and in this case ghc-mod
must have parameter --with-stack
with path to stack. Without that parameter I got an error:
ghc-mod: cabal: readCreateProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
So in Settings of haskell-ghc-mod
package should be the input for specify of path to stack.
@denisshevchenko
stack install ghc-mod
which ghc-mod
and copy that path and put it in haskell-ghc-mod settings as the path for ghc-mod and ghc-modi (add the i for the latter of course)That's it.
Sorry, it doesn't work. I have this version ghc-mod
:
$ ghc-mod --version
ghc-mod version 5.4.0.0 compiled by GHC 7.10.2
And I've added full path to ghc-mod
and ghc-modi
in Packages -> Haskell Ghc Mod -> Ghc Mod Path
and Packages -> Haskell Ghc Mod -> Ghc Modi Path
. But after that I got this error again:
ghc-mod: cabal: readCreateProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
As I understand, ghc-mod
cannot work with Stack without --with-stack
parameter. But I can't find this parameter in haskell-ghc-mod
package...
And yes, I know about this caveat:
there is one caveat though if `dist/setup-config` exists in a Cabal-project directory ghc-mod will continue
using cabal-install instead of Stack so if you want to use Stack instead simply remove that file or the whole directory. You also need at least Stack version 0.1.4.0 for this to work."
I haven't dist
directory in my project, and this is my stack
version:
$ stack --version
Version 0.1.4.1
So?
Ok, It works now. Thanks.
Looks like this can be closed
@denisshevchenko Would you mind sharing how you got it to work?
When in a non-global project I get the same error you had:
ghc-mod: cabal: readCreateProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
In Atom in the global project, it works. Also, it works from command line in all projects.
I also get the same error. Would love to know how you got it working.
@WillSewell @hamsterdam delete "dist/" directory from the root of your project
@ruslantalpa I did that, but every time I used ghc-mod check from within atom, it would be recreated. I solved the issue by using the version of ghc in the global stack directory on my system.
I get the same Atom error after following all advice above. ghc-mod check works fine from command line for both Stack/non-Stack located .hs files and also works inside Atom for non-Stack located .hs files. But trying to check (cmd-s) a Stack located .hs file in Atom gives me the above error.
$ which ghc-mod = /home/eric/.local/bin/ghc-mod (set to same in Haskell-ghc-mod) $ which ghc = /home/eric/.stack/programs/i386-linux/ghc-7.10.2/bin/ghc extra-deps: [ghc-mod-5.4.0.0] in project stack.yaml no dist folder in project root directory (but .stack-work/dist exists)
Stumped. How do I ghc-mod check files interactively within Atom and within a Stack project.
Thanks.
I'm creating a project using Stack that uses a different GHC version from
$(which ghc)
. This causesbecause my local GHC doesn't support
base >=4.7 && <5
but the one I'mstack build
ing with does. Is there a way to configurehaskell-ghc-mod
to recognise and use GHCs onstack path
when possible?