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

install.hs: Make all available GHCs in PATH buildable #1297

Merged
merged 2 commits into from
Jun 21, 2019

Conversation

maoe
Copy link
Member

@maoe maoe commented Jun 18, 2019

This PR extends the GHC search logic so that install.hs can find all available ghcs in $PATH.

The motivation is that at our company we have our own build of GHCs installed in some directories with custom versioning (e.g. ghc-8.6.4.0) and make them available by modifying $PATH variable. Currently stack install.hs cabal-ghcs cannot find them because it only tries to find GHCs whose version matches one of the versions returned by getHieVersions.

The new search logic does the following:

  • Find all known GHCs in $PATH
    • This is the original behavior.
  • Find all available ghcs in $PATH
  • Merge the two sets of paths.
    • If stack-provided GHCs are included, exclude them.
    • If both sets have the same version, the known GHC takes precedence.

This can also be useful to try hie with GHC alpha/HEAD etc. You can make the GHC available in $PATH and type stack install.hs cabal-ghc-8.7.20190618 for example.

@fendor fendor requested review from samuelpilz and fendor and removed request for samuelpilz June 18, 2019 08:45
install.hs Outdated Show resolved Hide resolved
@fendor
Copy link
Collaborator

fendor commented Jun 19, 2019

waiting for approval of @power-fungus

@fendor fendor merged commit c78cbb0 into haskell:master Jun 21, 2019
@maoe maoe deleted the find-all-available-ghcs branch June 21, 2019 11:02
@alanz alanz added this to the 2019-06 milestone Jul 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants