Skip to content

Commit 0f32482

Browse files
authored
🚚 Move toolchain registration to flake module (#260)
Hardcoding toolchain registrations into MODULE.bazel is a bad practice. Moving it to the flake module makes the ll_toolchain optional and only enables it on systems that can run Nix.
1 parent c1db936 commit 0f32482

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

MODULE.bazel

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ module(
44
compatibility_level = 0,
55
)
66

7-
register_toolchains("@rules_ll//ll:ll_toolchain")
8-
97
# Platform support.
108
bazel_dep(name = "platforms", version = "0.0.10")
119
bazel_dep(name = "rules_cc", version = "0.0.17")
@@ -14,7 +12,10 @@ bazel_dep(name = "rules_cc", version = "0.0.17")
1412
bazel_dep(name = "bazel_skylib", version = "1.7.1")
1513

1614
# Documentation.
17-
bazel_dep(name = "stardoc", version = "0.7.2", dev_dependency = True)
15+
#
16+
# TODO(aaronmondal): This should be a dev_dependency, but that currently breaks
17+
# the examples.
18+
bazel_dep(name = "stardoc", version = "0.7.2", dev_dependency = False)
1819

1920
# TODO(aaronmondal): We don't actually use this. Fix LRE upstream to make this
2021
# import optional.

modules/rules_ll.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ let
1212
# Add try-import %%workspace%%/ll.bazelrc to your .bazelrc to
1313
# include these flags when running Bazel in a nix environment.
1414
15+
build --extra_toolchains=@rules_ll//ll:ll_toolchain
16+
1517
${lib.concatLines processedActionEnvs}' >$out
1618
'';
1719
in

0 commit comments

Comments
 (0)