@@ -335,11 +335,12 @@ jobs:
335335 - uses : actions/checkout@v4
336336
337337 # See the "cabal path" output in the CI logs to tweak the cache locations
338+ # ghc is big but cheap to install, if cache size is a concern we can avoid
339+ # caching it.
338340 - uses : actions/cache@v4
339341 name : Cache ghcup (non-Windows)
340342 if : runner.os != 'Windows'
341343 with :
342- # ghcup: ~/.ghcup (macOS), /usr/local/.ghcup (Linux)
343344 path : |
344345 ~/.ghcup
345346 key : ${{ matrix.runner }}-ghcup-${{ env.GHCUP_VERSION }}-${{ matrix.ghc_version }}-v1
@@ -354,10 +355,12 @@ jobs:
354355 name : Cache common directories (non-Windows)
355356 if : runner.os != 'Windows'
356357 with :
357- # cabal: ~/.local/bin, ~/.local/state/cabal, ~/.local/cache/cabal
358+ # cabal: ~/.local/bin, ~/.local/state/cabal
359+ # ~/.cache/cabal/packages can be cached, but will increase the
360+ # cache size. But can save the "cabal update" time.
358361 path : |
359- ~/.cabal
360- ~/.local
362+ ~/.local/bin
363+ ~/.local/state/cabal
361364 ~/.stack
362365 # Bump the key version to clear the cache
363366 # Key is same as the CI name
@@ -417,22 +420,34 @@ jobs:
417420 rm cabal.project
418421 cd "$SUBDIR"
419422 fi
423+ # Commands like mount, sysctl for info require sbin
424+ PATH_VAR=/bin:/usr/bin:/sbin:/usr/sbin
420425 case "$(uname)" in
421426 Linux)
422- PATH_VAR=/bin
423427 # On Linux it defaults to /usr/local, during cache restore
424428 # tar is unable to change permissions and restore fails.
425429 export GHCUP_INSTALL_BASE_PREFIX=$HOME
426430 ;;
427- Darwin)
428- PATH_VAR=/bin:/usr/bin
429- ;;
430431 CYGWIN*|MINGW*|MSYS*)
431- PATH_VAR="/bin :/c/Program Files/7-Zip:/mingw64/bin"
432+ PATH_VAR="$PATH_VAR :/c/Program Files/7-Zip:/mingw64/bin"
432433 ;;
433434 esac
434435 # Use "bash -c" instead of invoking directly to preserve quoted
435436 # arguments in PACKCHECK_COMMAND e.g. DOCSPEC_OPTIONS="--timeout 60".
436437 # Direct invocation would word-split on spaces inside quoted values.
437438 echo "$PACKCHECK $PACKCHECK_COMMAND PATH=\"$PATH_VAR\""
438439 bash -c "$PACKCHECK $PACKCHECK_COMMAND PATH=\"$PATH_VAR\""
440+
441+ - name : Check cache locations
442+ if : runner.os != 'Windows'
443+ run : |
444+ # We want to see if it is a symlink; on github ~/.ghcup is a
445+ # pre-existing symlink to /usr/local.
446+ list="$HOME/.cabal $HOME/.local/bin $HOME/.local/state/cabal $HOME/.ghcup $HOME/.stack"
447+ for dir in $list; do
448+ du -sh --no-dereference "$dir" 2>/dev/null || echo "$dir missing"
449+ done
450+ echo
451+ #ls -ld $list 2>/dev/null
452+ ls -al $list 2>/dev/null
453+ exit 0
0 commit comments