Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward all attributes to bzlmod extension #218

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions toolchain/extensions/llvm.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,18 @@ def _llvm_impl_(module_ctx):
if not mod.is_root:
fail("Only the root module can use the 'llvm' extension")
for toolchain_attr in mod.tags.toolchain:
attrs = {
key: getattr(toolchain_attr, key)
for key in dir(toolchain_attr)
if not key.startswith("_")
}
llvm_toolchain(
name = toolchain_attr.name,
llvm_version = toolchain_attr.llvm_version,
llvm_versions = toolchain_attr.llvm_versions,
stdlib = toolchain_attr.stdlib,
sha256 = toolchain_attr.sha256,
strip_prefix = toolchain_attr.strip_prefix,
urls = toolchain_attr.urls,
**attrs
)

_attrs = {
"name": attr.string(doc = """\
Base name for generated repositories, allowing more than one mylang toolchain to be registered.
Overriding the default is only permitted in the root module.
Base name for the generated repositories, allowing more than one LLVM toolchain to be registered.
""", default = "llvm_toolchain"),
}
_attrs.update(_llvm_config_attrs)
Expand Down