Repository navigation
Expand file tree
/
Copy pathMODULE.bazel
More file actions
238 lines (215 loc) Β· 13.3 KB
/
Copy pathMODULE.bazel
File metadata and controls
238 lines (215 loc) Β· 13.3 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
http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
_WASI_SDK_BUILD = """
exports_files(["bin/clang++"])
filegroup(
name = "all_files",
srcs = glob(["bin/**", "lib/**", "share/**"]),
visibility = ["//visibility:public"],
)
"""
http_archive(
name = "wasi_sdk_macos",
urls = ["https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-33/wasi-sdk-33.0-arm64-macos.tar.gz"],
sha256 = "85c997a2665ead91673b5bb88b7d0df3fc8900df3bfa244f720d478187bbdc78",
strip_prefix = "wasi-sdk-33.0-arm64-macos",
build_file_content = _WASI_SDK_BUILD,
)
http_archive(
name = "wasi_sdk_linux",
urls = ["https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-33/wasi-sdk-33.0-arm64-linux.tar.gz"],
sha256 = "4f98ee738c7abb45c81a94d1461fc53cc569d1cd01498951c8184d841a027844",
strip_prefix = "wasi-sdk-33.0-arm64-linux",
build_file_content = _WASI_SDK_BUILD,
)
bazel_dep(name = "bazel_features", version = "1.51.0")
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "platforms", version = "1.1.0")
bazel_dep(name = "rules_cc", version = "0.2.20")
bazel_dep(name = "rules_rust", version = "0.74.0")
bazel_dep(name = "rules_shell", version = "0.6.1")
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2024",
extra_target_triples = [
"aarch64-apple-ios",
"aarch64-apple-ios-sim",
"x86_64-apple-ios",
],
versions = ["1.98.1"],
)
use_repo(rust, "rust_toolchains")
register_toolchains("@rust_toolchains//:all")
wallet_engine_crates = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
wallet_engine_crates.spec(package = "aes", repositories = ["wallet_engine_crates"], version = "=0.8.4")
wallet_engine_crates.spec(package = "async-trait", repositories = ["wallet_engine_crates"], version = "=0.1.89")
wallet_engine_crates.spec(package = "base64", repositories = ["wallet_engine_crates"], version = "=0.22.1")
wallet_engine_crates.spec(package = "crc", repositories = ["wallet_engine_crates"], version = "=3.4.0")
wallet_engine_crates.spec(package = "crypto_box", default_features = False, features = ["alloc", "salsa20", "std"], repositories = ["wallet_engine_crates"], version = "=0.9.1")
wallet_engine_crates.spec(package = "curve25519-dalek", repositories = ["wallet_engine_crates"], version = "=4.1.3")
wallet_engine_crates.spec(package = "ed25519-dalek", features = ["zeroize"], repositories = ["wallet_engine_crates"], version = "=2.2.0")
wallet_engine_crates.spec(package = "fastnum", features = ["numtraits"], repositories = ["wallet_engine_crates"], version = "0.7")
wallet_engine_crates.spec(package = "futures", repositories = ["wallet_engine_crates"], version = "=0.3.31")
wallet_engine_crates.spec(package = "getrandom", features = ["wasm_js"], repositories = ["wallet_engine_crates"], version = "=0.3.4")
wallet_engine_crates.spec(package = "hex", repositories = ["wallet_engine_crates"], version = "0.4")
wallet_engine_crates.spec(package = "hmac", repositories = ["wallet_engine_crates"], version = "=0.12.1")
wallet_engine_crates.spec(package = "num-bigint", repositories = ["wallet_engine_crates"], version = "=0.4.8")
wallet_engine_crates.spec(package = "num-traits", repositories = ["wallet_engine_crates"], version = "0.2")
wallet_engine_crates.spec(package = "parking_lot", repositories = ["wallet_engine_crates"], version = "0.12")
wallet_engine_crates.spec(package = "pbkdf2", features = ["simple"], repositories = ["wallet_engine_crates"], version = "=0.12.2")
wallet_engine_crates.spec(package = "serde", features = ["derive"], repositories = ["wallet_engine_crates"], version = "=1.0.229")
wallet_engine_crates.spec(package = "serde-aux", repositories = ["wallet_engine_crates"], version = "4")
wallet_engine_crates.spec(package = "serde_json", repositories = ["wallet_engine_crates"], version = "=1.0.151")
wallet_engine_crates.spec(package = "sha2", repositories = ["wallet_engine_crates"], version = "=0.10.9")
wallet_engine_crates.spec(package = "subtle", repositories = ["wallet_engine_crates"], version = "=2.6.1")
wallet_engine_crates.spec(package = "thiserror", repositories = ["wallet_engine_crates"], version = "=2.0.17")
wallet_engine_crates.spec(package = "ton_core", features = ["serde"], repositories = ["wallet_engine_crates"], version = "=0.1.4")
wallet_engine_crates.spec(package = "ton_macros", repositories = ["wallet_engine_crates"], version = "0.1")
wallet_engine_crates.spec(package = "uniffi", repositories = ["wallet_engine_crates"], version = "=0.32.0")
wallet_engine_crates.spec(package = "url", repositories = ["wallet_engine_crates"], version = "=2.5.7")
wallet_engine_crates.spec(package = "zeroize", features = ["derive"], repositories = ["wallet_engine_crates"], version = "=1.9.0")
wallet_engine_crates.from_specs(
name = "wallet_engine_crates",
cargo_lockfile = "//third-party/wallet-engine:Cargo.Bazel.lock",
supported_platform_triples = [
"aarch64-apple-darwin",
"aarch64-apple-ios",
"aarch64-apple-ios-sim",
"x86_64-apple-darwin",
"x86_64-apple-ios",
],
)
wallet_engine_crates.spec(package = "anyhow", repositories = ["wallet_engine_bindgen_crates"], version = "=1.0.102")
wallet_engine_crates.spec(package = "uniffi", features = ["cli"], repositories = ["wallet_engine_bindgen_crates"], version = "=0.32.0")
wallet_engine_crates.from_specs(
name = "wallet_engine_bindgen_crates",
cargo_lockfile = "//third-party/wallet-engine:Bindgen.Cargo.Bazel.lock",
supported_platform_triples = [
"aarch64-apple-darwin",
"x86_64-apple-darwin",
],
)
use_repo(
wallet_engine_crates,
"wallet_engine_bindgen_crates",
"wallet_engine_crates",
)
# Third-party crates of the Rust MTProto engine (third-party/mtproto-engine). Every version is pinned
# with `=` to third-party/mtproto-engine/Cargo.lock. Kept apart from wallet_engine_crates so the two
# lockfiles move independently. Repin only this repository:
# CARGO_BAZEL_REPIN=1 CARGO_BAZEL_REPIN_ONLY=mtproto_engine_crates ./build-input/bazel-9.2.0-darwin-arm64 build //third-party/mtproto-engine:mtproto_engine_ffi_archive
mtproto_engine_crates = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
mtproto_engine_crates.spec(package = "aes", features = ["zeroize"], repositories = ["mtproto_engine_crates"], version = "=0.8.4")
mtproto_engine_crates.spec(package = "base64", repositories = ["mtproto_engine_crates"], version = "=0.22.1")
mtproto_engine_crates.spec(package = "flate2", default_features = False, features = ["rust_backend"], repositories = ["mtproto_engine_crates"], version = "=1.1.10")
mtproto_engine_crates.spec(package = "getrandom", repositories = ["mtproto_engine_crates"], version = "=0.3.4")
mtproto_engine_crates.spec(package = "hmac", repositories = ["mtproto_engine_crates"], version = "=0.12.1")
mtproto_engine_crates.spec(package = "libc", repositories = ["mtproto_engine_crates"], version = "=0.2.189")
mtproto_engine_crates.spec(package = "mio", features = ["net", "os-poll"], repositories = ["mtproto_engine_crates"], version = "=1.2.2")
mtproto_engine_crates.spec(package = "num-bigint", repositories = ["mtproto_engine_crates"], version = "=0.4.8")
mtproto_engine_crates.spec(package = "num-integer", repositories = ["mtproto_engine_crates"], version = "=0.1.47")
mtproto_engine_crates.spec(package = "num-traits", repositories = ["mtproto_engine_crates"], version = "=0.2.19")
mtproto_engine_crates.spec(package = "sha1", repositories = ["mtproto_engine_crates"], version = "=0.10.7")
# `asm` selects sha2's aarch64 SHA-256 backend (src/sha256/aarch64.rs). Cargo enables it only for
# aarch64 via a target-specific dependency, which Bazel does not read.
mtproto_engine_crates.spec(package = "sha2", features = ["asm"], repositories = ["mtproto_engine_crates"], version = "=0.10.9")
mtproto_engine_crates.spec(package = "thiserror", repositories = ["mtproto_engine_crates"], version = "=2.0.17")
mtproto_engine_crates.spec(package = "zeroize", repositories = ["mtproto_engine_crates"], version = "=1.9.0")
# ARMv8 AES instructions. Cargo gets this from third-party/mtproto-engine/.cargo/config.toml, which
# Bazel does not read. Without it the engine silently runs software AES (~15x slower).
mtproto_engine_crates.annotation(crate = "aes", repositories = ["mtproto_engine_crates"], rustc_flags = ["--cfg", "aes_armv8", "-Copt-level=3"])
# rules_rust builds these at the compilation mode's opt-level (0 under --configuration=debug_*).
# They hold the engine's non-generic hot code (hashing, inflate, checksums, DH bignum math), which
# does not inline into the -Copt-level=3 engine crates. Generic-only crates (cipher, digest, hmac,
# inout, ...) are instantiated inside the engine crates and need no annotation.
mtproto_engine_crates.annotation(crate = "sha1", repositories = ["mtproto_engine_crates"], rustc_flags = ["-Copt-level=3"])
mtproto_engine_crates.annotation(crate = "sha2", repositories = ["mtproto_engine_crates"], rustc_flags = ["-Copt-level=3"])
mtproto_engine_crates.annotation(crate = "flate2", repositories = ["mtproto_engine_crates"], rustc_flags = ["-Copt-level=3"])
mtproto_engine_crates.annotation(crate = "miniz_oxide", repositories = ["mtproto_engine_crates"], rustc_flags = ["-Copt-level=3"])
mtproto_engine_crates.annotation(crate = "adler2", repositories = ["mtproto_engine_crates"], rustc_flags = ["-Copt-level=3"])
mtproto_engine_crates.annotation(crate = "simd-adler32", repositories = ["mtproto_engine_crates"], rustc_flags = ["-Copt-level=3"])
mtproto_engine_crates.annotation(crate = "crc32fast", repositories = ["mtproto_engine_crates"], rustc_flags = ["-Copt-level=3"])
mtproto_engine_crates.annotation(crate = "num-bigint", repositories = ["mtproto_engine_crates"], rustc_flags = ["-Copt-level=3"])
mtproto_engine_crates.annotation(crate = "num-integer", repositories = ["mtproto_engine_crates"], rustc_flags = ["-Copt-level=3"])
mtproto_engine_crates.from_specs(
name = "mtproto_engine_crates",
cargo_lockfile = "//third-party/mtproto-engine:Cargo.Bazel.lock",
supported_platform_triples = [
"aarch64-apple-darwin",
"aarch64-apple-ios",
"aarch64-apple-ios-sim",
"x86_64-apple-darwin",
"x86_64-apple-ios",
],
)
use_repo(mtproto_engine_crates, "mtproto_engine_crates")
bazel_dep(name = "rules_go", version = "0.60.0", repo_name = "io_bazel_rules_go")
go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.24.2")
bazel_dep(name = "gazelle", version = "0.43.0", repo_name = "bazel_gazelle")
go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//submodules/TgVoipWebrtc/tgcalls/tools/go_sfu:go.mod")
use_repo(
go_deps,
"com_github_pion_datachannel",
"com_github_pion_dtls_v3",
"com_github_pion_ice_v4",
"com_github_pion_logging",
"com_github_pion_rtcp",
"com_github_pion_sctp",
"com_github_pion_srtp_v3",
)
bazel_dep(name = "rules_xcodeproj")
local_path_override(
module_name = "rules_xcodeproj",
path = "./build-system/bazel-rules/rules_xcodeproj",
)
bazel_dep(name = "rules_apple", repo_name = "build_bazel_rules_apple")
local_path_override(
module_name = "rules_apple",
path = "./build-system/bazel-rules/rules_apple",
)
bazel_dep(name = "rules_swift", repo_name = "build_bazel_rules_swift")
local_path_override(
module_name = "rules_swift",
path = "./build-system/bazel-rules/rules_swift",
)
bazel_dep(name = "apple_support", repo_name = "build_bazel_apple_support")
local_path_override(
module_name = "apple_support",
path = "./build-system/bazel-rules/apple_support",
)
# Must be registered here: only the root module outranks rules_cc's generic
# @local_config_cc toolchain, which rules_swift rejects ("Invalid target triple: local").
apple_cc_configure = use_extension("@build_bazel_apple_support//crosstool:setup.bzl", "apple_cc_configure_extension")
use_repo(apple_cc_configure, "local_config_apple_cc", "local_config_apple_cc_toolchains")
register_toolchains("@local_config_apple_cc_toolchains//:all")
http_file(
name = "cmake_tar_gz",
sha256 = "3be85f5b999e327b1ac7d804cbc9acd767059e9f603c42ec2765f6ab68fbd367",
urls = ["https://github.com/Kitware/CMake/releases/download/v4.1.2/cmake-4.1.2-macos-universal.tar.gz"],
)
http_file(
name = "meson_tar_gz",
sha256 = "999b65f21c03541cf11365489c1fad22e2418bb0c3d50ca61139f2eec09d5496",
urls = ["https://github.com/mesonbuild/meson/releases/download/1.6.0/meson-1.6.0.tar.gz"],
)
http_file(
name = "ninja-mac_zip",
sha256 = "89a287444b5b3e98f88a945afa50ce937b8ffd1dcc59c555ad9b1baf855298c9",
urls = ["https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-mac.zip"],
)
http_file(
name = "flatbuffers_zip",
sha256 = "c5cd6a605ff20350c7faa19d8eeb599df6117ea4aabd16ac58a7eb5ba82df4e7",
urls = ["https://github.com/google/flatbuffers/archive/refs/tags/v24.12.23.zip"],
)
provisioning_profile_repository = use_extension("@build_bazel_rules_apple//apple:apple.bzl", "provisioning_profile_repository_extension")
#provisioning_profile_repository.setup(
# fallback_profiles = "//path/to/some:filegroup", # Profiles to use if one isn't found locally
#)
bazel_dep(name = "build_configuration")
local_path_override(
module_name = "build_configuration",
path = "./build-input/configuration-repository",
)