Skip to content

Commit 90fabf0

Browse files
authored
Merge pull request #415 from elopez/windows-9.4
Move Windows build to GHC 9.4
2 parents a82924f + 5661ee8 commit 90fabf0

File tree

3 files changed

+36
-22
lines changed

3 files changed

+36
-22
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ jobs:
6363
- uses: actions/checkout@v3
6464
- uses: msys2/setup-msys2@v2
6565
with:
66-
msystem: UCRT64
67-
path-type: inherit
66+
msystem: CLANG64
67+
path-type: minimal
6868
update: true
6969
install: >-
7070
base-devel
@@ -75,14 +75,23 @@ jobs:
7575
pacboy: >-
7676
cmake:p
7777
ninja:p
78-
gcc:p
78+
clang:p
79+
lld:p
7980
autotools:p
8081
gmp:p
8182
openssl:p
82-
- uses: haskell/actions/setup@v2
83+
- uses: haskell-actions/setup@v2
8384
id: setup
8485
with:
85-
ghc-version: '9.2.8'
86+
ghc-version: '9.4.7'
87+
88+
- name: Extract GHC & Cabal paths
89+
run: |
90+
HASKELL_PATHS="$(cygpath -u "$GHC_PATH"):$(cygpath -u "$CABAL_PATH")"
91+
echo "HASKELL_PATHS=$HASKELL_PATHS" >> "$GITHUB_ENV"
92+
env:
93+
GHC_PATH: ${{ steps.setup.outputs.ghc-path }}
94+
CABAL_PATH: ${{ steps.setup.outputs.cabal-path }}
8695

8796
- name: build and install c dependencies
8897
run: |
@@ -94,6 +103,7 @@ jobs:
94103
echo "::endgroup::"
95104
- name: Configure the build
96105
run: |
106+
export PATH="$HASKELL_PATHS:$PATH"
97107
cabal configure --disable-tests --disable-benchmarks --disable-documentation
98108
cabal build --dry-run
99109
# The last step generates dist-newstyle/cache/plan.json for the cache key.
@@ -109,7 +119,9 @@ jobs:
109119
restore-keys: ${{ env.key }}-
110120

111121
- name: Install haskell dependencies
112-
run: cabal build all --only-dependencies
122+
run: |
123+
export PATH="$HASKELL_PATHS:$PATH"
124+
cabal build all --only-dependencies
113125
114126
# Cache dependencies already, so that we do not have to rebuild them should the subsequent steps fail.
115127
- name: Save cached dependencies
@@ -122,7 +134,9 @@ jobs:
122134

123135
- name: build hevm library
124136
run: |
125-
cabal build --extra-include-dirs="$HOME/.local/include" --extra-lib-dirs="$HOME/.local/lib"
137+
export PATH="$HASKELL_PATHS:$PATH"
138+
cabal build --extra-include-dirs="$HOME/.local/include" --extra-lib-dirs="$HOME/.local/lib" \
139+
--extra-include-dirs="D:/a/_temp/msys64/clang64/include" --extra-lib-dirs="D:/a/_temp/msys64/clang64/lib"
126140
127141
cabal-check:
128142
runs-on: ubuntu-latest

flake.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@
134134
grep = "${pkgs.gnugrep}/bin/grep";
135135
otool = "${pkgs.darwin.binutils.bintools}/bin/otool";
136136
install_name_tool = "${pkgs.darwin.binutils.bintools}/bin/install_name_tool";
137+
codesign_allocate = "${pkgs.darwin.binutils.bintools}/bin/codesign_allocate";
138+
codesign = "${pkgs.darwin.sigtool}/bin/codesign";
137139
in if pkgs.stdenv.isLinux
138140
then pkgs.haskell.lib.dontCheck hevmUnwrapped
139141
else pkgs.runCommand "stripNixRefs" {} ''
@@ -151,6 +153,7 @@
151153
chmod 777 $out/bin/hevm
152154
${install_name_tool} -change "$cxx" /usr/lib/libc++.1.dylib $out/bin/hevm
153155
${install_name_tool} -change "$iconv" /usr/lib/libiconv.dylib $out/bin/hevm
156+
CODESIGN_ALLOCATE=${codesign_allocate} ${codesign} -f -s - $out/bin/hevm
154157
chmod 555 $out/bin/hevm
155158
'';
156159

hevm.cabal

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ common shared
5858
-Wno-unticked-promoted-constructors
5959
-Wno-orphans
6060
-Wno-ambiguous-fields
61+
-optc-Wno-ignored-attributes
6162
default-language: GHC2021
6263
default-extensions:
6364
DuplicateRecordFields
@@ -103,8 +104,17 @@ library
103104
Paths_hevm
104105
autogen-modules:
105106
Paths_hevm
106-
if os(linux) || os(windows)
107+
if impl(ghc >= 9.4) && !os(darwin)
108+
-- darwin is skipped because it produces this error when building
109+
-- > ghc: loadArchive: Neither an archive, nor a fat archive: `/nix/store/l3lkdfm7sg1wwc850451cikqds766h15-clang-wrapper-11.1.0/bin/clang++'
110+
build-depends: system-cxx-std-lib
111+
elif !os(darwin)
107112
extra-libraries: stdc++
113+
else
114+
-- extra-libraries: c++
115+
-- https://gitlab.haskell.org/ghc/ghc/-/issues/11829
116+
ld-options: -Wl,-keep_dwarf_unwind
117+
ghc-options: -fcompact-unwind
108118
extra-libraries:
109119
secp256k1, ff, gmp
110120
c-sources:
@@ -187,10 +197,6 @@ executable hevm
187197
Paths_hevm
188198
if os(darwin)
189199
extra-libraries: c++
190-
ld-options: -Wl,-keep_dwarf_unwind
191-
ghc-options: -fcompact-unwind
192-
else
193-
extra-libraries: stdc++
194200
build-depends:
195201
QuickCheck,
196202
aeson,
@@ -234,8 +240,6 @@ common test-base
234240
import: shared
235241
hs-source-dirs:
236242
test
237-
extra-libraries:
238-
secp256k1
239243
other-modules:
240244
Paths_hevm
241245
autogen-modules:
@@ -304,11 +308,6 @@ common test-common
304308
buildable: False
305309
if os(darwin)
306310
extra-libraries: c++
307-
-- https://gitlab.haskell.org/ghc/ghc/-/issues/11829
308-
ld-options: -Wl,-keep_dwarf_unwind
309-
ghc-options: -fcompact-unwind
310-
else
311-
extra-libraries: stdc++
312311

313312
--- Test Suites ---
314313

@@ -351,9 +350,7 @@ benchmark bench
351350
ghc-options:
352351
-O2
353352
if os(darwin)
354-
extra-libraries: c++
355-
else
356-
extra-libraries: stdc++
353+
extra-libraries: c++
357354
other-modules:
358355
Paths_hevm
359356
autogen-modules:

0 commit comments

Comments
 (0)