Skip to content

Commit

Permalink
Improve compatibility with Bazel 6. (#499)
Browse files Browse the repository at this point in the history
In Bazel 6, the doc parameter of the module_extension function doesn’t accept
None; cf. https://bazel.build/versions/6.5.0/rules/lib/globals#module_extension
vs. https://bazel.build/versions/7.0.0/rules/lib/globals/bzl#module_extension.
Instead of passing None in that case, just don’t pass the argument at all and
use the respective default.
  • Loading branch information
phst authored Apr 25, 2024
1 parent f9c2d9e commit 700c9ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/modules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,13 @@ def _as_extension(macro, doc = None):
# deterministic.
return _use_all_repos(module_ctx, reproducible = True)

kwargs = {}
if doc != None:
kwargs["doc"] = doc

return module_extension(
implementation = _ext_impl,
doc = doc,
**kwargs
)

def _use_all_repos(module_ctx, reproducible = False):
Expand Down

0 comments on commit 700c9ec

Please sign in to comment.