25
25
n : [1]
26
26
27
27
ghc : ["8.10.7"]
28
+ cabal : ["3.8.1.0"]
28
29
os : [ubuntu-latest, macos-latest, windows-latest]
29
30
30
31
env :
@@ -37,88 +38,23 @@ jobs:
37
38
# current ref from: 27.02.2022
38
39
SECP256K1_REF : ac83be33d0956faf6b7f61a60ab524ef7d6a473a
39
40
40
- # OpenSSL is installed in a non-standard location in MacOS. See
41
- # https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md
42
- PKG_CONFIG_PATH :
${{ (matrix.os == 'macos-latest' && '/usr/lib/pkgconfig:/usr/local/opt/[email protected] /lib/pkgconfig') || (matrix.os == 'ubuntu-latest' && '/usr/lib/pkgconfig:/usr/local/lib/pkgconfig') || '' }}
43
-
44
- # we need the LD_LIBRARY_PATH env var here because we ended up installing libsecp256k1 into /usr/local,
45
- # pkg-config, *does* return the proper location, but the library does not appear to be properly referenced.
46
- # FIXME: this is arguably a bug, and pkg-config should return the right values!
47
- LD_LIBRARY_PATH : ${{ (matrix.os != 'windows-latest' && '/usr/local/lib') || '' }}
48
-
49
41
steps :
50
- - name : " WIN: Install System Dependencies via pacman (msys2)"
51
- if : runner.os == 'Windows'
52
- run : |
53
- # ghcup should be installed on current GHA Windows runners. Let's use ghcup to run
54
- # pacman, to install the necessary dependencies, ...
55
- ghcup run -- pacman --noconfirm -S `
56
- mingw-w64-x86_64-pkg-config `
57
- mingw-w64-x86_64-libsodium `
58
- mingw-w64-x86_64-openssl `
59
- base-devel `
60
- autoconf-wrapper `
61
- autoconf `
62
- automake `
63
- libtool `
64
- make
65
-
66
- # this seems to break something. It _must_ come after the pacman setup
67
- # above. It appears as if PATHEXT is set _after_ ghcup install ghc/cabal, and
68
- # as such we'd need pacman.exe instead.
69
- - name : Setup Haskell
70
- run : |
71
- # Use GHCUP to manage ghc/cabal
72
- ghcup install ghc --set ${{ matrix.ghc }}
73
- ghcup install cabal --set 3.8.1.0
74
-
75
- ghc --version
76
- cabal --version
77
-
78
- - name : " WIN: fixup cabal config"
79
- if : runner.os == 'Windows'
80
- run : |
81
- # make sure cabal knows about msys64, and mingw64 tools. Not clear why C:/cabal/config is empty
82
- # and C:/cabal doesn't even exist. The ghcup bootstrap file should have create it in the image:
83
- # See https://github.com/haskell/ghcup-hs/blob/787edc17af4907dbc51c85e25c490edd8d68b80b/scripts/bootstrap/bootstrap-haskell#L591
84
- # So we'll do it by hand here for now.
85
- #
86
- # We'll _not_ add extra-include-dirs, or extra-lib-dirs, and rely on what's shipped with GHC.
87
- # https://github.com/msys2/MINGW-packages/issues/10837#issuecomment-1047105402
88
- # https://gitlab.haskell.org/ghc/ghc/-/issues/21111
89
- # if we _do_ want them, this would be the lines to add below
90
-
91
- $ghcMingwDir = Join-Path -Path $(ghc --print-libdir) `
92
- -ChildPath ../mingw/x86_64-*-mingw32/lib/ `
93
- -Resolve
94
-
95
- cabal user-config -a "extra-prog-path: C:/msys64/mingw64/bin, C:/msys64/usr/bin" `
96
- -a "extra-include-dirs: C:/msys64/mingw64/include" `
97
- -a ("extra-lib-dirs: {0}, C:/msys64/mingw64/lib" -f $ghcMingwDir) `
98
- -f init
99
-
100
- # Unify the computation of the cabal store directory to a single step. This makes referencing the cabal
101
- # store in later steps easier.
102
- #
103
- # We know on cabal store is located in the following locations by OS:
104
- #
105
- # Linux: /home/runner/.cabal/store
106
- # MacOS: /Users/runner/.cabal/store
107
- # Windows: C:\cabal\store
108
- #
109
- # However, we compute these as best be can from information cabal provides in case this changes in the future.
110
- - name : " Setup cabal-store"
111
- id : cabal-store
112
- shell : bash
113
- run : |
114
- cabal help user-config
115
- cabal_config_file="$(cabal help user-config | grep -A 1 'You can edit the cabal configuration file to set defaults' | tail -n 1 | xargs)"
116
-
117
- if [[ '${{ runner.os }}' != 'Windows' ]]; then
118
- echo "cabal-store=$(dirname "$cabal_config_file")/store" | tee -a "$GITHUB_OUTPUT"
119
- else
120
- echo "cabal-store=C:\\cabal\\store" | tee -a "$GITHUB_OUTPUT"
121
- fi
42
+ - name : Install Haskell
43
+ uses : input-output-hk/setup-haskell@v1
44
+ id : setup-haskell
45
+ with :
46
+ ghc-version : ${{ matrix.ghc }}
47
+ cabal-version : ${{ matrix.cabal }}
48
+ pacman-packages : >
49
+ mingw-w64-x86_64-pkg-config
50
+ mingw-w64-x86_64-libsodium
51
+ mingw-w64-x86_64-openssl
52
+ base-devel
53
+ autoconf-wrapper
54
+ autoconf
55
+ automake
56
+ libtool
57
+ make
122
58
123
59
- uses : actions/checkout@v2
124
60
@@ -197,7 +133,7 @@ jobs:
197
133
with :
198
134
region : ${{ secrets.BINARY_CACHE_REGION }}
199
135
dist-dir : dist-newstyle
200
- store-path : ${{ steps.cabal-store .outputs.cabal-store }}
136
+ store-path : ${{ steps.setup-haskell .outputs.cabal-store }}
201
137
threads : 16
202
138
archive-uri : ${{ secrets.BINARY_CACHE_URI }}/${{ env.CABAL_CACHE_VERSION }}/${{ runner.os }}
203
139
skip : " ${{ secrets.BINARY_CACHE_URI == '' }}"
@@ -215,7 +151,7 @@ jobs:
215
151
uses : action-works/cabal-cache-s3@v1
216
152
with :
217
153
dist-dir : dist-newstyle
218
- store-path : ${{ steps.cabal-store .outputs.cabal-store }}
154
+ store-path : ${{ steps.setup-haskell .outputs.cabal-store }}
219
155
threads : 16
220
156
archive-uri : https://iohk.cache.haskellworks.io/${{ env.CABAL_CACHE_VERSION }}/${{ runner.os }}
221
157
skip : " ${{ secrets.BINARY_CACHE_URI != '' }}"
0 commit comments