This PR intends to remove XLA as a bzlmod and transfer it as a non bzlmod dep. This is because this module will never be upstreamed as is, so keep it private. Also, we fetch llvm-raw and stablehlo from it, which is fine. While there, dummify the various local_config XLA symbols to please the imports, as we don't use those parts in ZML itself. Closes
31 lines
784 B
Python
31 lines
784 B
Python
load("@llvm-raw//utils/bazel:configure.bzl", _llvm_configure = "llvm_configure")
|
|
|
|
def _llvm_impl(mctx):
|
|
_targets = {}
|
|
for mod in mctx.modules:
|
|
for conf in mod.tags.configure:
|
|
for target in conf.targets:
|
|
_targets[target] = True
|
|
_llvm_configure(
|
|
name = "llvm-project",
|
|
targets = _targets.keys(),
|
|
)
|
|
return mctx.extension_metadata(
|
|
reproducible = True,
|
|
root_module_direct_deps = "all",
|
|
root_module_direct_dev_deps = [],
|
|
)
|
|
|
|
llvm = module_extension(
|
|
implementation = _llvm_impl,
|
|
tag_classes = {
|
|
"configure": tag_class(
|
|
attrs = {
|
|
"targets": attr.string_list(
|
|
default = [],
|
|
),
|
|
},
|
|
),
|
|
},
|
|
)
|