Skip to content

Commit 4d09368

Browse files
authored
[bazel] Add MODULE.bazel (#164891)
This is a simple translation of the current WORKSPACE file. * External repos are replaced with `bazel_dep()`. The versions have been bumped to newer versions. * `maybe()` doesn't seem to be a thing, so I just removed that. * Existing repos where we define our own BUILD file in third_party_build have *not* been replaced due to compatibility issues. For example, `nanobind_bazel` could replace the `nanobind` config we have, but switching to that caused some build errors. * For these existing repos, they have been specified as module extensions This should have no effect since `.bazelrc` defines `common --enable_bzlmod=false --enable_workspace` Tested locally: `bazel test --enable_bzlmod --noenable_workspace --config=generic_clang @llvm-project//... //...`
1 parent 61c2cc9 commit 4d09368

File tree

3 files changed

+655
-0
lines changed

3 files changed

+655
-0
lines changed

utils/bazel/MODULE.bazel

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
2+
# See https://llvm.org/LICENSE.txt for license information.
3+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
5+
"""bzlmod configuration for llvm-project"""
6+
module(name = "llvm-project-overlay")
7+
8+
bazel_dep(name = "apple_support", version = "1.24.1", repo_name = "build_bazel_apple_support")
9+
bazel_dep(name = "bazel_skylib", version = "1.8.2")
10+
bazel_dep(name = "platforms", version = "1.0.0")
11+
bazel_dep(name = "rules_android", version = "0.6.6")
12+
bazel_dep(name = "rules_cc", version = "0.2.11")
13+
bazel_dep(name = "rules_foreign_cc", version = "0.15.1")
14+
bazel_dep(name = "rules_python", version = "1.6.3")
15+
bazel_dep(name = "rules_shell", version = "0.6.1")
16+
17+
llvm_repos_extension = use_extension(":extensions.bzl", "llvm_repos_extension")
18+
19+
use_repo(
20+
llvm_repos_extension,
21+
"llvm-raw",
22+
"llvm_zlib",
23+
"vulkan_headers",
24+
"vulkan_sdk_setup",
25+
"gmp",
26+
"mpfr",
27+
"mpc",
28+
"pfm",
29+
"llvm_zstd",
30+
"pybind11",
31+
"pyyaml",
32+
"robin_map",
33+
"nanobind",
34+
)
35+
36+
llvm_configure = use_repo_rule("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure")
37+
38+
llvm_configure(name = "llvm-project")

0 commit comments

Comments
 (0)