Skip to content

Commit

Permalink
Fix macOS pkg-config error previously unresolved by 020648a
Browse files Browse the repository at this point in the history
Due to a bug in the highway brew package, pkg-config --list-all segfaults
on mac runners (actions/runner-images#6364). In
addition, cabal probes pkg-config --list-all despite not needing it
(haskell/cabal#8496).

Combined, this created an issue where cabal would fail to create a build
plan on macOS GitHub Action runners citing a lack of libsodium/pkg-config.

The temporary solution is to reinstall the highway brew package since it
has now been patched. The long-term solution is to wait for cabal to change
its probing behaviour (tracked above), or wait for GitHub Actions runner
environments to update so it comes with the patch preinstalled.

(side note: I was pursuing this CI bug for over 4 days, unable to find
anything relevant on search engines.... until 30 minutes ago, when I hit
the jackpot with the right search terms and arrived at the issues above.
In fact, the issue was only solved 5 hours ago, and the last comment in
the thread was from 22 minutes before I arrived. I felt quite some strong
adrenaline flowing through me when I realised how lucky I was today...)
  • Loading branch information
yutotakano committed Oct 10, 2022
1 parent f76cc44 commit d8e3766
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/build_cabal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
matrix:
os: ["ubuntu-20.04"]
ghc: ["8.10.7", "9.0.2", "9.2.4"]
ghc: ["8.10.7"]
include:
- os: ubuntu-18.04
ghc: "8.10.7"
Expand Down Expand Up @@ -85,15 +85,16 @@ jobs:
run: |
brew install libsodium opus
# Add PKG_CONFIG_PATH to GitHub Env: agda/agda#6163
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" >> ${GITHUB_ENV}
# Temporary until runner image is updated: actions/runner-images#6364
# or until cabal is updated: haskell/cabal#8496
# whichever is earlier
brew update && brew reinstall highway
- name: Update cabal database and set up build plan
run: |
cabal update
cabal configure
cabal build --dry-run
cabal build --dry-run -v
- name: Cache Cabal Dependencies
id: cache
Expand Down

0 comments on commit d8e3766

Please sign in to comment.