Skip to content

Commit

Permalink
Fix recent GHA images issues
Browse files Browse the repository at this point in the history
- OpenSSL@3.3.0 is broken in Windows. Downgraded to openssl 3.2.1. See openssl/openssl#24298.
- OpenSSL@3.3.0 is broken in macOS. Downgrading to openssl 3.0.1.
- GHCup was removed from macOS. Now this action installs it if missing in all OSes.
  • Loading branch information
jasagredo committed Apr 29, 2024
1 parent 7016005 commit d852be8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
9 changes: 6 additions & 3 deletions base/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ runs:
if: runner.os == 'macOS'
shell: bash
run: |
brew install pkg-config
brew install pkg-config openssl@3.0
mkdir __prep__
pushd __prep__
Expand All @@ -35,7 +35,7 @@ runs:
shell: bash
run: |
echo "LD_LIBRARY_PATH=/usr/local/lib" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=/usr/local/opt/cardano/lib/pkgconfig:/usr/local/opt/openssl@1.1/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:$PKG_CONFIG_PATH" \
echo "PKG_CONFIG_PATH=/opt/homebrew/opt/openssl@3.0/lib/pkgconfig:/usr/local/opt/cardano/lib/pkgconfig:/usr/local/opt/openssl@1.1/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:$PKG_CONFIG_PATH" \
>> $GITHUB_ENV
# There are three pkg-config packages available for mingw, and each one has their problems:
Expand All @@ -60,7 +60,8 @@ runs:
mv /c/Strawberry/perl/bin/pkg-config /c/Strawberry/perl/bin/perl-pkg-config
mv /c/Strawberry/perl/bin/pkg-config.bat /c/Strawberry/perl/bin/perl-pkg-config.bat
/usr/bin/pacman --noconfirm -S mingw-w64-x86_64-pkg-config mingw-w64-x86_64-openssl
/usr/bin/pacman --noconfirm -S mingw-w64-x86_64-pkg-config
echo "PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1" >> $GITHUB_ENV
echo "PKG_CONFIG_ALLOW_SYSTEM_LIBS=1" >> $GITHUB_ENV
Expand All @@ -69,6 +70,8 @@ runs:
curl -sL ${{ inputs.url-prefix }}/msys2.${{ inputs.use-sodium-vrf == 'true' && 'libsodium-vrf' || 'libsodium' }}.pkg.tar.zstd > libsodium.pkg.tar.zstd
curl -sL ${{ inputs.url-prefix }}/msys2.libsecp256k1.pkg.tar.zstd > libsecp256k1.pkg.tar.zstd
curl -sL ${{ inputs.url-prefix }}/msys2.libblst.pkg.tar.zstd > libblst.pkg.tar.zstd
# OpenSSL .pc files are wrong in openssl-3.3.0 https://github.com/openssl/openssl/issues/24298
curl -sL https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-openssl-3.2.1-1-any.pkg.tar.zst > openssl.pkg.tar.zstd
for pkg in *.zstd; do
/usr/bin/pacman --noconfirm -U $pkg
done
Expand Down
35 changes: 35 additions & 0 deletions haskell/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,41 @@ outputs:
runs:
using: "composite"
steps:
- name: Install GHCup (Linux & MacOS)
if: runner.os != 'Windows'
shell: bash
run: |
if ! type ghcup &>/dev/null; then
export BOOTSTRAP_HASKELL_NONINTERACTIVE=1
export BOOTSTRAP_HASKELL_MINIMAL=1
export GHCUP_INSTALL_BASE_PREFIX=$HOME
ghcup_bin=$GHCUP_INSTALL_BASE_PREFIX/.ghcup/bin
# Install GHCup
curl --proto '=https' --tlsv1.2 -fsSL https://get-ghcup.haskell.org | sh > /dev/null 2>&1
echo "PATH=$ghcup_bin:$PATH" >> $GITHUB_ENV
fi
- name: Install GHCup (Windows)
if: runner.os == 'Windows'
shell: 'C:/msys64/usr/bin/bash.exe -e {0}'
run: |
if ! type ghcup &>/dev/null; then
export BOOTSTRAP_HASKELL_NONINTERACTIVE=1
export BOOTSTRAP_HASKELL_MINIMAL=1
export GHCUP_INSTALL_BASE_PREFIX="/c/"
ghcup_bin=$GHCUP_INSTALL_BASE_PREFIX/ghcup/bin
# Install GHCup
curl --proto '=https' --tlsv1.2 -fsSL https://get-ghcup.haskell.org | sh > /dev/null 2>&1
fi
- name: Extend PATH (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
"PATH=C:\\ghcup\\bin;C:\\cabal\\bin;{0}" -f $env:PATH >> $env:GITHUB_ENV
- name: Setup GHC
if: inputs.ghc-version != ''
shell: bash
Expand Down

0 comments on commit d852be8

Please sign in to comment.