Skip to content

Commit 28ead19

Browse files
committed
Fix nixpkgs GHC version
1 parent 11c58c6 commit 28ead19

File tree

9 files changed

+41
-24
lines changed

9 files changed

+41
-24
lines changed

examples/WORKSPACE

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ rules_haskell_dependencies()
1616

1717
load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs")
1818

19+
GHC_VERSION = "9.4.8"
20+
1921
haskell_register_ghc_nixpkgs(
20-
attribute_path = "haskell.compiler.ghc946",
22+
attribute_path = "haskell.compiler.ghc{}".format(GHC_VERSION.replace(".", "")),
2123
repository = "@rules_haskell//nixpkgs:default.nix",
22-
version = "9.4.8",
24+
version = GHC_VERSION,
2325
)
2426

2527
load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains")
2628

27-
rules_haskell_toolchains(version = "9.4.8")
29+
rules_haskell_toolchains(version = GHC_VERSION)
2830

2931
load("@rules_nixpkgs_cc//:cc.bzl", "nixpkgs_cc_configure")
3032
load("@rules_nixpkgs_python//:python.bzl", "nixpkgs_python_configure")

rules_haskell_nix/MODULE.bazel

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,14 @@ nix_haskell_toolchains = use_extension(
3939
"nix_haskell_toolchains",
4040
)
4141

42+
GHC_VERSION = "9.4.8"
43+
4244
# Declare a default nix-based toolchain
4345
nix_haskell_toolchains.new(
4446
attribute_path = "",
45-
nix_file_content = """with import <nixpkgs> {}; haskell.packages.ghc946.ghc""",
47+
nix_file_content = "with import <nixpkgs> {{}}; haskell.packages.ghc{}.ghc".format(GHC_VERSION.replace(".", "")),
4648
repository = "@nixpkgs_default",
47-
version = "9.4.8",
49+
version = GHC_VERSION,
4850
)
4951
use_repo(
5052
nix_haskell_toolchains,

rules_haskell_tests/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.ghc946.ghc""",
331+
nix_file_content = "with import <nixpkgs> {{}}; haskell.packages.ghc{}.ghc".format(test_ghc_version.replace(".", "")),
332332
repl_ghci_args = test_repl_ghci_args,
333333
repository = "@nixpkgs_default",
334334
version = test_ghc_version,

rules_haskell_tests/tests/haskell_module/repl/haskell_module_repl_cross_library_deps_test/WORKSPACE

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ rules_haskell_dependencies()
1414

1515
load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs")
1616

17+
GHC_VERSION = "9.4.8"
18+
1719
haskell_register_ghc_nixpkgs(
18-
attribute_path = "haskell.compiler.ghc946",
20+
attribute_path = "haskell.compiler.ghc{}".format(GHC_VERSION.replace(".", "")),
1921
repository = "@rules_haskell//nixpkgs:default.nix",
20-
version = "9.4.8",
22+
version = GHC_VERSION,
2123
)
2224

2325
load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains")
2426

25-
rules_haskell_toolchains(version = "9.4.8")
27+
rules_haskell_toolchains(version = GHC_VERSION)
2628

2729
load("@rules_nixpkgs_cc//:cc.bzl", "nixpkgs_cc_configure")
2830
load(

rules_haskell_tests/tests/haskell_module/repl/haskell_module_repl_test/WORKSPACE

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@ rules_haskell_dependencies()
1414

1515
load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs")
1616

17+
18+
GHC_VERSION = "9.4.8"
19+
1720
haskell_register_ghc_nixpkgs(
18-
attribute_path = "haskell.compiler.ghc946",
21+
attribute_path = "haskell.compiler.ghc{}".format(GHC_VERSION.replace(".", "")),
1922
repository = "@rules_haskell//nixpkgs:default.nix",
20-
version = "9.4.8",
23+
version = GHC_VERSION,
2124
)
2225

2326
load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains")
2427

25-
rules_haskell_toolchains(version = "9.4.8")
28+
rules_haskell_toolchains(version = GHC_VERSION)
2629

2730
load(
2831
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",

rules_haskell_tests/tests/repl-targets/hs_bin_repl_test/WORKSPACE

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@ rules_haskell_dependencies()
99

1010
load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs")
1111

12+
GHC_VERSION = "9.4.8"
13+
1214
haskell_register_ghc_nixpkgs(
13-
attribute_path = "haskell.compiler.ghc946",
15+
attribute_path = "haskell.compiler.ghc{}".format(GHC_VERSION.replace(".", "")),
1416
repository = "@rules_haskell//nixpkgs:default.nix",
15-
version = "9.4.8",
17+
version = GHC_VERSION,
1618
)
1719

1820
load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains")
1921

20-
rules_haskell_toolchains(version = "9.4.8")
22+
rules_haskell_toolchains(version = GHC_VERSION)
2123

2224
load(
2325
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",

rules_haskell_tests/tests/repl-targets/hs_lib_repl_test/WORKSPACE

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ rules_haskell_dependencies()
1616

1717
load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs")
1818

19+
GHC_VERSION = "9.4.8"
20+
1921
haskell_register_ghc_nixpkgs(
20-
attribute_path = "haskell.compiler.ghc946",
22+
attribute_path = "haskell.compiler.ghc{}".format(GHC_VERSION.replace(".", "")),
2123
repository = "@rules_haskell//nixpkgs:default.nix",
22-
version = "9.4.8",
24+
version = GHC_VERSION,
2325
)
2426

2527
load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains")
2628

27-
rules_haskell_toolchains(version = "9.4.8")
29+
rules_haskell_toolchains(version = GHC_VERSION)
2830

2931
load(
3032
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",

rules_haskell_tests/tests/stack-snapshot-deps/hs_override_stack_test/WORKSPACE

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@ rules_haskell_dependencies()
99

1010
load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs")
1111

12+
GHC_VERSION = "9.4.8"
13+
1214
haskell_register_ghc_nixpkgs(
13-
attribute_path = "haskell.compiler.ghc946",
15+
attribute_path = "haskell.compiler.ghc{}".format(GHC_VERSION.replace(".", "")),
1416
repository = "@rules_haskell//nixpkgs:default.nix",
15-
version = "9.4.8",
17+
version = GHC_VERSION,
1618
)
1719

1820
load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains")
1921

20-
rules_haskell_toolchains(version = "9.4.8")
22+
rules_haskell_toolchains(version = GHC_VERSION)
2123

2224
load(
2325
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",

tutorial/WORKSPACE

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ rules_haskell_dependencies()
1111

1212
load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs")
1313

14+
GHC_VERSION = "9.4.8"
15+
1416
haskell_register_ghc_nixpkgs(
15-
attribute_path = "haskell.compiler.ghc946",
17+
attribute_path = "haskell.compiler.ghc{}".format(GHC_VERSION.replace(".", "")),
1618
repository = "@rules_haskell//nixpkgs:default.nix",
17-
version = "9.4.8",
19+
version = GHC_VERSION,
1820
)
1921

2022
load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains")
2123

22-
rules_haskell_toolchains(version = "9.4.8")
24+
rules_haskell_toolchains(version = GHC_VERSION)
2325

2426
load(
2527
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",

0 commit comments

Comments
 (0)