@@ -20,13 +20,17 @@ jobs:
20
20
matrix :
21
21
os : [ubuntu-latest, macos-11]
22
22
module : [rules_haskell, rules_haskell_nix, rules_haskell_tests]
23
- bzlmod : [bzlmod, workspace ]
23
+ bzlmod : [true, false ]
24
24
ghc :
25
25
- 9.2.5
26
26
- 9.4.5
27
27
exclude :
28
28
- module : rules_haskell_nix
29
- bzlmod : workspace
29
+ bzlmod : false
30
+ # TODO: in a MODULE.bazel file we declare version specific dependencies, would need to use stack snapshot json
31
+ # and stack config per GHC version
32
+ - ghc : 9.4.5
33
+ bzlmod : true
30
34
runs-on : ${{ matrix.os }}
31
35
steps :
32
36
- if : ${{ matrix.os == 'ubuntu-latest' }}
@@ -62,16 +66,11 @@ jobs:
62
66
else
63
67
cache_setting="--remote_header=x-buildbuddy-api-key=$BUILDBUDDY_API_KEY"
64
68
fi
65
- if [ ${{ matrix.bzlmod }} == bzlmod ]; then
66
- bzlmod_setting='common --config bzlmod'
67
- else
68
- bzlmod_setting=''
69
- fi
70
69
cat >.bazelrc.local <<EOF
71
70
common --config=ci
72
71
build --config=$BUILD_CONFIG
73
72
build $cache_setting
74
- $bzlmod_setting
73
+ common --enable_bzlmod=${{ matrix.bzlmod }}
75
74
EOF
76
75
cp .bazelrc.local rules_haskell_nix
77
76
cp .bazelrc.local rules_haskell_tests
@@ -121,10 +120,15 @@ jobs:
121
120
matrix :
122
121
os : [ubuntu-latest, macos-11, windows-latest]
123
122
module : [rules_haskell, rules_haskell_tests]
124
- bzlmod : [bzlmod, workspace ]
123
+ bzlmod : [true, false ]
125
124
ghc :
126
125
- 9.2.5
127
126
- 9.4.5
127
+ exclude :
128
+ # TODO: in a MODULE.bazel file we declare version specific dependencies, would need to use stack snapshot json
129
+ # and stack config per GHC version
130
+ - ghc : 9.4.5
131
+ bzlmod : true
128
132
env :
129
133
GHC_VERSION : ${{ matrix.ghc }}
130
134
runs-on : ${{ matrix.os }}
@@ -168,16 +172,15 @@ jobs:
168
172
else
169
173
cache_setting="--remote_header=x-buildbuddy-api-key=$BUILDBUDDY_API_KEY"
170
174
fi
171
- if [ ${{ matrix.bzlmod }} == bzlmod]; then
172
- bzlmod_setting='common --config bzlmod'
173
- else
174
- bzlmod_setting=''
175
- fi
176
175
if [[ ${{ runner.os }} == Windows ]]; then
177
176
output_root_setting="startup --output_user_root=C:/_bzl"
178
177
# On windows, we use a separate remote cache for bzlmod,
179
178
# because the c dependency analysis is leaking absolute paths which are different
180
- bzlmod_cache_silo_key="build --remote_default_exec_properties=bzlmod-cache-silo-key=${{ matrix.bzlmod }}"
179
+ if ${{ matrix.bzlmod }}; then
180
+ bzlmod_cache_silo_key='build --remote_default_exec_properties=bzlmod-cache-silo-key=bzlmod'
181
+ else
182
+ bzlmod_cache_silo_key='build --remote_default_exec_properties=bzlmod-cache-silo-key=workspace'
183
+ fi
181
184
else
182
185
output_root_setting=""
183
186
bzlmod_cache_silo_key=""
@@ -188,7 +191,7 @@ jobs:
188
191
build $cache_setting
189
192
$output_root_setting
190
193
$bzlmod_cache_silo_key
191
- $bzlmod_setting
194
+ common --enable_bzlmod=${{ matrix.bzlmod }}
192
195
EOF
193
196
cp .bazelrc.local rules_haskell_tests
194
197
cat >~/.netrc <<EOF
@@ -201,6 +204,8 @@ jobs:
201
204
run : |
202
205
[[ ${{ runner.os }} == macOS ]] && export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1
203
206
if [[ ${{ runner.os }} == Windows ]]; then
207
+ # prevent auto-detection of system compilers
208
+ export BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
204
209
# On Windows `//...` expands to `/...`.
205
210
bazel test ///...
206
211
else
@@ -215,6 +220,8 @@ jobs:
215
220
[[ ${{ runner.os }} == macOS ]] && export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1
216
221
./tests/run-start-script.sh --use-bindists
217
222
if [[ ${{ runner.os }} == Windows ]]; then
223
+ # prevent auto-detection of system compilers
224
+ export BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
218
225
# On Windows `//...` expands to `/...`.
219
226
bazel test ///...
220
227
else
0 commit comments