Skip to content

Commit 7f531c6

Browse files
committed
Use deb10 dist on Linux amd64
On newer Ubuntu systems, older ghc binary distributions do not work anymore since they are lacking the legacy tinfo5 library package. Note, there are also Ubuntu specific binary distributions available, such as `ubuntu18_04`, `ubuntu20_04` and even `ubuntu22_04`, but these are not available for all GHC versions and the Debian based ones are working just as well.
1 parent 8f1a784 commit 7f531c6

File tree

14 files changed

+78
-11
lines changed

14 files changed

+78
-11
lines changed

MODULE.bazel

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ haskell_toolchains = use_extension(
7979
"@rules_haskell//extensions:haskell_toolchains.bzl",
8080
"haskell_toolchains",
8181
)
82-
haskell_toolchains.bindists()
82+
haskell_toolchains.bindists(
83+
dist = {
84+
"linux_amd64": "deb10",
85+
},
86+
)
8387
use_repo(
8488
haskell_toolchains,
8589
"all_bindist_toolchains",

WORKSPACE

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ load(
6767
)
6868
load("@rules_haskell_ghc_version//:ghc_version.bzl", "GHC_VERSION")
6969

70-
haskell_register_ghc_bindists(version = GHC_VERSION)
70+
haskell_register_ghc_bindists(
71+
dist = {
72+
"linux_amd64": "deb10",
73+
},
74+
version = GHC_VERSION,
75+
)
7176

7277
load("@os_info//:os_info.bzl", "is_nix_shell", "is_windows")
7378
load(

examples/WORKSPACE

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ haskell_register_ghc_nixpkgs(
2626

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

29-
rules_haskell_toolchains(version = GHC_VERSION)
29+
rules_haskell_toolchains(
30+
dist = {
31+
"linux_amd64": "deb10",
32+
},
33+
version = GHC_VERSION,
34+
)
3035

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

extensions/haskell_toolchains.bzl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ def _haskell_toolchains_impl(mctx):
130130
bindist_targets.append(bindist_tag.target)
131131
ghc_bindist(
132132
name = name,
133+
dist = bindist_tag.dist,
134+
variant = bindist_tag.variant,
133135
version = bindist_tag.version,
134136
target = bindist_tag.target,
135137
ghcopts = bindist_tag.ghcopts,
@@ -164,6 +166,8 @@ def _haskell_toolchains_impl(mctx):
164166
targets = bindist_info_for_version(mctx, bindists_tag.version).keys()
165167

166168
haskell_register_ghc_bindists(
169+
dist = bindists_tag.dist,
170+
variant = bindists_tag.variant,
167171
version = bindists_tag.version,
168172
ghcopts = bindists_tag.ghcopts,
169173
haddock_flags = bindists_tag.haddock_flags,

rules_haskell_tests/MODULE.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ cabalopts_windows = test_cabalopts + [
295295

296296
haskell_toolchains.bindists(
297297
cabalopts = test_cabalopts,
298+
dist = {
299+
"linux_amd64": "deb10",
300+
},
298301
ghcopts = test_ghcopts,
299302
haddock_flags = test_haddock_flags,
300303
repl_ghci_args = test_repl_ghci_args,

rules_haskell_tests/WORKSPACE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ load(
137137

138138
haskell_register_ghc_bindists(
139139
cabalopts = test_cabalopts,
140+
dist = {
141+
"linux_amd64": "deb10",
142+
},
140143
ghcopts = test_ghcopts,
141144
version = GHC_VERSION,
142145
)

rules_haskell_tests/tests/haskell_module/repl/haskell_module_repl_cross_library_deps_test/WORKSPACE

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ haskell_register_ghc_nixpkgs(
2424

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

27-
rules_haskell_toolchains(version = GHC_VERSION)
27+
rules_haskell_toolchains(
28+
dist = {
29+
"linux_amd64": "deb10",
30+
},
31+
version = GHC_VERSION,
32+
)
2833

2934
load("@rules_nixpkgs_cc//:cc.bzl", "nixpkgs_cc_configure")
3035
load(

rules_haskell_tests/tests/haskell_module/repl/haskell_module_repl_test/WORKSPACE

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ haskell_register_ghc_nixpkgs(
2525

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

28-
rules_haskell_toolchains(version = GHC_VERSION)
28+
rules_haskell_toolchains(
29+
dist = {
30+
"linux_amd64": "deb10",
31+
},
32+
version = GHC_VERSION,
33+
)
2934

3035
load(
3136
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",

rules_haskell_tests/tests/recompilation/recompilation_workspace/WORKSPACE

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ haskell_register_ghc_nixpkgs(
2020

2121
load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains")
2222

23-
rules_haskell_toolchains(version = "8.10.7")
23+
rules_haskell_toolchains(
24+
dist = {
25+
"linux_amd64": "deb10",
26+
},
27+
version = "8.10.7",
28+
)
2429

2530
load("@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl", "nixpkgs_cc_configure")
2631

rules_haskell_tests/tests/repl-targets/hs_bin_repl_test/WORKSPACE

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ haskell_register_ghc_nixpkgs(
1919

2020
load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains")
2121

22-
rules_haskell_toolchains(version = GHC_VERSION)
22+
rules_haskell_toolchains(
23+
dist = {
24+
"linux_amd64": "deb10",
25+
},
26+
version = GHC_VERSION,
27+
)
2328

2429
load(
2530
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",

0 commit comments

Comments
 (0)