diff --git a/ci/config.sh b/ci/config.sh index a2a53f92e9ba37b8f49478b9cbb5e1334d3a25b6..9a11a9ce1379b875fe5216099dc66d8602b2afae 100644 --- a/ci/config.sh +++ b/ci/config.sh @@ -115,20 +115,53 @@ extra_package pandoc build_tool_package alex build_tool_package happy -# Quick build configuration -# ========================= +# $BUILD_MODE controls how head.hackage runs. +# =========================================== # -# If $QUICK is defined we build the "quick" configuration, which builds a small -# subset of the overall package set. We do this during the merge request -# validation pipeline. +# Four build modes exist: FULL, QUICK, TEST, and COMPAT. +# +# FULL. +# ------ +# Build all patched + extra packages. +# +# QUICK. +# ------ +# Build the "quick" configuration, which builds a small subset of the overall +# package set. We do this during the merge request validation pipeline. Note: If +# "$QUICK" is non-null, it is used as a backwards-compat synonym for +# BUILD_MODE=QUICK. +# +# TEST. +# ----- +# Just build the local test packages and run the tests. +# +# COMPAT: FULL + TEST. +# -------------------- +# Backwards-compat default build mode. +# +: ${BUILD_MODE:=COMPAT} if [ -n "$QUICK" ]; then - only_package Cabal - only_package microlens - only_package free - only_package optparse-applicative + BUILD_MODE=QUICK fi - -# Testing specific local packages - -test_package system-test "$(pwd)/../tests/ghc-debug/test/" -test_package ghc-tests "$(pwd)/../tests/ghc-tests" +case "$BUILD_MODE" in + FULL) ;; + QUICK) + only_package tasty + only_package Cabal + only_package microlens + only_package free + only_package optparse-applicative + ;; + TEST) + # FIXME: I specify a single "only_package" to prevent all the other + # packages from being built. Morally, I really want to say "build + # nothing at all besides the tests". + only_package tasty + test_package system-test "$(pwd)/../tests/ghc-debug/test/" + test_package ghc-tests "$(pwd)/../tests/ghc-tests" + ;; + COMPAT) + test_package system-test "$(pwd)/../tests/ghc-debug/test/" + test_package ghc-tests "$(pwd)/../tests/ghc-tests" + ;; +esac