From 1e5613a4b2c5ffc676a9bd7d8bd1c50b920ac461 Mon Sep 17 00:00:00 2001 From: Harendra Kumar Date: Sun, 17 Dec 2023 05:04:30 +0530 Subject: [PATCH] Rename GHCUPVER to GHCUP_VERSION --- .circleci/config.yml | 4 ++-- .github/workflows/packcheck.yml | 2 +- Changelog.md | 4 ++-- README.md | 10 +++++----- packcheck.sh | 10 +++++----- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c8d5f72..96971a6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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" @@ -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++ diff --git a/.github/workflows/packcheck.yml b/.github/workflows/packcheck.yml index 3f686bf..098ca83 100644 --- a/.github/workflows/packcheck.yml +++ b/.github/workflows/packcheck.yml @@ -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 }} diff --git a/Changelog.md b/Changelog.md index 83aa829..5bbf2fd 100644 --- a/Changelog.md +++ b/Changelog.md @@ -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 diff --git a/README.md b/README.md index 8d37024..9088dd5 100644 --- a/README.md +++ b/README.md @@ -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 ``` @@ -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 @@ -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 ``` ``` @@ -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. @@ -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 diff --git a/packcheck.sh b/packcheck.sh index a835e68..8b7849f 100755 --- a/packcheck.sh +++ b/packcheck.sh @@ -194,7 +194,7 @@ show_machine_info() { SAFE_ENVVARS="\ RESOLVER \ ENABLE_GHCJS \ - GHCUPVER \ + GHCUP_VERSION \ GHCVER \ CABALVER \ GHC_OPTIONS \ @@ -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" @@ -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) @@ -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 @@ -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"