forked from EVerest/EVerest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMODULE.bazel
More file actions
235 lines (205 loc) · 8.46 KB
/
Copy pathMODULE.bazel
File metadata and controls
235 lines (205 loc) · 8.46 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
module(
name = "everest-core",
version = "2026.02.0",
)
###############################################################################
# B A Z E L C E N T R A L R E G I S T R Y # https://registry.bazel.build/
###############################################################################
bazel_dep(name = "bazel_features", version = "1.21.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
BOOST_VERSION = "1.87.0"
bazel_dep(name = "boost.asio", version = BOOST_VERSION)
bazel_dep(name = "boost.process", version = BOOST_VERSION)
bazel_dep(name = "boost.uuid", version = BOOST_VERSION)
bazel_dep(name = "boost.exception", version = BOOST_VERSION)
bazel_dep(name = "boost.log", version = BOOST_VERSION)
bazel_dep(name = "boost.utility", version = BOOST_VERSION)
bazel_dep(name = "boost.program_options", version = BOOST_VERSION)
bazel_dep(name = "catch2", version = "3.13.0")
bazel_dep(name = "cxx.rs", version = "1.0.194")
bazel_dep(name = "fast_float", version = "6.1.6")
bazel_dep(name = "fmt", version = "12.1.0", repo_name = "com_github_fmtlib_fmt")
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")
bazel_dep(name = "nlohmann_json", version = "3.12.0.bcr.1", repo_name = "com_github_nlohmann_json")
bazel_dep(name = "libcap", version = "2.27.bcr.1")
bazel_dep(name = "libevent", version = "2.1.12-stable.bcr.0")
bazel_dep(name = "openssl", version = "3.3.1.bcr.9")
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "pugixml", version = "1.15")
bazel_dep(name = "rapidyaml", version = "0.10.0")
bazel_dep(name = "rules_cc", version = "0.2.14")
bazel_dep(name = "rules_foreign_cc", version = "0.14.0")
bazel_dep(name = "rules_license", version = "0.0.7")
bazel_dep(name = "rules_python", version = "1.3.0")
bazel_dep(name = "rules_rust", version = "0.67.0")
bazel_dep(name = "rules_shell", version = "0.6.1")
bazel_dep(name = "pybind11_bazel", version = "3.0.0")
bazel_dep(name = "sqlite3", version = "3.51.2")
single_version_override(
module_name = "boost.context",
patches = ["//third-party/bazel/patches:boost.context.patch"],
)
###############################################################################
# C R O S S - C O M P I L A T I O N T O O L C H A I N S
###############################################################################
# Module extension for cross-compilation toolchain repositories
cross_toolchains = use_extension("//third-party/bazel/toolchains:extensions.bzl", "toolchains")
use_repo(
cross_toolchains,
"cc_toolchain_aarch64-linux-gnu-x86_64-linux",
"cc_toolchain_aarch64-linux-musl-x86_64-linux",
"cc_toolchain_armv7-linux-gnu-x86_64-linux",
"cc_toolchain_armv7-linux-musl-x86_64-linux",
)
register_toolchains("@cc_toolchain_aarch64-linux-gnu-x86_64-linux//:aarch64-linux-glibc_toolchain_toolchain")
register_toolchains("@cc_toolchain_aarch64-linux-musl-x86_64-linux//:aarch64-linux-musl_toolchain_toolchain")
register_toolchains("@cc_toolchain_armv7-linux-musl-x86_64-linux//:armv7-linux-musl_toolchain_toolchain")
register_toolchains("@cc_toolchain_armv7-linux-gnu-x86_64-linux//:armv7-linux-gnu_toolchain_toolchain")
###############################################################################
# N O N M O D U L E
###############################################################################
deps = use_extension("//third-party/bazel:extension.bzl", "deps")
use_repo(
deps,
"com_github_HowardHinnant_date",
"com_github_pboettch_json-schema-validator",
"com_github_warmcatt_libwebsockets",
"mosquitto",
"openssl_source",
"pybind11_json",
"sigslot",
)
###############################################################################
# P Y T H O N
###############################################################################
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
is_default = True,
python_version = "3.10",
)
use_repo(python, "python_3_10")
pip_deps = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip_deps.parse(
hub_name = "everest-testing_pip_deps",
python_version = "3.10",
requirements_lock = "//applications/utils:requirements-bazel.txt",
)
use_repo(pip_deps, "everest-testing_pip_deps")
###############################################################################
# R U S T
###############################################################################
RUST_EDITION = "2021"
RUST_VERSION = "1.86.0"
RUST_EXTRA_TARGET_TRIPLES = {
"armv7-unknown-linux-musleabihf": [
"@platforms//os:linux",
"@platforms//cpu:armv7",
"@everest-core//third-party/bazel/toolchains:musl",
],
"armv7-unknown-linux-gnueabihf": [
"@platforms//os:linux",
"@platforms//cpu:armv7",
"@everest-core//third-party/bazel/toolchains:gnu",
],
"aarch64-unknown-linux-musl": [
"@platforms//os:linux",
"@platforms//cpu:aarch64",
"@everest-core//third-party/bazel/toolchains:musl",
],
"aarch64-unknown-linux-gnu": [
"@platforms//os:linux",
"@platforms//cpu:aarch64",
"@everest-core//third-party/bazel/toolchains:gnu",
],
}
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = RUST_EDITION,
versions = [
RUST_VERSION,
"nightly/2026-02-09",
],
)
[
rust.repository_set(
name = "rust_{}_repository_set_x86_64-unknown-linux-gnu".format(target_triple.replace("-", "_")),
edition = RUST_EDITION,
exec_triple = "x86_64-unknown-linux-gnu",
target_compatible_with = target_compatible_with,
target_triple = target_triple,
versions = [RUST_VERSION],
)
for (target_triple, target_compatible_with) in RUST_EXTRA_TARGET_TRIPLES.items()
]
use_repo(rust, "rust_toolchains")
register_toolchains("@rust_toolchains//:all")
everest_crate_index = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
everest_crate_index.from_cargo(
name = "everest_crate_index",
cargo_lockfile = "@everest-core//modules:Cargo.lock",
manifests = [
"@everest-core//modules:Cargo.toml",
"@everest-core//modules/HardwareDrivers/PowerMeters/RsIskraMeter:Cargo.toml",
"@everest-core//modules/HardwareDrivers/Payment/RsPaymentTerminal:Cargo.toml",
"@everest-core//modules/Examples/RustExamples/RsExample:Cargo.toml",
"@everest-core//modules/Examples/RustExamples/RsExampleUser:Cargo.toml",
],
supported_platform_triples = [
"x86_64-unknown-linux-gnu",
"aarch64-unknown-linux-gnu",
"armv7-unknown-linux-gnueabihf",
],
)
everest_crate_index.annotation(
crate = "everestrs",
crate_features = ["build_bazel"],
repositories = ["everest_crate_index"],
deps = [
"//lib/everest/framework/everestrs/everestrs",
"//lib/everest/framework/everestrs/everestrs-build",
],
)
use_repo(
everest_crate_index,
"everest_crate_index",
)
###############################################################################
# F R A M E W O R K C R A T E I N D I C E S
###############################################################################
everest_framework_crate_index = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
everest_framework_crate_index.from_cargo(
name = "everest_framework_crate_index",
cargo_lockfile = "//lib/everest/framework/everestrs:Cargo.lock",
manifests = [
"//lib/everest/framework/everestrs:Cargo.toml",
"//lib/everest/framework/everestrs/everestrs:Cargo.toml",
"//lib/everest/framework/everestrs/everestrs-build:Cargo.toml",
"//lib/everest/framework/everestrs/everestrs-derive:Cargo.toml",
],
supported_platform_triples = [
"x86_64-unknown-linux-gnu",
"aarch64-unknown-linux-gnu",
"armv7-unknown-linux-gnueabihf",
],
)
everest_crate_index.annotation(
crate = "log",
override_target_lib = "@everest_framework_crate_index//:log",
repositories = ["everest_crate_index"],
)
use_repo(
everest_framework_crate_index,
"everest_framework_crate_index",
)
everest_framework_validate_crate_index = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
everest_framework_validate_crate_index.from_cargo(
name = "everest_framework_validate_crate_index",
cargo_lockfile = "//lib/everest/framework/bazel/validate:Cargo.lock",
manifests = [
"//lib/everest/framework/bazel/validate:Cargo.toml",
],
)
use_repo(
everest_framework_validate_crate_index,
"everest_framework_validate_crate_index",
)