forked from carbon-language/carbon-lang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMODULE.bazel
142 lines (116 loc) · 5.32 KB
/
MODULE.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Bazel modules.
If `MODULE.bazel.lock` changes locally, it means the host platform hasn't yet
been added to the lock file. Running `bazel mod deps` provides a canonical
update to `MODULE.bazel.lock`; create a PR with those changes in order to
include the host platform.
Platforms tested with GitHub actions are kept up-to-date. Other platforms may
fall out of sync on dependency changes, and should be updated with a PR the same
way a platform is added.
"""
module(name = "carbon")
http_archive = use_repo_rule(
"@bazel_tools//tools/build_defs/repo:http.bzl",
"http_archive",
)
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_pkg", version = "0.10.1")
bazel_dep(name = "abseil-cpp", version = "20240116.2")
bazel_dep(name = "re2", version = "2024-06-01")
bazel_dep(name = "googletest", version = "1.14.0.bcr.1")
bazel_dep(name = "google_benchmark", version = "1.8.4")
# The registry only has an old version. We use that here to avoid a miss but
# override it with a newer version.
bazel_dep(name = "libpfm", version = "4.11.0")
libpfm_version = "4.13.0"
archive_override(
module_name = "libpfm",
integrity = "sha256-0YuXdkx1VSjBBR03bjNUXQ62DG6/hWgENoE/pbBMw9E=",
patch_strip = 1,
patches = ["@//bazel/libpfm:0001-Introduce-a-simple-native-Bazel-build.patch"],
strip_prefix = "libpfm-{0}".format(libpfm_version),
urls = ["https://sourceforge.net/projects/perfmon2/files/libpfm4/libpfm-{0}.tar.gz".format(libpfm_version)],
)
bazel_dep(name = "rules_bison", version = "0.2.2")
bazel_dep(name = "rules_flex", version = "0.2.1")
bazel_dep(name = "rules_m4", version = "0.2.3")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_proto", version = "6.0.2")
bazel_dep(name = "protobuf", version = "27.1")
libprotobuf_mutator_version = "1.3"
http_archive(
name = "com_google_libprotobuf_mutator",
build_file = "@//:third_party/libprotobuf_mutator/BUILD.txt",
sha256 = "1ee3473a6b0274494fce599539605bb19305c0efadc62b58d645812132c31baa",
strip_prefix = "libprotobuf-mutator-{0}".format(libprotobuf_mutator_version),
urls = ["https://github.com/google/libprotobuf-mutator/archive/v{0}.tar.gz".format(libprotobuf_mutator_version)],
)
bazel_dep(name = "bazel_clang_tidy", dev_dependency = True)
git_override(
module_name = "bazel_clang_tidy",
# HEAD as of 2024-03-12.
commit = "bff5c59c843221b05ef0e37cef089ecc9d24e7da",
remote = "https://github.com/erenon/bazel_clang_tidy.git",
)
bazel_cc_toolchain = use_extension(
"//bazel/cc_toolchains:clang_configuration.bzl",
"clang_toolchain_extension",
)
use_repo(bazel_cc_toolchain, "bazel_cc_toolchain")
register_toolchains("@bazel_cc_toolchain//:all")
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
git_override(
module_name = "hedron_compile_commands",
# HEAD as of 2024-03-12.
commit = "204aa593e002cbd177d30f11f54cff3559110bb9",
remote = "https://github.com/hedronvision/bazel-compile-commands-extractor.git",
)
boost_unordered_version = "1.85.0"
http_archive(
name = "boost_unordered",
build_file = "@//:third_party/boost_unordered/BUILD.bazel",
integrity = "sha256-2dQ4IQH/xFiK1iWCkrMYLeR8zsSQqGchKOdTuf1u0zI=",
strip_prefix = "boost_unordered-{0}".format(boost_unordered_version),
urls = ["https://github.com/MikePopoloski/boost_unordered/archive/v{0}.tar.gz".format(boost_unordered_version)],
)
# Required for llvm-project.
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "zlib", version = "1.3.1.bcr.1", repo_name = "llvm_zlib")
bazel_dep(name = "zstd", version = "1.5.6", repo_name = "llvm_zstd")
###############################################################################
# llvm-project
###############################################################################
# We pin to specific upstream commits and try to track top-of-tree reasonably
# closely rather than pinning to a specific release.
# HEAD as of 2024-06-20.
llvm_project_version = "80f881485accb020345ee7e1c4c3151ec55ce590"
# Load a repository for the raw llvm-project, pre-overlay.
http_archive(
name = "llvm-raw",
build_file_content = "# empty",
patch_args = ["-p1"],
patches = [
"@carbon//bazel/llvm_project:0001_Patch_for_mallinfo2_when_using_Bazel_build_system.patch",
"@carbon//bazel/llvm_project:0002_Added_Bazel_build_for_compiler_rt_fuzzer.patch",
],
sha256 = "3216d56b308d420170d6284d04560175b56fd56065a7442f32b732c606e77367",
strip_prefix = "llvm-project-{0}".format(llvm_project_version),
urls = ["https://github.com/llvm/llvm-project/archive/{0}.tar.gz".format(llvm_project_version)],
)
# Apply the overlay to produce llvm-project.
llvm_project = use_extension(
"//bazel/llvm_project:llvm_project.bzl",
"llvm_project",
)
use_repo(llvm_project, "llvm-project")
###############################################################################
# Python
###############################################################################
bazel_dep(name = "rules_python", version = "0.33.1")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.11",
)
use_repo(python, "python_versions")