Skip to content

Commit edc058a

Browse files
authored
Forward all attributes to bzlmod extension (#218)
Reported by @jsharpe in #128 (comment).
1 parent 2c25456 commit edc058a

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

toolchain/extensions/llvm.bzl

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,18 @@ def _llvm_impl_(module_ctx):
1212
if not mod.is_root:
1313
fail("Only the root module can use the 'llvm' extension")
1414
for toolchain_attr in mod.tags.toolchain:
15+
attrs = {
16+
key: getattr(toolchain_attr, key)
17+
for key in dir(toolchain_attr)
18+
if not key.startswith("_")
19+
}
1520
llvm_toolchain(
16-
name = toolchain_attr.name,
17-
llvm_version = toolchain_attr.llvm_version,
18-
llvm_versions = toolchain_attr.llvm_versions,
19-
stdlib = toolchain_attr.stdlib,
20-
sha256 = toolchain_attr.sha256,
21-
strip_prefix = toolchain_attr.strip_prefix,
22-
urls = toolchain_attr.urls,
21+
**attrs
2322
)
2423

2524
_attrs = {
2625
"name": attr.string(doc = """\
27-
Base name for generated repositories, allowing more than one mylang toolchain to be registered.
28-
Overriding the default is only permitted in the root module.
26+
Base name for the generated repositories, allowing more than one LLVM toolchain to be registered.
2927
""", default = "llvm_toolchain"),
3028
}
3129
_attrs.update(_llvm_config_attrs)

0 commit comments

Comments
 (0)