Skip to content

Commit 0ab0ad7

Browse files
committed
ci: compute path by referencing MSYS2 action, extract into variable
1 parent 57c0a8a commit 0ab0ad7

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/scripts/windows-ghc-toolchain.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ set(CMAKE_SYSTEM_NAME Windows)
33
set(CMAKE_C_COMPILER "$ENV{HASKELL_MINGW_PATH}/bin/cc.exe")
44
set(CMAKE_CXX_COMPILER "$ENV{HASKELL_MINGW_PATH}/bin/c++.exe")
55

6-
set(CMAKE_C_FLAGS "-idirafter D:/a/_temp/msys64/clang64/include")
7-
set(CMAKE_CXX_FLAGS "-idirafter D:/a/_temp/msys64/clang64/include")
6+
set(CMAKE_C_FLAGS "-idirafter $ENV{SYSTEM_MINGW_PATH}/include")
7+
set(CMAKE_CXX_FLAGS "-idirafter $ENV{SYSTEM_MINGW_PATH}/include")
88

99
set(CMAKE_FIND_ROOT_PATH "$ENV{HASKELL_MINGW_PATH}")
1010
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)

.github/workflows/build.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ jobs:
111111
echo FOUNDRY_PATH="$(dirname "$(which forge)")" >> "$GITHUB_ENV"
112112
shell: bash
113113
- uses: msys2/setup-msys2@v2
114+
id: msys2
114115
with:
115116
msystem: CLANG64
116117
path-type: minimal
@@ -143,9 +144,11 @@ jobs:
143144
HASKELL_MINGW_PATH="$(cygpath -u "$GHC_PATH/../mingw")"
144145
echo "HASKELL_PATHS=$HASKELL_PATHS" >> "$GITHUB_ENV"
145146
echo "HASKELL_MINGW_PATH=$HASKELL_MINGW_PATH" >> "$GITHUB_ENV"
147+
echo "SYSTEM_MINGW_PATH="$(cygpath -m "$MSYS2_LOCATION/$MSYSTEM")" >> "$GITHUB_ENV"
146148
env:
147149
GHC_PATH: ${{ steps.setup.outputs.ghc-path }}
148150
CABAL_PATH: ${{ steps.setup.outputs.cabal-path }}
151+
MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }}
149152

150153
- name: build and install c dependencies
151154
run: |
@@ -162,9 +165,9 @@ jobs:
162165
cabal configure --disable-documentation --enable-executable-static --enable-executable-stripping \
163166
--extra-lib-dirs="$(cygpath -m "$HASKELL_MINGW_PATH/x86_64-w64-mingw32/lib")" \
164167
--extra-lib-dirs="$(cygpath -m "$HASKELL_MINGW_PATH/lib")" \
165-
--extra-lib-dirs="D:/a/_temp/msys64/clang64/lib" \
168+
--extra-lib-dirs="$SYSTEM_MINGW_PATH/lib" \
166169
--extra-include-dirs="$HOME/.local/include" --extra-lib-dirs="$HOME/.local/lib" \
167-
--ghc-options=-pgml="$(cygpath -m "$HASKELL_MINGW_PATH/bin/clang.exe") -optc-idirafter -optcD:/a/_temp/msys64/clang64/include -optcxx-idirafter -optcxxD:/a/_temp/msys64/clang64/include" -fstatic-secp256k1 --constraint="zlib +bundled-c-zlib"
170+
--ghc-options=-pgml="$(cygpath -m "$HASKELL_MINGW_PATH/bin/clang.exe") -optc-idirafter -optc$SYSTEM_MINGW_PATH/include -optcxx-idirafter -optcxx$SYSTEM_MINGW_PATH/include" -fstatic-secp256k1 --constraint="zlib +bundled-c-zlib"
168171
cabal build --dry-run
169172
# The last step generates dist-newstyle/cache/plan.json for the cache key.
170173

0 commit comments

Comments
 (0)