From c7c6b9819c75b37cc75462106e94f0a85ead54a2 Mon Sep 17 00:00:00 2001 From: Harendra Kumar Date: Sat, 18 Apr 2026 23:07:57 +0530 Subject: [PATCH 1/3] Fix the new cabal config path in some cases --- packcheck.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packcheck.sh b/packcheck.sh index e670b68..67a68ad 100755 --- a/packcheck.sh +++ b/packcheck.sh @@ -1745,8 +1745,10 @@ ensure_cabal_config() { # Precedence: CABAL_CONFIG > CABAL_DIR > Legacy > XDG if test -n "$CABAL_CONFIG"; then CABAL_OLD_CONFIG_PATH="$CABAL_CONFIG" + CABAL_NEW_CONFIG_PATH="$CABAL_CONFIG" elif test -n "$CABAL_DIR"; then CABAL_OLD_CONFIG_PATH="$(cygpath -u $CABAL_DIR)/config" + CABAL_NEW_CONFIG_PATH="${OS_APP_HOME}/.config/cabal/config" else CABAL_OLD_CONFIG_PATH="${OS_APP_HOME}/${OS_CABAL_DIR}/config" CABAL_NEW_CONFIG_PATH="${OS_APP_HOME}/.config/cabal/config" From 1af1f0d5f77d8c78ed95b485e8c463fa5d8776b9 Mon Sep 17 00:00:00 2001 From: Harendra Kumar Date: Sat, 18 Apr 2026 23:20:48 +0530 Subject: [PATCH 2/3] Cleanup stack.yaml check --- packcheck.sh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/packcheck.sh b/packcheck.sh index 67a68ad..16939e4 100755 --- a/packcheck.sh +++ b/packcheck.sh @@ -2548,15 +2548,6 @@ get_rel_time() { echo $((`get_sys_time` - ${BASE_TIME})) } -#------------------------------------------------------------------------------ -# Some adjustments to the build environment -#------------------------------------------------------------------------------ - -setup_environment() { - # stack does not work well with empty STACK_YAML env var - test -n "$STACK_YAML" || unset STACK_YAML -} - #------------------------------------------------------------------------------ # Main flow of script starts here #------------------------------------------------------------------------------ @@ -2717,7 +2708,6 @@ TOOLS="awk cat curl cut date env head mkdir printf rm sleep sort tail tr uname w $OS_HAS_TOOLS" show_step "Check basic tools" -setup_environment require_cmd bash for i in $TOOLS; do require_cmd $i; done @@ -2735,6 +2725,8 @@ if test "$BUILD" = "hlint" then start_hlint else + # stack does not work well with empty STACK_YAML env var + test -n "$STACK_YAML" || unset STACK_YAML verify_build_config build_compile fi From 04c8c14c7422039550b2868fc8657b15b2f0e774 Mon Sep 17 00:00:00 2001 From: Harendra Kumar Date: Sat, 18 Apr 2026 23:57:49 +0530 Subject: [PATCH 3/3] Implement DISABLE_BUILD --- packcheck.sh | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/packcheck.sh b/packcheck.sh index 16939e4..160afcf 100755 --- a/packcheck.sh +++ b/packcheck.sh @@ -294,6 +294,7 @@ SAFE_ENVVARS="\ BUILD_PREFETCH \ BUILD_PREFETCH_DEBUG \ DISABLE_DOCS \ + DISABLE_BUILD \ ENABLE_DOCSPEC \ DISABLE_DIST_CHECKS \ TOOLS_DIR \ @@ -513,10 +514,11 @@ show_help() { help_envvar HADDOCK_OPTIONS "ADDITIONAL haddock build options to append to defaults" show_step1 "Specifying what to build" + help_envvar DISABLE_BUILD "[y] Do not build, makes sense if only docs are built" help_envvar DISABLE_BENCH "[y] Do not build benchmarks, default is to build but not run" help_envvar DISABLE_TEST "[y] Do not run tests, default is to run tests" - help_envvar DISABLE_DOCS "[y] Do not build haddocks, default is to build docs" help_envvar ENABLE_DOCSPEC "[y] Run cabal-docspec after the cabal build" + help_envvar DISABLE_DOCS "[y] Do not build haddocks, default is to build docs" help_envvar DISABLE_SDIST_BUILD "[y] Do not build from source distribution" help_envvar DISABLE_SDIST_PROJECT_CHECK "[y] Ignore project file and continue" help_envvar DISABLE_SDIST_GIT_CHECK "[y] Do not compare source distribution with git repo" @@ -596,6 +598,7 @@ check_all_boolean_vars () { check_boolean_var BUILD_PACKAGE_ONLY check_boolean_var BUILD_PREFETCH check_boolean_var BUILD_PREFETCH_DEBUG + check_boolean_var DISABLE_BUILD check_boolean_var DISABLE_DOCS check_boolean_var ENABLE_DOCSPEC check_boolean_var COVERAGE @@ -2027,15 +2030,18 @@ build_and_test() { show_step "Build" echo "pwd: $(pwd)" - # If we use --enable-documenation cabal compiles once for build - # and compilation is forced again for documentation it says "Flags - # Changed". The same thing happens for separate haddock step as - # well. But in a separate haddock step we can at least change the - # build-dir to not clobber our pervious build. If haddock clobbers then - # running tests will build it again. - run_verbose_errexit $SDIST_CABALCMD v2-build \ - --with-compiler "$COMPILER_EXE_PATH" \ - $GHCJS_FLAG $CABAL_BUILD_OPTIONS $CABAL_BUILD_TARGETS + if test -z "$DISABLE_BUILD" -o -z "$DISABLE_TEST" -o -z "$DISABLE_BENCH" -o -n "$ENABLE_DOCSPEC" + then + # If we use --enable-documenation cabal compiles once for build + # and compilation is forced again for documentation it says "Flags + # Changed". The same thing happens for separate haddock step as + # well. But in a separate haddock step we can at least change the + # build-dir to not clobber our pervious build. If haddock clobbers then + # running tests will build it again. + run_verbose_errexit $SDIST_CABALCMD v2-build \ + --with-compiler "$COMPILER_EXE_PATH" \ + $GHCJS_FLAG $CABAL_BUILD_OPTIONS $CABAL_BUILD_TARGETS + fi # Haddock build forces recompilation of tests, so we should either do # haddock in separate builddir or do them after the tests. @@ -2045,7 +2051,7 @@ build_and_test() { echo "pwd: $(pwd)" run_verbose_errexit $SDIST_CABALCMD v2-haddock \ --with-compiler "$COMPILER_EXE_PATH" \ - $GHCJS_FLAG + $GHCJS_FLAG \ --builddir dist-newstyle-haddock \ $CABAL_BUILD_OPTIONS \ $HADDOCK_OPTIONS \