Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default ghc for cabal-docspec #77

Merged
merged 1 commit into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Unreleased

* Set default "ghc" in PATH for cabal-docspec to work

## 0.7.0 (Dec 2023)

### Enhancements
Expand Down
20 changes: 13 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,8 @@ else
die "Use DOCSPEC_URL option to install."
fi
fi
# XXX Use the --with-compiler option instead
ensure_default_ghc
run_verbose_errexit cabal-docspec --version
run_verbose_errexit cabal-docspec $DOCSPEC_OPTIONS
fi
Expand Down
Loading