Skip to content
Snippets Groups Projects

Fix $PATH ordering in README

Closed Eliza Zhang requested to merge liftM/ghcup:doc/path-ordering into master

The README currently suggests to set your $PATH like so:

export PATH="$HOME/.cabal/bin:$HOME/.ghcup/bin:$PATH"

However, this means the system-installed cabal overrides the ghcup installed cabal. This recently bit me. Instead, I believe the $PATH should be set like so:

export PATH="$HOME/.ghcup/bin:$HOME/.cabal/bin:$PATH"

Merge request reports

Pipeline #11759 passed

Pipeline passed for 95031787 on liftM:doc/path-ordering

Approval is optional

Closed by Julian OspaldJulian Ospald 5 years ago (Oct 29, 2019 2:55am UTC)

Merge details

  • The changes were not merged into .

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • However, this means the system-installed cabal overrides the ghcup installed cabal. This recently bit me. Instead, I believe the $PATH should be set like so:

    This is on purpose! Because a cabal binary installed freshly from hackage on your system is likely more recent and desirable.

  • closed

  • My experience was migrating from a stack-managed installation of cabal to ghcup-managed installation. In my case, I was setting up a project that used Cabal 3.x, which Stack does not yet support.

    I was getting some incompatibility errors with building my project before I realised that, even though I had run ghcup install-cabal, which cabal was pointing at my Stack-managed installation of Cabal 2.x.

    In my case, having the guarantee that "my cabal is always in sync and compatible with my ghcup-installed ghc" would have been more valuable than "my cabal is the one I last installed".

    The behaviour that I expect coming from other version managers like NVM is for every ghc version to have its own persistent (i.e. "if I'm running GHC X which by default installs Cabal Y and I upgrade to Cabal Z, the next time I switch back to GHC X, I'm using Cabal Z"), compatible cabal. Is this an intended goal?

  • ghc and cabal-install are not in sync at all currently. And why would they?

    It should be backwards compatible. There is no switching of cabal-install implemented at all. It's purpose is bootstrapping, mainly.

    Once you bootstrapped it you want to be able to install any version you want from hackage.

  • Once you bootstrapped it you want to be able to install any version you want from hackage.

    I was under the impression that specific versions of Cabal are only compatible with specific versions of GHC, but it sounds like I might be wrong here. Thanks for clarifying.

Please register or sign in to reply
Loading