Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: windows: use builtin GHC clang toolchain to build dependencies #1333

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/scripts/install-libff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ fi
if [ "$HOST_OS" = "Windows" ]; then
ARGS+=("-G" "Ninja")
sed -i 's/find_library(GMP_LIBRARY gmp)/find_library(GMP_LIBRARY NAMES libgmp.a)/' CMakeLists.txt

# Apply windows-specific libff patch carried by hevm
curl -fsSL https://raw.githubusercontent.com/ethereum/hevm/1abe4c79eeada928acc279b631c48eeb2a1376c2/.github/scripts/libff.patch | patch -p1
fi

mkdir -p build
Expand Down
24 changes: 18 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
# Tag for cache invalidation
CACHE_VERSION: v7
CACHE_VERSION: v9

jobs:
build:
Expand Down Expand Up @@ -71,18 +71,27 @@ jobs:
- name: Configure Stack environment
run: |
HOME="${{ (runner.os == 'Windows' && '$(cygpath -m ~)') || '$HOME' }}"
GHC_MINGW_PATH="${{ (runner.os == 'Windows' && '$(cygpath -m "$GHC_BIN_PATH/../mingw")') || '' }}"
mkdir -p "$STACK_ROOT"
{ echo "extra-include-dirs:";
if [ ! "$GHC_MINGW_PATH" = "" ]; then
echo "- $GHC_MINGW_PATH/x86_64-w64-mingw32/include";
echo "- $GHC_MINGW_PATH/include";
echo "- D:/a/_temp/msys64/clang64/include";
fi;
echo "- $HOME/.local/include";
echo "$EXTRA_INCLUDE_WIN";
echo;
echo "extra-lib-dirs:";
if [ ! "$GHC_MINGW_PATH" = "" ]; then
echo "- $GHC_MINGW_PATH/x86_64-w64-mingw32/lib";
echo "- $GHC_MINGW_PATH/lib";
echo "- D:/a/_temp/msys64/clang64/lib";
fi;
echo "- $HOME/.local/lib";
echo "$EXTRA_LIB_WIN";
echo;
echo "ghc-options:";
echo ' "$locals": -Werror'
"$REPLACE_LINKER_WIN" && echo ' "$everything": -pgml=D:/a/_temp/msys64/clang64/bin/clang.exe -pgml-supports-no-pie';
"$REPLACE_LINKER_WIN" && echo ' "$everything": -pgml='$(cygpath -m "$GHC_MINGW_PATH/bin/clang.exe");
echo;
"$SKIP_MSYS" && echo "skip-msys: true" || true
echo "system-ghc: true";
Expand All @@ -92,10 +101,9 @@ jobs:
cat "$STACK_ROOT/config.yaml"
env:
STACK_ROOT: ${{ steps.stack.outputs.stack-root || '/etc/stack' }}
EXTRA_INCLUDE_WIN: ${{ (runner.os == 'Windows' && '- D:/a/_temp/msys64/clang64/include') || '' }}
EXTRA_LIB_WIN: ${{ (runner.os == 'Windows' && '- D:/a/_temp/msys64/clang64/lib') || '' }}
REPLACE_LINKER_WIN: ${{ (runner.os == 'Windows' && 'true') || 'false' }}
SKIP_MSYS: ${{ (runner.os == 'Windows' && 'true') || 'false' }}
GHC_BIN_PATH: ${{ steps.stack.outputs.ghc-path }}

- name: Configure Haskell paths (Windows)
if: runner.os == 'Windows'
Expand Down Expand Up @@ -136,10 +144,14 @@ jobs:

- name: Build Libraries
run: |
if [ "$HOST_OS" = "Windows" ]; then
export PATH="$(cygpath -u "$GHC_BIN_PATH/../mingw/bin"):$PATH"
fi
.github/scripts/install-libsecp256k1.sh
.github/scripts/install-libff.sh
env:
HOST_OS: ${{ runner.os }}
GHC_BIN_PATH: ${{ steps.stack.outputs.ghc-path }}

- name: Build Dependencies
run: |
Expand Down
Loading