-
Notifications
You must be signed in to change notification settings - Fork 119
Expand file tree
/
Copy pathMODULE.bazel
More file actions
131 lines (118 loc) · 5.93 KB
/
Copy pathMODULE.bazel
File metadata and controls
131 lines (118 loc) · 5.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
module(
name = "dds",
version = "3.0.1"
)
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")
# 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_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")