Skip to content

Commit

Permalink
Set default ghc for cabal-docspec
Browse files Browse the repository at this point in the history
  • Loading branch information
harendra-kumar committed Dec 27, 2023
1 parent 8b8b615 commit fc28720
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions packcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,16 @@ ghcup_install() {
fi
}

ensure_default_ghc() {
local ghc
ghc="$(which_cmd ghc)"
if test -z "$ghc" -a -n "$GHCUP_VERSION"
then
echo "No default ghc found in PATH. Setting it using ghcup"
ghcup set ghc $GHCVER
fi
}

ensure_ghc() {
local found
local compiler
Expand Down Expand Up @@ -1024,13 +1034,7 @@ ensure_ghc() {
# cabal info command requires "ghc" to be in PATH
if test -z "$DISABLE_SDIST_BUILD"
then
local ghc
ghc="$(which_cmd ghc)"
if test -z "$ghc" -a -n "$GHCUP_VERSION"
then
echo "No default ghc found in PATH. Setting it using ghcup because SDIST_BUILD needs it"
ghcup set ghc $GHCVER
fi
ensure_default_ghc
fi

if test -n "$ENABLE_GHCJS"
Expand Down Expand Up @@ -2104,6 +2108,7 @@ else
die "Use DOCSPEC_URL option to install."
fi
fi
ensure_default_ghc
run_verbose_errexit cabal-docspec --version
run_verbose_errexit cabal-docspec $DOCSPEC_OPTIONS
fi
Expand Down

0 comments on commit fc28720

Please sign in to comment.