Skip to content

Commit

Permalink
Rename GHCUPVER to GHCUP_VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
harendra-kumar committed Dec 17, 2023
1 parent 60ad81f commit 1e5613a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env: &env
# ------------------------------------------------------------------------
# GHC_OPTIONS: "-Werror"
# For updating see: https://downloads.haskell.org/~ghcup/
GHCUPVER: 0.1.20.0
GHCUP_VERSION: 0.1.20.0
CABAL_REINIT_CONFIG: "y"
LC_ALL: "C.UTF-8"

Expand Down Expand Up @@ -96,7 +96,7 @@ preinstall: &preinstall
apt-get install -y zlib1g-dev
# For ghcup to install ghc
if test -n "$GHCUPVER"
if test -n "$GHCUP_VERSION"
then
apt-get install -y gcc
apt-get install -y g++
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/packcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
# Selecting tool versions
# ------------------------------------------------------------------------
# For updating see: https://downloads.haskell.org/~ghcup/
GHCUPVER: 0.1.20.0
GHCUP_VERSION: 0.1.20.0
GHCVER: ${{ matrix.ghc_version }}
# RESOLVER: ${{ matrix.stack_resolver }}

Expand Down
4 changes: 2 additions & 2 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## 0.7.0 (Dec 2023)

### Enhancements
* Now supports using ghcup to install ghc automatically if GHCUPVER env var is
specified.
* Now supports using ghcup to install ghc automatically if `GHCUP_VERSION`
env var is specified.

### Breaking Changes

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ are used in CI files to run the exact same tests locally. Usage is as simple
as:
```
$ packcheck.sh cabal
$ packcheck.sh cabal GHCUPVER=0.1.20.0 GHCVER=9.8.1
$ packcheck.sh cabal GHCUP_VERSION=0.1.20.0 GHCVER=9.8.1
$ packcheck.sh stack GHCVER=9.4
```

Expand Down Expand Up @@ -96,7 +96,7 @@ The script can be easily adapted to any CI with a single line build command.
line or environment variables, including tool options or whether to enable
benchmarks, haddock, coverage, test etc.
* _Picking GHC:_ Right GHC is picked up automatically from PATH or installed
using ghcup by specifying GHCUPVER and GHCVER env vars. Stack
using ghcup by specifying GHCUP_VERSION and GHCVER env vars. Stack
installed GHC binaries can be picked automatically when available.
* _Test source distribution:_ `packcheck` creates the source distribution and
builds the package from the generated tarball to make sure that you build
Expand Down Expand Up @@ -154,7 +154,7 @@ You can run these commands on your local machine as well as inside a CI script.
You can try these commands in the `packcheck` package itself:
```
$ cd packcheck
$ ./packcheck.sh cabal GHCUPVER=0.1.20.0 GHCVER=9.8.1
$ ./packcheck.sh cabal GHCUP_VERSION=0.1.20.0 GHCVER=9.8.1
```

```
Expand Down Expand Up @@ -193,7 +193,7 @@ components until it finds a matching `ghc` version.
If `GHCVER` is set to `head`, packcheck looks for `ghc-head` as the
compiler and does not check the numeric version of the compiler.

If `GHCUPVER` is specified packcheck tries to use the existing `ghcup`
If `GHCUP_VERSION` is specified packcheck tries to use the existing `ghcup`
to install the ghc, if `ghcup` is not found it installs the requested
version and then installs the `GHCVER` using it.

Expand Down Expand Up @@ -289,7 +289,7 @@ help | --help | -h : show this help message
--------------------------------------------------
Selecting tool versions
--------------------------------------------------
GHCUPVER : [a.b.c.d] GHCUP version to install GHCVER if needed
GHCUP_VERSION : [a.b.c.d] GHCUP version to install GHCVER if needed
GHCVER : [a.b.c | head] GHC version prefix (may not be enforced when using stack)
CABALVER : [a.b.c.d] Cabal version (prefix) to use
STACKVER : [a.b.c.d] Stack version (prefix) to use
Expand Down
10 changes: 5 additions & 5 deletions packcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ show_machine_info() {
SAFE_ENVVARS="\
RESOLVER \
ENABLE_GHCJS \
GHCUPVER \
GHCUP_VERSION \
GHCVER \
CABALVER \
GHC_OPTIONS \
Expand Down Expand Up @@ -354,7 +354,7 @@ show_help() {
show_step1 "Selecting tool versions"
# untested/unsupported
#help_envvar ENABLE_GHCJS "[y] Use GHCJS instead of GHC to build"
help_envvar GHCUPVER "[a.b.c.d] GHCUP version to install at $GHCUP_PATH (see https://downloads.haskell.org/~ghcup/)"
help_envvar GHCUP_VERSION "[a.b.c.d] GHCUP version to install at $GHCUP_PATH (see https://downloads.haskell.org/~ghcup/)"
help_envvar GHCVER "[a.b.c | head] GHC version prefix (may not be enforced when using stack)"
help_envvar CABALVER "[a.b.c.d] Cabal version (prefix) to use"
help_envvar STACKVER "[a.b.c.d] Stack version (prefix) to use"
Expand Down Expand Up @@ -895,7 +895,7 @@ ghcup_install() {
esac

# Check available versions here: https://downloads.haskell.org/~ghcup/
URL="https://downloads.haskell.org/~ghcup/$GHCUPVER/${GHCUP_ARCH}-ghcup-$GHCUPVER"
URL="https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/${GHCUP_ARCH}-ghcup-$GHCUP_VERSION"
echo "Downloading $URL to $GHCUP_PATH"
# XXX Download to a temp location and move when successful?
#TEMP=$(mktemp -d .ghcup-XXXXXX)
Expand Down Expand Up @@ -1004,7 +1004,7 @@ ensure_ghc() {
then
local ghc
ghc="$(which_cmd ghc)"
if test -z "$ghc" -a -n "$GHCUPVER"
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
Expand Down Expand Up @@ -1125,7 +1125,7 @@ ensure_cabal() {
if test -n "$(need_stack)"
then
stack_install_tool cabal-install
elif test -n "$GHCUPVER"
elif test -n "$GHCUP_VERSION"
then
ghcup_install cabal $CABALVER
if test -n "$CABALVER"
Expand Down

0 comments on commit 1e5613a

Please sign in to comment.