forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMODULE.bazel
More file actions
374 lines (336 loc) · 10.9 KB
/
MODULE.bazel
File metadata and controls
374 lines (336 loc) · 10.9 KB
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# This file marks a workspace root for the Bazel build system.
# See `https://bazel.build/`.
# This file lists Drake's external dependencies as known to bzlmod. It is used
# in concert with WORKSPACE.bzlmod (which has the workspace-style externals).
module(
name = "drake",
# This version number should match MINIMUM_BAZEL_VERSION in CMakeLists.txt.
bazel_compatibility = [">=8.4.0"],
)
# Add starlark rules.
bazel_dep(name = "apple_support", version = "2.3.0") # Keep this in sync with cmake/MODULE.bazel.in. # noqa
bazel_dep(name = "bazel_features", version = "1.42.0")
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_cc", version = "0.2.17")
bazel_dep(name = "rules_java", version = "9.6.1")
bazel_dep(name = "rules_jvm_external", version = "6.9")
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "rules_python", version = "1.9.0") # Keep this in sync with cmake/MODULE.bazel.in. # noqa
bazel_dep(name = "rules_rust", version = "0.69.0")
bazel_dep(name = "rules_shell", version = "0.6.1")
# Configure the C++ toolchain.
cc_configure = use_extension(
"@rules_cc//cc:extensions.bzl",
"cc_configure_extension",
)
use_repo(cc_configure, "local_config_cc")
# Add C++ dependencies that are part of our public API.
#
# We declare these dependencies twice -- as modules (bazel_dep) and repository
# rules using pkgconfig in `internal_repositories`. The choice of whether module
# vs pkgconfig will be used is governed by the flags declared at
# drake/tools/flags/BUILD.bazel.
#
# For our CMake builds from source, the "WITH_USER_..." CMake options to choose
# the flavor are translated into the matching Bazel flags.
#
# For wheel builds, the module flavor is always used.
#
# For Bazel builds using Drake as an external, the module flavor is used by
# default but can be changed using the Bazel flags.
#
# For first-party Bazel builds (by Drake Developers), the pkgconfig flavor is
# used by default but can be changed using the Bazel flags.
bazel_dep(name = "eigen", version = "5.0.1.bcr.1", repo_name = "module_eigen")
bazel_dep(name = "fmt", version = "12.1.0", repo_name = "module_fmt")
bazel_dep(name = "spdlog", version = "1.17.0", repo_name = "module_spdlog") # noqa
# Add C++ module dependencies that are NOT used by Drake's public API, but are
# used by Drake's implementation. Builds have the option to opt-out of these
# dependencies by providing a replacement:
#
# For our CMake builds from source, the "WITH_USER_..." CMake options find a
# user-supplied library are converted into a module override.
#
# For wheel builds, the module flavor is always used.
#
# For Bazel builds using Drake as an external, the module flavor is used by
# default but can be changed using the Bazel flags at @drake//tools/flags.
# For first-party Bazel builds (by Drake Developers), the non-module flavor
# is used by default.
bazel_dep(name = "glib", version = "2.82.2.bcr.7", repo_name = "module_glib")
bazel_dep(name = "zlib", version = "1.3.2", repo_name = "module_zlib")
# Add additional modules we use at build-time (not runtime dependencies).
bazel_dep(name = "libx11", version = "1.8.12.bcr.5")
bazel_dep(name = "nasm", version = "2.16.03.bcr.2")
bazel_dep(name = "patchelf", version = "0.18.0.bcr.1")
bazel_dep(name = "toolchains_llvm", version = "1.5.0")
llvm = use_repo_rule("@toolchains_llvm//toolchain:rules.bzl", "llvm")
llvm(
name = "llvm",
llvm_version = "20.1.7",
)
# Configure the Python toolchain.
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
PYTHON_VERSIONS = [
# When changing this list, see drake/tools/workspace/python/README.md.
"3.12",
"3.13",
"3.14",
]
[
python.toolchain(python_version = python_version)
for python_version in PYTHON_VERSIONS
]
python.defaults(
python_version_file = "gen/python_version.txt",
)
uv = use_extension(
"@rules_python//python/uv:uv.bzl",
"uv",
)
uv.configure(version = "0.9.27")
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
[
pip.parse(
hub_name = "drake_mypy",
python_version = python_version,
requirements_lock = "//setup:python/mypy/requirements.txt",
)
for python_version in PYTHON_VERSIONS
]
use_repo(pip, "drake_mypy")
# Load dependencies which are "public", i.e., made available to downstream
# projects.
#
# Downstream projects may load the same `drake_dep_repositories` module
# extension shown below and call its `use_repo` with whatever list of
# repositories they desire to cite from their project. It's safe to call
# `use_repo` on a subset of this list, or not call it at all downstream.
# Its only effect on a downstream project is to make the repository name
# visible to BUILD rules; Drake's own use of the repository is unaffected.
drake_dep_repositories = use_extension(
"@drake//tools/workspace:default.bzl",
"drake_dep_repositories",
)
use_repo(
drake_dep_repositories,
#
# Aliases for C++ dependencies that are part of our public API.
# What these refer to is configurable; see above.
#
"eigen",
"fmt",
"spdlog",
#
# Aliases for C++ dependencies that are used by our implementation.
# What these refer to is configurable; see above.
#
"blas",
"glib",
"lapack",
"opencl",
"zlib",
#
# First-party dependencies (i.e., drake-maintained).
#
"drake_models",
"meshcat",
#
# Commercial solver dependencies. In principle, these externals don't need
# to be public, but it's not too much work for us to provide them.
#
"gurobi",
"mosek",
"snopt",
#
# For convenience, we make our Python toolchains available downstream.
# If at some point the Bazel ecosystem evolves so that rules_python on its
# own is sufficiently easy to use, we might decide to mark this internal.
#
"python",
#
# For now, we'll offer Drake's customized pybind11 as public. Ideally this
# would be internal, but given the pending port to nanobind, it's not worth
# deprecating it until we have nanobind ready.
#
"pybind11",
)
# Load Java dependencies.
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
name = "drake_maven_internal",
artifacts = [
# Used by @lcm_internal.
"net.sf.jchart2d:jchart2d:3.3.2",
],
)
use_repo(maven, "drake_maven_internal")
# Load developer dependencies that are modules.
bazel_dep(
name = "buildifier_prebuilt",
version = "8.2.1.2",
dev_dependency = True,
)
bazel_dep(
name = "gflags",
version = "2.2.2.bcr.1",
dev_dependency = True,
)
bazel_dep(
name = "googletest",
version = "1.17.0.bcr.2",
# Ideally we could set dev_dependency = True here, but that would prevent
# downstream projects from re-using our //common/test_utilities library.
# Even though that library is not Stable API, historically downstream
# projects have relied on it, so for now we've chosen not to break it.
)
single_version_override(
module_name = "googletest",
patches = [
"//tools/workspace/googletest:patches/upstream/exception_shadowing.patch", # noqa
"//tools/workspace/googletest:patches/upstream/param_iterator_interface.patch", # noqa
"//tools/workspace/googletest:patches/add_printers.patch",
"//tools/workspace/googletest:patches/defines.patch",
],
)
bazel_dep(
name = "google_benchmark",
version = "1.9.5",
dev_dependency = True,
)
single_version_override(
module_name = "google_benchmark",
patches = [
"//tools/workspace/google_benchmark:patches/console_allocs.patch",
"//tools/workspace/google_benchmark:patches/remove_overloaded_fixture_set_up.patch", # noqa
"//tools/workspace/google_benchmark:patches/reporter_scaling.patch",
"//tools/workspace/google_benchmark:patches/string_precision.patch",
],
)
bazel_dep(
name = "ruff_prebuilt",
version = "0.15.0.1",
dev_dependency = True,
repo_name = "ruff",
)
# Load dependencies which are "private", i.e., not available for use by
# downstream projects. These are all "internal use only".
internal_repositories = use_extension(
"@drake//tools/workspace:default.bzl",
"internal_repositories",
)
use_repo(
internal_repositories,
#
# C/C++ libraries used at runtime.
#
"abseil_cpp_internal",
"ccd_internal",
"clarabel_cpp_internal",
"clp_internal",
"coinutils_internal",
"common_robotics_utilities_internal",
"csdp_internal",
"curl_internal",
"fcl_internal",
"gfortran_internal",
"gklib_internal",
"gz_math_internal",
"gz_utils_internal",
"highway_internal",
"implib_so_internal",
"ipopt_internal",
"lapack_internal",
"lcm_internal",
"libjpeg_turbo_internal",
"libpng_internal",
"libtiff_internal",
"libzip_internal",
"metis_internal",
"msgpack_internal",
"nanoflann_internal",
"nlohmann_internal",
"nlopt_internal",
"onetbb_internal",
"osqp_internal",
"picosha2_internal",
"pkgconfig_blas_internal",
"pkgconfig_eigen_internal",
"pkgconfig_fmt_internal",
"pkgconfig_glib_internal",
"pkgconfig_lapack_internal",
"pkgconfig_opencl_internal",
"pkgconfig_spdlog_internal",
"poisson_disk_sampling_internal",
"qdldl_internal",
"qhull_internal",
"scs_internal",
"sdformat_internal",
"spgrid_internal",
"spral_internal",
"stduuid_internal",
"suitesparse_internal",
"tinygltf_internal",
"tinyobjloader_internal",
"tinyxml2_internal",
"usockets_internal",
"uwebsockets_internal",
"voxelized_geometry_tools_internal",
"vtk_internal",
"yaml_cpp_internal",
#
# Python code used when building pydrake.
#
"clang_cindex_python3_internal",
#
# Python libraries used at runtime.
#
"gymnasium_py_internal",
"stable_baselines3_internal",
#
# Python libraries used at test-time or by maintainers.
#
"cpplint_internal",
"github3_py_internal",
"mpmath_py_internal",
"sympy_py_internal",
"uritemplate_py_internal",
"xmlrunner_py_internal",
#
# Test or example data.
#
"dm_control_internal",
"mujoco_menagerie_internal",
"ros_xacro_internal",
#
# Build system.
#
"bazelisk_internal",
#
# Documentation.
#
"doxygen_internal",
"styleguide_internal",
)
crate_universe = use_extension(
"//tools/workspace/crate_universe:extensions.bzl",
"crate_universe",
)
use_repo(
crate_universe,
"crate",
"crate__cfg-if-1.0.4",
"crate__clarabel-0.11.1",
"crate__paste-1.0.15",
"crate_licenses",
)
# Add CLion support repository used by `tools/clion/bazel_wrapper`.
drake_clion_environment = use_repo_rule(
"//tools/clion:repository.bzl",
"drake_clion_environment",
)
drake_clion_environment(
name = "drake_clion_environment",
dev_dependency = True,
)