Skip to content

Commit 2adf66b

Browse files
committed
Stack CI: do not use system-ghc, let stack install GHC
This combats the following error: https://github.com/hackage-trustees/hackage-cli/actions/runs/24601026158/job/71939628911?pr=80#step:9:20 WARNING: /Users/runner/.ghcup/ghc/9.8.4/lib/ghc-9.8.4/bin/./ghc-9.8.4 is loading libcrypto in an unsafe way The fix was suggested by Copilot and Google AI. [Storch]
1 parent e37d9d1 commit 2adf66b

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

.github/workflows/stack.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ jobs:
2626
# ghc-ver: '9.10'
2727

2828
env:
29-
ARGS: "--stack-yaml=stack-${{ matrix.ghc-ver }}.yaml --no-terminal --system-ghc"
29+
# ARGS: "--stack-yaml=stack-${{ matrix.ghc-ver }}.yaml --no-terminal --system-ghc"
30+
ARGS: "--stack-yaml=stack-${{ matrix.ghc-ver }}.yaml --no-terminal"
3031

3132
# Needed for Windows to make piping (... >> ...) and evaluation ( $(...) ) work.
3233
defaults:
@@ -41,9 +42,15 @@ jobs:
4142
with:
4243
ghc-version: ${{ matrix.ghc-ver }}
4344
enable-stack: true
45+
# Andreas, 2026-04-18
46+
# There have been problems with libcrypto on macOS with GHC 9.8.4 with --system-ghc
47+
# so we let Stack install GHC itself.
48+
stack-no-global: true
4449

4550
- name: Set up the openssl library (MacOS)
4651
if: runner.os == 'macOS'
52+
# Already installed:
53+
# brew install openssl
4754
run: |
4855
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}"
4956
echo "PKG_CONFIG_PATH=$(brew --prefix)/opt/openssl/lib/pkgconfig" >> "${GITHUB_ENV}"
@@ -68,11 +75,15 @@ jobs:
6875
- name: Cache dependencies (restore)
6976
uses: actions/cache/restore@v5
7077
id: cache
78+
env:
79+
key: ${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ matrix.ghc-ver }}
80+
# ${{ steps.setup.outputs.ghc-version }} is empty with stack-no-global
81+
# so we use plain ${{ matrix.ghc-ver }}
7182
with:
7283
path: ${{ steps.setup.outputs.stack-root }}
7384
# Use a unique primary key (always save new cache); works if caches aren't to big or too many...
74-
key: ${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ steps.setup.outputs.ghc-version }}-commit-${{ github.sha }}
75-
restore-keys: ${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ steps.setup.outputs.ghc-version }}-
85+
key: ${{ env.key }}-commit-${{ github.sha }}
86+
restore-keys: ${{ env.key }}-
7687

7788
- name: Install dependencies
7889
# if: ${{ steps.cache.outputs.cache-hit != 'true' }}

0 commit comments

Comments
 (0)