Make sure GHCUP_INSTALL_BASE_PREFIX is set (#6770)

We use it during installation and add it to PATH, but then
don't instruct ghcup to actually use this directory at runtime.

This leads to:

1. ghcup is in /usr/local/.ghcup/bin/
2. `ghcup install cabal latest` will actually install into ~/.ghcup/bin/
3. since ~/.ghcup/bin/ is not in PATH, but /usr/local/.ghcup/bin/ is,
   the new binary is not visible to the user

This issues does not exist on darwin, because there we use
~/.ghcup/bin/.

https://downloads.haskell.org/ghcup/tmp/aarch64-linux-ghcup-0.1.18.1
This commit is contained in:
Julian Ospald
2023-01-02 17:58:35 +08:00
committed by GitHub
parent b659709f2f
commit b38865e056

View File

@@ -14,6 +14,7 @@ export GHCUP_INSTALL_BASE_PREFIX=/usr/local
export BOOTSTRAP_HASKELL_GHC_VERSION=0
ghcup_bin=$GHCUP_INSTALL_BASE_PREFIX/.ghcup/bin
setEtcEnvironmentVariable "BOOTSTRAP_HASKELL_NONINTERACTIVE" $BOOTSTRAP_HASKELL_NONINTERACTIVE
setEtcEnvironmentVariable "GHCUP_INSTALL_BASE_PREFIX" $GHCUP_INSTALL_BASE_PREFIX
# Install GHCup
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh > /dev/null 2>&1 || true