Skip to content

Commit ce7957d

Browse files
authored
Merge pull request #1994 from tweag/upgrade-ghc-9.2.8
Upgrade default GHC to 9.2.8
2 parents b6486c9 + 02802b9 commit ce7957d

40 files changed

+218
-250
lines changed

.github/workflows/workflow.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
module: [rules_haskell, rules_haskell_nix, rules_haskell_tests]
2323
bzlmod: [true, false]
2424
ghc:
25-
- 9.2.5
25+
- 9.2.8
2626
- 9.4.5
2727
exclude:
2828
- module: rules_haskell_nix
@@ -122,7 +122,7 @@ jobs:
122122
module: [rules_haskell, rules_haskell_tests]
123123
bzlmod: [true, false]
124124
ghc:
125-
- 9.2.5
125+
- 9.2.8
126126
- 9.4.5
127127
exclude:
128128
# TODO: in a MODULE.bazel file we declare version specific dependencies, would need to use stack snapshot json

WORKSPACE

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ load("@rules_haskell//haskell:cabal.bzl", "stack_snapshot")
149149
stack_snapshot(
150150
name = "stackage",
151151
components = {
152+
"c2hs": ["exe"],
152153
"proto-lens-protoc": [
153154
"lib",
154155
"exe",
@@ -158,6 +159,7 @@ stack_snapshot(
158159
"_" + str(GHC_VERSION) if GHC_VERSION else "",
159160
),
160161
packages = [
162+
"Cabal",
161163
# Core libraries
162164
"base",
163165
"bytestring",
@@ -167,6 +169,9 @@ stack_snapshot(
167169
"text",
168170
"vector",
169171
# For tests
172+
"alex",
173+
"c2hs",
174+
"happy",
170175
"lens-family-core",
171176
"data-default-class",
172177
"proto-lens",
@@ -188,6 +193,9 @@ stack_snapshot(
188193
"type-errors": ["@Cabal//:Cabal"],
189194
"typed-process": ["@Cabal//:Cabal"],
190195
"unliftio-core": ["@Cabal//:Cabal"],
196+
"alex": ["@Cabal//:Cabal"],
197+
"c2hs": ["@Cabal//:Cabal"],
198+
"happy": ["@Cabal//:Cabal"],
191199
},
192200
stack_snapshot_json = "//:stackage_snapshot{}.json".format(
193201
"_" + str(GHC_VERSION) if GHC_VERSION else "",

constants.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
test_ghc_version = "9.2.5"
1+
test_ghc_version = "9.2.8"
22
test_asterius_version = "0.0.1"

examples/MODULE.bazel

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ stack_snapshot.package(
6666
"-pkg-config",
6767
],
6868
)
69+
stack_snapshot.package(
70+
name = "streaming-commons",
71+
extra_deps = ["@zlib.hs"],
72+
setup_deps = ["@Cabal//:Cabal"],
73+
)
6974

7075
[
7176
stack_snapshot.package(

examples/WORKSPACE

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ rules_haskell_dependencies()
1818
load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs")
1919

2020
haskell_register_ghc_nixpkgs(
21-
attribute_path = "haskell.compiler.ghc925",
21+
attribute_path = "haskell.compiler.ghc928",
2222
repository = "@rules_haskell//nixpkgs:default.nix",
23-
version = "9.2.5",
23+
version = "9.2.8",
2424
)
2525

2626
load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains")
2727

28-
rules_haskell_toolchains(version = "9.2.5")
28+
rules_haskell_toolchains(version = "9.2.8")
2929

3030
load("@rules_nixpkgs_cc//:cc.bzl", "nixpkgs_cc_configure")
3131
load("@rules_nixpkgs_python//:python.bzl", "nixpkgs_python_configure")
@@ -57,7 +57,10 @@ stack_snapshot(
5757
components_dependencies = {
5858
"attoparsec": """{"lib:attoparsec": ["lib:attoparsec-internal"]}""",
5959
},
60-
extra_deps = {"zlib": ["@zlib.hs"]},
60+
extra_deps = {
61+
"zlib": ["@zlib.hs"],
62+
"streaming-commons": ["@zlib.hs"],
63+
},
6164
flags = {
6265
# Sets the default explicitly to demonstrate the flags attribute.
6366
"zlib": [

haskell/cabal.bzl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2283,10 +2283,11 @@ load("@{workspace}//:packages.bzl", "packages")
22832283
def _stack_executables_impl(repository_ctx):
22842284
workspace = repository_ctx.attr.unmangled_repo_name
22852285
all_components = json.decode(repository_ctx.read(repository_ctx.attr.components_json))
2286-
for (package, components) in all_components.items():
2287-
if not components["exe"]:
2288-
continue
2289-
repository_ctx.file(package + "/BUILD.bazel", executable = False, content = """\
2286+
executables = [package for package, components in all_components.items() if components["exe"]]
2287+
2288+
if executables:
2289+
for package in executables:
2290+
repository_ctx.file(package + "/BUILD.bazel", executable = False, content = """\
22902291
load("@{workspace}//:packages.bzl", "packages")
22912292
[
22922293
alias(
@@ -2297,9 +2298,12 @@ load("@{workspace}//:packages.bzl", "packages")
22972298
for exe in packages["{package}"].executables
22982299
]
22992300
""".format(
2300-
workspace = workspace,
2301-
package = package,
2302-
))
2301+
workspace = workspace,
2302+
package = package,
2303+
))
2304+
else:
2305+
# a repository rule has to create a file
2306+
repository_ctx.file("BUILD", executable = False)
23032307

23042308
_stack_executables = repository_rule(
23052309
_stack_executables_impl,

haskell/ghc.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# (see stackage.org).
33

44
# Currently, we are using GHC 9.2.x as default.
5-
DEFAULT_GHC_VERSION = "9.2.5"
5+
DEFAULT_GHC_VERSION = "9.2.8"

nixpkgs/default.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{ ... }@args:
22
let
3-
# 2023-05-22
4-
sha256 = "1lbr19fbh16n5ikgh9lzpscn83kr3w6hwx6md4k1iyxd7vx7zz0j";
5-
rev = "02df300699f8e4c24b39eeb7e034403880715dc5";
3+
# 2023-10-20
4+
sha256 = "07dv5x236rqf5b718b7bhpqf2yaq43h6w8mrz9fcb0hxwjzsxlpg";
5+
rev = "80c1aab725151632ddc2a20caeb914e76dd0673c";
66
in
77
import (fetchTarball {
88
inherit sha256;

rules_haskell_nix/MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ nix_haskell_toolchains = use_extension(
4242
# Declare a default nix-based toolchain
4343
nix_haskell_toolchains.new(
4444
attribute_path = "",
45-
nix_file_content = """with import <nixpkgs> {}; haskell.packages.ghc925.ghc""",
45+
nix_file_content = """with import <nixpkgs> {}; haskell.packages.ghc928.ghc""",
4646
repository = "@nixpkgs_default",
47-
version = "9.2.5",
47+
version = "9.2.8",
4848
)
4949
use_repo(
5050
nix_haskell_toolchains,

rules_haskell_tests/MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ haskell_toolchains = use_extension(
257257
"haskell_toolchains",
258258
)
259259

260-
test_ghc_version = "9.2.5"
260+
test_ghc_version = "9.2.8"
261261

262262
test_ghcopts = [
263263
"-XStandaloneDeriving", # Flag used at compile time
@@ -328,7 +328,7 @@ nix_haskell_toolchains.new(
328328
cabalopts = test_cabalopts,
329329
ghcopts = test_ghcopts,
330330
haddock_flags = test_haddock_flags,
331-
nix_file_content = """with import <nixpkgs> {}; haskell.packages.ghc925.ghc""",
331+
nix_file_content = """with import <nixpkgs> {}; haskell.packages.ghc928.ghc""",
332332
repl_ghci_args = test_repl_ghci_args,
333333
repository = "@nixpkgs_default",
334334
version = test_ghc_version,

0 commit comments

Comments
 (0)