Repository navigation
Expand file tree
/
Copy pathMODULE.bazel
More file actions
172 lines (159 loc) · 7.93 KB
/
Copy pathMODULE.bazel
File metadata and controls
172 lines (159 loc) · 7.93 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
module(
name = "dds",
version = "3.1.0"
)
bazel_dep(name = "rules_cc", version = "0.2.18")
# MSVC default_cpp_std is hardcoded to /std:c++17 in rules_cc. Raise it to
# /std:c++20 so googletest and every Windows cc_* compile match the project
# baseline without restating /std in DDS_CPPOPTS (D9025) or build:windows
# --cxxopt (which would leak into wasm transitions on Windows hosts).
single_version_override(
module_name = "rules_cc",
version = "0.2.18",
patches = ["//:patches/rules_cc_msvc_default_cpp_std_cxx20.patch"],
patch_strip = 1,
)
bazel_dep(name = "platforms", version = "1.1.0")
# copy_file (shell-free, cross-platform) for staging the native lib into the jar.
# Pin to the version the graph resolves (via rules_jvm_external) to avoid a
# direct-dependency mismatch warning on every invocation.
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")
bazel_dep(name = "pybind11_bazel", version = "3.0.1")
bazel_dep(name = "rules_python", version = "2.0.1")
# 1.8.0+ adds --features=msan and libcxx_url for an instrumented libc++ overlay.
# BCR 1.8.0 still emits unused `-stdlib=libc++` under `-nostdinc++`, which fails
# our Linux `-Werror` builds. Override to the #791 fix until BCR publishes >1.8.0.
bazel_dep(name = "toolchains_llvm", version = "1.8.0")
# Xcode CC toolchain for macOS AddressSanitizer builds (--config=asan). LLVM's ASAN
# runtime hangs on current macOS; see .bazelrc build:asan_macos.
bazel_dep(name = "apple_support", version = "1.24.2")
# Xcode 27 libc++ warns for -mmacosx-version-min < 11.0 when building
# apple_support's wrapped_clang/libtool; 1.24.2 also has a dead nodiscard
# hasher(file) in libtool.cc. Drop these overrides when bumping past upstream
# fixes (min-OS bump is in apple_support >= 2.8.4).
single_version_override(
module_name = "apple_support",
version = "1.24.2",
patches = [
"//:patches/apple_support_macos_min_11.patch",
"//:patches/apple_support_libtool_nodiscard.patch",
],
patch_strip = 1,
)
# WASM builds (//wasm:*, //web:dds_web_wasm). If you bump this version,
# rebuild and run web/update_wasm.sh; see docs/wasm_build.md and patch_web_wasm.py.
bazel_dep(name = "emsdk", version = "5.0.7")
# Java bindings (//jni:*). Provides the hermetic remote JDK used to build and run
# the FFM (java.lang.foreign) smoke test. rules_java 9.6.1 registers remotejdk_21
# and remotejdk_25; we pin JDK 25 (>= 22, so the Foreign Function & Memory API is
# stable, not preview) via --java_*_version in .bazelrc.
bazel_dep(name = "rules_java", version = "9.6.1")
# Java packaging (//jni:dds_ffm_dist). Provides java_export -> a Maven-coordinate
# jar plus a generated .publish target that supports file:// local repos, used to
# install into ~/.m2 (Phase 1; no remote/public publishing yet).
bazel_dep(name = "rules_jvm_external", version = "7.0")
# Prefer GitHub, fall back to codeload CDN on transient timeouts (see CI flakes).
# Integrity and strip_prefix match BCR emsdk 5.0.7 source.json.
archive_override(
module_name = "emsdk",
integrity = "sha256-Jm30uWRN3hgwOvBdzn0EhUJzsLtSckbLf7aglZF3TM8=",
strip_prefix = "emsdk-5.0.7/bazel",
urls = [
"https://github.com/emscripten-core/emsdk/archive/refs/tags/5.0.7.tar.gz",
"https://codeload.github.com/emscripten-core/emsdk/tar.gz/refs/tags/5.0.7",
],
)
# toolchains_llvm#791: drop redundant `-stdlib=libc++` (unused with `-nostdinc++`).
# Commit is the merge of that PR; drop this override when BCR ships a release
# that includes it.
archive_override(
module_name = "toolchains_llvm",
integrity = "sha256-spaFpVBa8JGs27s/9vk0Xb4gd8fJ9OFmnxaBYPeOt4o=",
strip_prefix = "toolchains_llvm-c3ac93f5c61cb78487765d2e81e7485ad3f8bf2c",
urls = [
"https://github.com/bazel-contrib/toolchains_llvm/archive/c3ac93f5c61cb78487765d2e81e7485ad3f8bf2c.tar.gz",
"https://codeload.github.com/bazel-contrib/toolchains_llvm/tar.gz/c3ac93f5c61cb78487765d2e81e7485ad3f8bf2c",
],
)
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
llvm.toolchain(
name = "llvm_toolchain",
# When bumping these versions, also update .bazelrc build:tsan_macos rpath
# (clang/N) and confirm Xcode ships the same major; see docs/BUILD_SYSTEM.md.
# Keep MSAN_LLVM_VERSION / MSAN_DISTRIBUTION below on the same LLVM release.
# LLVM 21 ld64.lld cannot parse MacOSX 27 SDK TBD files that list
# arm64e.x1. Apple's ld can; last --ld-path wins over the toolchain default
# --ld-path=ld64.lld. Pair with .bazelrc --features=-supports_start_end_lib
# because Apple ld rejects lld's --start-lib/--end-lib. Scoped to this
# toolchain so wasm/emscripten keeps wasm-ld (do not put --ld-path in
# build:macos --linkopt). See docs/BUILD_SYSTEM.md (macOS SDK section).
# Linux uses the host's GNU ld for the same reason in a different guise:
# the upstream LLVM Linux archive's ld.lld needs libxml2.so.2, which
# Ubuntu 26.04 and other libxml2 >= 2.14 distros no longer ship. The
# msan toolchain below keeps ld.lld (its CI job is pinned to 22.04).
# See docs/BUILD_SYSTEM.md (Linux linker section).
extra_link_flags = {
"darwin-aarch64": ["--ld-path=/usr/bin/ld"],
"darwin-x86_64": ["--ld-path=/usr/bin/ld"],
"linux-x86_64": ["--ld-path=/usr/bin/ld"],
},
# GNU ld resolves static archives in command-line order (lld does not),
# and the toolchain places -l:libunwind.a among the early link flags,
# before the libc++abi.a that needs _Unwind_*. Repeat the runtime archives
# in dependency order at the end of the link; a repeated static archive
# only supplies still-undefined symbols, so nothing is linked twice.
extra_link_libs = {
"linux-x86_64": [
"-l:libc++.a",
"-l:libc++abi.a",
"-l:libunwind.a",
],
},
llvm_versions = {
"darwin-aarch64": "21.1.8",
"linux-x86_64": "21.1.8",
"windows-x86_64": "21.1.8",
},
)
use_repo(llvm, "llvm_toolchain")
# MemorySanitizer toolchain (Linux x86_64 only). Not registered globally —
# selected via --config=msan (--extra_toolchains=@llvm_toolchain_msan//:all).
# Pinned to the exact Ubuntu 22.04 LLVM build that the instrumented libc++
# overlay was compiled against; see toolchains_llvm tests/MODULE.bazel and
# docs/BUILD_SYSTEM.md (MSAN section).
MSAN_LLVM_VERSION = "21.1.8"
MSAN_DISTRIBUTION = "clang+llvm-%s-x86_64-linux-gnu-ubuntu-22.04.tar.zst" % MSAN_LLVM_VERSION
llvm.toolchain(
name = "llvm_toolchain_msan",
alternative_llvm_sources = [
"https://github.com/RealtimeRoboticsGroup/toolchains/releases/download/{llvm_version}/{basename}",
],
distribution = MSAN_DISTRIBUTION,
extra_llvm_distributions = {
MSAN_DISTRIBUTION: "3e9ab559182f45143c36d761fcee6818935187a8f54354ecb043643b642769f0",
},
libcxx_sha256 = "56e33981bb71aba8704026534093f81ba9783cff0bf701681f1781d2ecb50a87",
libcxx_url = "https://github.com/RealtimeRoboticsGroup/toolchains/releases/download/%s/libcxx-msan-%s-x86_64-linux-gnu-ubuntu-22.04.tar.zst" % (MSAN_LLVM_VERSION, MSAN_LLVM_VERSION),
llvm_versions = {"": MSAN_LLVM_VERSION},
)
use_repo(llvm, "llvm_toolchain_msan")
# Apple toolchain repo; selected only for --config=asan via .bazelrc (not registered globally).
apple_cc_configure = use_extension("@apple_support//crosstool:setup.bzl", "apple_cc_configure_extension")
use_repo(apple_cc_configure, "local_config_apple_cc", "local_config_apple_cc_toolchains")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
configure_coverage_tool = True,
is_default = True,
python_version = "3.14",
)
use_repo(python, "python_3_14")
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.14",
requirements_lock = "//web:requirements_lock.txt",
)
use_repo(pip, "pypi")
register_toolchains("@llvm_toolchain//:all")
register_toolchains("@emsdk//:all")