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

Check if ghc-mod matches ghc version #140

Closed varosi closed 8 years ago

varosi commented 8 years ago

Check if ghc-mod matches ghc version and don't run plug-in if they don't match, because later it will crash. Then show a warning that plug-in is not running because ghc-mod is not matching ghc version.

ghc-mod ran without parameters show what ghc is used to build it.

DanielG commented 8 years ago

This is more difficult to do correctly than you might think. You can't just go and call ghc --version and ghc-mod --version to get what you want. While that might work in simple cases consider: cabal configure --with-ghc=/some/custom/version/of/ghc. This will make cabal use whatever ghc you point it to, which obviously doesn't have to be the same version as the one on PATH. So to check if the ghc versions match you actually need to peek inside cabal's configuration state which is considered hard. Just something to keep in mind.

varosi commented 8 years ago

Yes, you're right. May be simple check turned on by default and overriden with option is okay for most situations.

lierdakil commented 8 years ago

A short warning will probably suffice. I will get to it when I have a chance. Don't hold your breath though, there are more pressing issues at the moment.

varosi commented 8 years ago

Great! Thanks!

2016-05-11 2:37 GMT+03:00 Nikolay Yakimov notifications@github.com:

A short warning will probably suffice. I will get to it when I have a chance. Don't hold your breath though, there are more pressing issues at the moment.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/atom-haskell/haskell-ghc-mod/issues/140#issuecomment-218323340

lierdakil commented 8 years ago

Mostly done in 1.14.0.

varosi commented 8 years ago

Strange error I got on some other Windows 8 machine:

haskell-ghc-mod warning: No cabal sandbox found /C:/Users/Home/.atom/packages/haskell-ghc-mod/lib/util.coffee:63 haskell-ghc-mod warning: GHC version in your PATH '7.10.3' doesn't match with GHC version used to build ghc-mod '7.10.3'. This can lead to problems when using Cabal or Plain projects

See that both versions seems the same.

2016-05-18 16:34 GMT+03:00 Nikolay Yakimov notifications@github.com:

Mostly done in 1.14.0.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/atom-haskell/haskell-ghc-mod/issues/140#issuecomment-220027120

lierdakil commented 8 years ago

That's a typo on my part. I will fix it in the next release. What it meant to say is

GHC version in your PATH '7.10.2'

varosi commented 8 years ago

No problem! Now the message is fine.

Thank you!

2016-05-18 17:51 GMT+03:00 Nikolay Yakimov notifications@github.com:

That's a typo on my part. I will fix it in the next release. What it meant to say is

GHC version in your PATH '7.10.2'

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/atom-haskell/haskell-ghc-mod/issues/140#issuecomment-220051196