Skip to content

Commit c402c9c

Browse files
Add sbin to paths, add debug code for caches
1 parent 22515ce commit c402c9c

File tree

2 files changed

+26
-10
lines changed

2 files changed

+26
-10
lines changed

.cirrus.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ task:
9595
fi
9696
9797
packcheck_run_script: |
98-
PTH=/usr/local/bin:/usr/bin:/bin
98+
# Commands like mount, sysctl for info require sbin
99+
PTH=/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin
99100
# Use "bash -c" instead of invoking directly to preserve quoted
100101
# arguments in PACKCHECK_COMMAND e.g. DOCSPEC_OPTIONS="--timeout 60".
101102
# Direct invocation would word-split on spaces inside quoted values.

.github/workflows/haskell.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)