Improve compatibility with Bazel 6. (#499)

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.
This commit is contained in:
Philipp Stephani 2024-04-25 15:45:04 +02:00 committed by GitHub
parent f9c2d9e719
commit 700c9ec92b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -46,9 +46,13 @@ def _as_extension(macro, doc = None):
# deterministic. # deterministic.
return _use_all_repos(module_ctx, reproducible = True) return _use_all_repos(module_ctx, reproducible = True)
kwargs = {}
if doc != None:
kwargs["doc"] = doc
return module_extension( return module_extension(
implementation = _ext_impl, implementation = _ext_impl,
doc = doc, **kwargs
) )
def _use_all_repos(module_ctx, reproducible = False): def _use_all_repos(module_ctx, reproducible = False):