MondayMorningHaskell / haskellings

An automated tutorial to teach you about Haskell!
BSD 3-Clause "New" or "Revised" License
166 stars 25 forks source link

Could not find ghc-8.8.4 #40

Closed nixant closed 3 years ago

nixant commented 3 years ago

NoGhcError is thrown when ghc is not installed.

The code looks for the directory ghc-version (ghc-8.8.4), but in some cases the name of the folder where stack installs ghc can be different, e.g ghc-tinfo6-8.8.4 in my case.

One solution seems to replace the predicate for find here: https://github.com/MondayMorningHaskell/haskellings/blob/fafadd5bbb722b54c1b7b114e34dc9b96bb7ca4d/src/Config.hs#L190 to (isSuffixOf ghcVersionNumber)

MondayMorningHaskell commented 3 years ago

@nixant Let's make it so that the version number (8.8.4) has to be a suffix but it should contain ghc somewhere in the directory. That should work for your case, right?

nixant commented 3 years ago

@MondayMorningHaskell yes that would work for my case. We can also check that ghc is prefix and version number is suffix, this will cover the current case as well.

jhb563 commented 3 years ago

@nixant Sorry took me a while to get to this, but here's a PR if you want to take a look!

https://github.com/MondayMorningHaskell/haskellings/pull/42

nixant commented 3 years ago

Thanks for fixing it.