atom-haskell-archive / haskell-ghc-mod

haskell-ghc-mod atom package
https://atom.io/packages/haskell-ghc-mod
MIT License
69 stars 20 forks source link

ghc-mod failed to launch (Windows) #53

Closed hanjoosten closed 8 years ago

hanjoosten commented 8 years ago

When I start atom on windows, I get the following error messages:

hjo 20150917 09 57 20

When I start a regular cmd, ghc-mod is in the path: hjo 20150917 09 59 56

I use haskell-ghc-mod version 0.9.4 with the following settings: hjo 20150917 10 03 49

The error message is not clear to distinguish if ghc-mod cannot be found at all, or if it can be found, but it doesn't do what it is supposed to do (after all, I currently have version 5.4.0.0 installed, which might not be supported)

hanjoosten commented 8 years ago

Might be related with issue #52

lierdakil commented 8 years ago

I've updated v0.9.5 to actually show error message if possible. Could you update and post that first screenshot again?

Note, that if ghc-mod is in PATH, you shouldn't need to change settings like you have.

hanjoosten commented 8 years ago

In the meantime, I found out, that when I add the path to the Additional Path Directories, at least I could work again. Still the error message exists. After the update, I get a better error message, that explains what is going on: hjo 20150918 06 52 06 The project I load, consists of about 100 (!) Haskell modules. (https://github.com/AmpersandTarski/ampersand). I can imagine that some time is required to load / compile / generate whatever is going on under the hood of the Haskell Ide. This also explains why after a while I can work. It would be nice if the user would get a message asking to wait of to cancel the operation?

lierdakil commented 8 years ago

Okay, that's kinda weird. This particular call to ghc-mod is only there to query version, so it should be pretty fast... @DanielG, any insight you might offer here? I call ghc-mod version there and timeout is 1000ms currently, which, I think, should be quite enough for a version query?

DanielG commented 8 years ago

Well if the first thing you call is ghc-mod version it could be slow because of disk I/O as the executable is quite large but other than that it should be instant. It's handled differently from all the other commands and pretty much just short circuits the command line parser so it really shouldn't take that long :/

hanjoosten commented 8 years ago

For what it is worth: I have a reasonable fast machine, with multiple cores. When starting atom,, I see no unreasonable things happen: a couple of atom.exe , node.exe ghc-mod.exe running. Then, the error messages as shown in the screenshot. The warning of autocomplete-haskell isn't displayed every time. I guess it is on the edge of some timeout.

hanjoosten commented 8 years ago

If there is anything I could do to test, let me know.

lierdakil commented 8 years ago

@hanjoosten, there actually is. First, start Atom as you usually do, open dev.console and run process.env.CWD. That will give you a path. Then, try running ghc-mod --map-file test version in path given by previous command. Time it if at all possible.

For the moment, I'm just tempted to make this timeout configurable...

hanjoosten commented 8 years ago

In the meantime, I had discovered that there was some a process called RapportMgmtService.exe (from Trusteer). This process makes compilation VERY slow. I am sorting this out currently. For the time being, I disabled this process. Now doing cabal install is much faster then befor. This is, because all my cores are being used now by instances of ghc.exe. Before ghc got only 1 or 2 % of cpu. Now, it gets more than 50%. 8-))

While finding out what exacly goes on, I have reinstalled my entire haskell chain. When I enable RapportMgmtService.exe, I get the same behaviour as before: a complaint about the timeout.

When I disable RapportMgmtService.exe, then I get quite a lot of other error messages, and then I get an element inspection screen that I know of chrome: hjo 20150918 20 04 44

Maybe this has nothing to do with the original issue, but I really do not understand what is going on!

Now, for your question: I am not sure what you mean. How do I open dev.console, and run process.env.CWD ?

3noch commented 8 years ago

Looks like process.env.CWD is not available on Windows. But process.env.Path is. However that gives the PATH variable contents.

lierdakil commented 8 years ago

@hanjoosten, dev.console is something you might know from chrome. You can toggle it via View → Developer → Toggle Developer Tools, and then selecting 'Console' tab there.

If process.env.CWD doesn't work on Win (which is weird to me, but oh well), you can also try process.cwd()

lierdakil commented 8 years ago

Anyway, I released 0.9.6, which has configurable timeout. Default value also raised somewhat.

lierdakil commented 8 years ago

Not sure I understand what's the deal with ENOENT either. It appears, Atom can't find ghc-mod executable. But it should've found it, otherwise you wouldn't get these errors, since it wouldn't initialize. Very strange.

lierdakil commented 8 years ago

Okay, figured out why ENOENT happens. Pesky EOL markers got me again. v0.9.9 should work there.

hanjoosten commented 8 years ago

Great! Now it works! super! Thanks!