Skip to content

Commit 759e4f5

Browse files
authored
Merge pull request #2198 from tweag/automation/update-ghc-9.10
[update] GHC 9.10
2 parents 1cd404c + a6cf36f commit 759e4f5

File tree

8 files changed

+64
-10
lines changed

8 files changed

+64
-10
lines changed

Diff for: .github/workflows/patch-test.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ jobs:
7171
- name: Build & test
7272
shell: bash
7373
run: |
74-
export PATH=$HOME/bazel:$PATH
7574
export GHC_VERSION=${{ matrix.ghc-version }}
7675
cd rules_haskell_tests
7776
./tests/run-start-script.sh --use-bindists

Diff for: haskell/ghc_bindist.bzl

+2-2
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,9 @@ rm -f
226226
libdir = "lib"
227227
if GHC_BINDIST_LIBDIR.get(version) != None and GHC_BINDIST_LIBDIR[version].get(target) != None:
228228
libdir = GHC_BINDIST_LIBDIR[version][target]
229-
elif os == "darwin" and version_tuple >= (9, 0, 2):
229+
elif os == "darwin" and version_tuple >= (9, 0, 2) and version_tuple < (9, 10, 1):
230230
libdir = "lib/lib"
231-
elif os == "linux" and version_tuple >= (9, 4, 1):
231+
elif os == "linux" and version_tuple >= (9, 4, 1) and version_tuple < (9, 10, 1):
232232
libdir = "lib/lib"
233233

234234
docdir = "doc"

Diff for: haskell/private/ghc_bindist_generated.json

+22
Original file line numberDiff line numberDiff line change
@@ -444,5 +444,27 @@
444444
"https://downloads.haskell.org/~ghc/9.8.2/ghc-9.8.2-x86_64-unknown-mingw32.tar.xz",
445445
"f7d496b850686ea5fbfcecc722ec399ec7acb8d06ebec23bb4dcb9338f430764"
446446
]
447+
},
448+
"9.10.1": {
449+
"linux_amd64": [
450+
"https://downloads.haskell.org/~ghc/9.10.1/ghc-9.10.1-x86_64-deb9-linux.tar.xz",
451+
"5c4fb1c2185320afd6b1efaa155f97e956fa782004ce829fb41879ad0fd1cd14"
452+
],
453+
"linux_arm64": [
454+
"https://downloads.haskell.org/~ghc/9.10.1/ghc-9.10.1-aarch64-deb10-linux.tar.xz",
455+
"e6df50e62b696e3a8b759670fc79207ccc26e88a79a047561ca1ccb8846157dd"
456+
],
457+
"darwin_amd64": [
458+
"https://downloads.haskell.org/~ghc/9.10.1/ghc-9.10.1-x86_64-apple-darwin.tar.xz",
459+
"8cf22188930e10d7ac5270d425e21a3dab606af73a655493639345200c650be9"
460+
],
461+
"darwin_arm64": [
462+
"https://downloads.haskell.org/~ghc/9.10.1/ghc-9.10.1-aarch64-apple-darwin.tar.xz",
463+
"ffaf83b5d7a8b2c04920c6e3909c0be21dde27baf380d095fa27e840a3a2e804"
464+
],
465+
"windows_amd64": [
466+
"https://downloads.haskell.org/~ghc/9.10.1/ghc-9.10.1-x86_64-unknown-mingw32.tar.xz",
467+
"8bac01906ec2fa5c10c730b5ee5b8165654d654dbaf25ba9d3c42f8e26484c6a"
468+
]
447469
}
448470
}

Diff for: haskell/repl.bzl

+3-3
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,10 @@ def _haskell_repl_impl(ctx):
486486
is_executable = True,
487487
substitutions = {
488488
"%{ENV}": render_env(env),
489-
"%{TOOL}": hs.tools.ghci.path,
489+
"%{TOOL}": hs.tools.ghc.path,
490490
"%{OUTPUT}": paths.dirname(output.path),
491491
"%{ARGS}": "(" + " ".join(
492-
args + [
492+
["--interactive"] + args + [
493493
shell.quote(a)
494494
for a in quote_args
495495
],
@@ -500,7 +500,7 @@ def _haskell_repl_impl(ctx):
500500
runfiles = [
501501
ctx.runfiles(
502502
files = [
503-
hs.tools.ghci,
503+
hs.tools.ghc,
504504
ghci_repl_script,
505505
],
506506
transitive_files = inputs,

Diff for: haskell/toolchain.bzl

+14-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ load(
4141
"HaskellLibraryInfo",
4242
)
4343

44-
_GHC_BINARIES = ["ghc", "ghc-pkg", "hsc2hs", "haddock", "ghci", "runghc", "hpc"]
44+
_GHC_BINARIES = ["ghc", "ghc-pkg", "hsc2hs", "haddock", "runghc", "hpc"]
4545

4646
def _toolchain_library_symlink(dynamic_library):
4747
prefix = dynamic_library.owner.workspace_root.replace("_", "_U").replace("/", "_S")
@@ -331,7 +331,19 @@ def _haskell_toolchain_impl(ctx):
331331
for tool, asterius_binary in ahc_binaries.items():
332332
tools_struct_args[ASTERIUS_BINARIES[tool]] = asterius_binary
333333
else:
334-
ghc_binaries = _lookup_binaries(_GHC_BINARIES, ctx.files.tools, ctx.attr.version)
334+
ghc_tools = _GHC_BINARIES
335+
336+
# GHC > 9.10 does not install ghci with relocatable = true, add the tool if it is available
337+
if any([file.basename.startswith("ghci") for file in ctx.files.tools]):
338+
ghc_tools = ghc_tools + ["ghci"]
339+
else:
340+
print(
341+
"WARN: ghci binary is not available for {}, `tools.ghci` will not exist on its haskell toolchain".format(
342+
ctx.label.repo_name,
343+
),
344+
)
345+
346+
ghc_binaries = _lookup_binaries(ghc_tools, ctx.files.tools, ctx.attr.version)
335347
tools_struct_args = {
336348
name.replace("-", "_"): file
337349
for name, file in ghc_binaries.items()

Diff for: rules_haskell_tests/non_module_deps_2.bzl

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ def repositories(*, bzlmod): # @unused
3131
local_snapshot = "//:stackage_snapshot{}.yaml".format(
3232
"_" + str(GHC_VERSION) if GHC_VERSION else "",
3333
),
34+
# disable calling pkg-config
35+
flags = {"zlib": ["-pkg-config"]},
3436
packages = ["zlib"],
3537
stack_snapshot_json = ("//:stackage-zlib-snapshot{}.json".format(
3638
"_" + str(GHC_VERSION) if GHC_VERSION else "",

Diff for: rules_haskell_tests/tests/run-start-script.sh

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ rm -rf $workdir
1414
mkdir $workdir
1515
cd $workdir
1616
cp "$rules_haskell_dir/.bazelversion" .
17+
18+
# specify version for bazelisk via `USE_BAZEL_VERSION`, since it does not read the .bazelversion when there is no WORKSPACE file
19+
USE_BAZEL_VERSION=$( cat .bazelversion )
20+
export USE_BAZEL_VERSION
21+
1722
# arguments are passed on to the start script
1823
"$rules_haskell_dir/start" "$@"
1924

Diff for: start

+16-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ readonly MIN_BAZEL_MAJOR=6
1313
readonly MIN_BAZEL_MINOR=0
1414

1515
readonly MAX_BAZEL_MAJOR=6
16-
readonly MAX_BAZEL_MINOR=4
16+
readonly MAX_BAZEL_MINOR=5
1717

1818
stderr () {
1919
>&2 echo "$*"
@@ -201,7 +201,7 @@ case "${MODE}" in
201201
;;
202202
esac > "${ZLIB_BUILD_FILE}"
203203

204-
SNAPSHOT=lts-20.3
204+
WITH_HADDOCK=True
205205

206206
case "$GHC_VERSION" in
207207
8.10.*)
@@ -216,7 +216,17 @@ case "$GHC_VERSION" in
216216
9.4.*)
217217
SNAPSHOT=lts-21.5
218218
;;
219+
9.6.*)
220+
SNAPSHOT=lts-22.22
221+
;;
219222
*)
223+
# zlib >= 0.7.1.0 depends on zlib-clib on Windows (unless using pkg-config), since zlib-clib is
224+
# a C only cabal library that does not produce any haddock this results in an error.
225+
# See https://github.com/tweag/rules_haskell/issues/2200
226+
case "$( uname )" in
227+
WindowsNT | MINGW* | MSYS* ) WITH_HADDOCK=False ;;
228+
esac
229+
SNAPSHOT=nightly-2024-05-24
220230
stderr "warning: unsupported GHC version: ${GHC_VERSION}, using stack resolver ${SNAPSHOT}"
221231
esac
222232

@@ -269,6 +279,10 @@ stack_snapshot(
269279
extra_deps = {"zlib": ["@zlib.dev//:zlib"]},
270280
packages = ["zlib"],
271281
282+
# disable calling pkg-config
283+
flags = {"zlib": ["-pkg-config"]},
284+
haddock = $WITH_HADDOCK,
285+
272286
# LTS snapshot published for ghc-${GHC_VERSION} (default version used by rules_haskell)
273287
snapshot = "$SNAPSHOT",
274288

0 commit comments

Comments
 (0)