blob: 4d041ca64006e290a20bc3a53910c6a1bbd76f14 [file] [log] [blame]
Austin Schuha1d006e2022-09-14 21:50:42 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_py_library", "flatbuffer_rust_library")
James Kuszmaulf01da392023-12-14 11:22:14 -08002load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
Austin Schuha1d006e2022-09-14 21:50:42 -07003load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
Brian Silvermand1805b62022-07-20 20:47:05 -07004load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")
James Kuszmaule4aa01d2022-06-28 14:09:02 -07005load("//aos:flatbuffers.bzl", "cc_static_flatbuffer")
Brian Silverman7edd1ce2022-07-23 16:10:54 -07006load("//tools/build_rules:autocxx.bzl", "autocxx_library")
Austin Schuh972e47e2018-12-20 17:20:58 -08007
Austin Schuh00e302a2020-12-21 11:53:30 -08008exports_files(["aos_dump_autocomplete.sh"])
9
Brian Silverman258b9172015-09-19 14:32:57 -040010filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070011 name = "prime_binaries",
12 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080013 "//aos:aos_dump",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070014 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080015 "//aos:aos_send",
Austin Schuh91d8d062020-11-02 17:11:13 -080016 "//aos/starter",
Brian Silverman6470f442018-08-05 12:08:16 -070017 ],
18 visibility = ["//visibility:public"],
Austin Schuh1eceeb92015-11-08 21:16:06 -080019)
Austin Schuhc80dd152016-02-29 01:47:44 -080020
21filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070022 name = "prime_start_binaries",
23 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080024 "//aos/events/logging:logger_main",
Brian Silverman6470f442018-08-05 12:08:16 -070025 ],
26 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080027)
Brian Silverman6470f442018-08-05 12:08:16 -070028
Austin Schuhc80dd152016-02-29 01:47:44 -080029filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070030 name = "prime_binaries_stripped",
31 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080032 "//aos:aos_dump.stripped",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070033 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080034 "//aos:aos_send.stripped",
Austin Schuh44e0b142021-10-16 15:51:10 -070035 "//aos/starter:starter_stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070036 ],
37 visibility = ["//visibility:public"],
38)
39
40filegroup(
41 name = "prime_start_binaries_stripped",
42 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080043 "//aos/events/logging:logger_main.stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070044 ],
45 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080046)
Sabina Davis2ed5ea22017-09-26 22:27:42 -070047
48cc_library(
John Park33858a32018-09-28 23:05:48 -070049 name = "math",
50 hdrs = [
51 "commonmath.h",
52 ],
John Park33858a32018-09-28 23:05:48 -070053 visibility = ["//visibility:public"],
54)
55
Brian Silverman6470f442018-08-05 12:08:16 -070056py_library(
57 name = "python_init",
58 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -080059 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -070060 visibility = ["//visibility:public"],
Sabina Davis2ed5ea22017-09-26 22:27:42 -070061)
John Park33858a32018-09-28 23:05:48 -070062
63cc_library(
Austin Schuh972e47e2018-12-20 17:20:58 -080064 name = "macros",
65 hdrs = [
John Park33858a32018-09-28 23:05:48 -070066 "macros.h",
John Park33858a32018-09-28 23:05:48 -070067 ],
68 visibility = ["//visibility:public"],
69)
70
71cc_library(
72 name = "gtest_prod",
73 hdrs = [
74 "gtest_prod.h",
75 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080076 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070077 visibility = ["//visibility:public"],
78)
79
80cc_library(
John Park33858a32018-09-28 23:05:48 -070081 name = "unique_malloc_ptr",
82 hdrs = [
83 "unique_malloc_ptr.h",
84 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080085 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070086 visibility = ["//visibility:public"],
87)
88
89cc_library(
90 name = "condition",
91 srcs = [
92 "condition.cc",
93 ],
94 hdrs = [
95 "condition.h",
96 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080097 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070098 visibility = ["//visibility:public"],
Austin Schuh972e47e2018-12-20 17:20:58 -080099 deps = [
100 "//aos/ipc_lib:aos_sync",
Austin Schuh972e47e2018-12-20 17:20:58 -0800101 "//aos/mutex",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700102 "@com_github_google_glog//:glog",
Austin Schuh972e47e2018-12-20 17:20:58 -0800103 ],
John Park33858a32018-09-28 23:05:48 -0700104)
105
106cc_test(
107 name = "condition_test",
108 srcs = [
109 "condition_test.cc",
110 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800111 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700112 deps = [
113 ":condition",
114 "//aos:die",
John Park398c74a2018-10-20 21:17:39 -0700115 "//aos/ipc_lib:aos_sync",
116 "//aos/ipc_lib:core_lib",
Austin Schuh972e47e2018-12-20 17:20:58 -0800117 "//aos/logging",
118 "//aos/mutex",
John Park33858a32018-09-28 23:05:48 -0700119 "//aos/testing:googletest",
120 "//aos/testing:prevent_exit",
121 "//aos/testing:test_shm",
Austin Schuh972e47e2018-12-20 17:20:58 -0800122 "//aos/time",
John Park33858a32018-09-28 23:05:48 -0700123 ],
124)
125
126cc_library(
127 name = "die",
128 srcs = [
129 "die.cc",
130 ],
131 hdrs = [
132 "die.h",
133 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800134 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800135 visibility = ["//visibility:public"],
John Park33858a32018-09-28 23:05:48 -0700136 deps = [
137 "//aos:macros",
138 "//aos/libc:aos_strerror",
139 ],
John Park33858a32018-09-28 23:05:48 -0700140)
141
John Park33858a32018-09-28 23:05:48 -0700142cc_test(
143 name = "die_test",
144 srcs = [
145 "die_test.cc",
146 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800147 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700148 deps = [
149 ":die",
150 "//aos/testing:googletest",
151 ],
152)
153
John Park398c74a2018-10-20 21:17:39 -0700154cc_binary(
155 name = "dump_rtprio",
156 srcs = [
157 "dump_rtprio.cc",
158 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800159 target_compatible_with = ["@platforms//os:linux"],
John Park398c74a2018-10-20 21:17:39 -0700160 deps = [
Austin Schuh14056182023-01-03 21:19:38 -0800161 "//aos:init",
162 "//aos/events:shm_event_loop",
Austin Schuh972e47e2018-12-20 17:20:58 -0800163 "//aos/time",
Austin Schuh14056182023-01-03 21:19:38 -0800164 "//aos/util:top",
Brian Silverman3eb60d22021-11-04 19:06:47 -0700165 "@com_github_google_glog//:glog",
John Park398c74a2018-10-20 21:17:39 -0700166 ],
167)
168
169cc_library(
John Park398c74a2018-10-20 21:17:39 -0700170 name = "init",
171 srcs = [
172 "init.cc",
173 ],
174 hdrs = [
175 "init.h",
176 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800177 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800178 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700179 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700180 ":realtime",
James Kuszmaula791b762023-07-13 14:56:21 -0700181 ":uuid",
John Park398c74a2018-10-20 21:17:39 -0700182 "//aos:die",
Austin Schuhfc0caa82023-08-25 14:25:03 -0700183 "//aos/logging",
John Park398c74a2018-10-20 21:17:39 -0700184 ],
John Park398c74a2018-10-20 21:17:39 -0700185)
186
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700187autocxx_library(
188 name = "init_rs",
189 srcs = ["init.rs"],
190 crate_name = "aos_init",
191 libs = [
192 ":init",
193 ],
194 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700195 target_compatible_with = select({
196 "//conditions:default": ["//tools/platforms/rust:has_support"],
197 "//tools:has_msan": ["@platforms//:incompatible"],
198 }),
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700199 visibility = ["//visibility:public"],
200)
201
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700202autocxx_library(
203 name = "test_init_rs",
204 testonly = True,
205 srcs = ["test_init.rs"],
206 crate_name = "aos_test_init",
207 libs = [
208 "//aos/testing:tmpdir",
209 ],
210 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
211 target_compatible_with = select({
212 "//conditions:default": ["//tools/platforms/rust:has_support"],
213 "//tools:has_msan": ["@platforms//:incompatible"],
214 }),
215 visibility = ["//visibility:public"],
216 deps = [
217 ":init_rs",
218 ],
219)
220
Alex Perrycb7da4b2019-08-28 19:35:56 -0700221cc_library(
222 name = "realtime",
223 srcs = [
224 "realtime.cc",
225 ],
226 hdrs = [
227 "realtime.h",
228 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800229 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700230 visibility = ["//visibility:public"],
231 deps = [
James Kuszmaula791b762023-07-13 14:56:21 -0700232 ":uuid",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700233 "@com_github_google_glog//:glog",
234 ],
235)
236
James Kuszmaulf01da392023-12-14 11:22:14 -0800237static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700238 name = "configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700239 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800240 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700241 visibility = ["//visibility:public"],
Austin Schuhcb108412019-10-13 16:09:54 -0700242)
243
James Kuszmaule4aa01d2022-06-28 14:09:02 -0700244cc_static_flatbuffer(
245 name = "configuration_schema",
246 function = "aos::ConfigurationSchema",
247 target = ":configuration_fbs_reflection_out",
248 visibility = ["//visibility:public"],
249)
250
Alex Perryd5e13572020-02-22 15:15:08 -0800251flatbuffer_ts_library(
252 name = "configuration_ts_fbs",
253 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800254 target_compatible_with = ["@platforms//os:linux"],
Alex Perryd5e13572020-02-22 15:15:08 -0800255 visibility = ["//visibility:public"],
256)
257
Brian Silverman28760272020-02-02 13:21:51 -0800258flatbuffer_py_library(
James Kuszmaul7daef362019-12-31 18:28:17 -0800259 name = "configuration_fbs_python",
260 srcs = ["configuration.fbs"],
261 namespace = "aos",
262 tables = [
263 "Configuration",
264 "Channel",
James Kuszmaul84ff3e52020-01-03 19:48:53 -0800265 "Connection",
James Kuszmaul7daef362019-12-31 18:28:17 -0800266 "Map",
267 "Node",
268 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800269 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul7daef362019-12-31 18:28:17 -0800270 visibility = ["//visibility:public"],
271)
272
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700273flatbuffer_rust_library(
274 name = "configuration_rust_fbs",
275 srcs = ["configuration.fbs"],
276 crate_name = "aos_configuration_fbs",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700277 target_compatible_with = select({
278 "//conditions:default": ["//tools/platforms/rust:has_support"],
279 "//tools:has_msan": ["@platforms//:incompatible"],
280 }),
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700281 visibility = ["//visibility:public"],
282)
283
John Park398c74a2018-10-20 21:17:39 -0700284cc_library(
285 name = "configuration",
286 srcs = [
287 "configuration.cc",
288 ],
289 hdrs = [
290 "configuration.h",
291 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800292 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800293 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700294 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700295 ":configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700296 ":flatbuffer_merge",
297 ":flatbuffers",
298 ":json_to_flatbuffer",
John Park398c74a2018-10-20 21:17:39 -0700299 "//aos:unique_malloc_ptr",
Austin Schuh83cbb1e2023-06-23 12:59:02 -0700300 "//aos/ipc_lib:index",
Austin Schuh217a9782019-12-21 23:02:50 -0800301 "//aos/network:team_number",
Austin Schuhcb108412019-10-13 16:09:54 -0700302 "//aos/util:file",
303 "@com_github_google_glog//:glog",
304 "@com_google_absl//absl/container:btree",
305 "@com_google_absl//absl/strings",
John Park398c74a2018-10-20 21:17:39 -0700306 ],
John Park398c74a2018-10-20 21:17:39 -0700307)
308
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700309cc_library(
310 name = "configuration_for_rust",
311 srcs = [
312 "configuration_for_rust.cc",
313 ],
314 hdrs = [
315 "configuration_for_rust.h",
316 ],
317 deps = [
318 ":configuration",
319 ":for_rust",
Adam Snaider770b97b2023-08-04 21:07:48 -0700320 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700321 ],
322)
323
324autocxx_library(
325 name = "configuration_rs",
326 srcs = ["configuration.rs"],
327 crate_name = "aos_configuration",
328 libs = [
329 ":configuration",
330 ":configuration_for_rust",
331 ":configuration_fbs",
332 ],
333 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700334 target_compatible_with = select({
335 "//conditions:default": ["//tools/platforms/rust:has_support"],
336 "//tools:has_msan": ["@platforms//:incompatible"],
337 }),
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700338 visibility = ["//visibility:public"],
339 deps = [
340 ":configuration_rust_fbs",
341 ":flatbuffers_rs",
Adam Snaider770b97b2023-08-04 21:07:48 -0700342 "@crate_index//:thiserror",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700343 ],
344)
345
346rust_test(
347 name = "configuration_rs_test",
348 crate = ":configuration_rs",
349 data = [
350 "//aos/testdata:test_configs",
351 ],
352 # TODO: Make Rust play happy with pic vs nopic. Details at:
353 # https://github.com/bazelbuild/rules_rust/issues/118
354 rustc_flags = ["-Crelocation-model=static"],
355)
356
James Kuszmaulabb77132020-08-01 19:56:16 -0700357flatbuffer_ts_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800358 name = "json_to_flatbuffer_fbs_ts",
James Kuszmaulabb77132020-08-01 19:56:16 -0700359 srcs = ["json_to_flatbuffer.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800360 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700361 visibility = ["//aos:__subpackages__"],
362)
363
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700364flatbuffer_cc_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800365 name = "json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700366 srcs = ["json_to_flatbuffer.fbs"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800367 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -0800368 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700369 visibility = ["//aos:__subpackages__"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700370)
371
Brian Silvermand1805b62022-07-20 20:47:05 -0700372flatbuffer_rust_library(
373 name = "json_to_flatbuffer_rust_fbs",
374 srcs = ["json_to_flatbuffer.fbs"],
375 crate_name = "aos_json_to_flatbuffer_fbs",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700376 target_compatible_with = select({
377 "//conditions:default": ["//tools/platforms/rust:has_support"],
378 "//tools:has_msan": ["@platforms//:incompatible"],
379 }),
Brian Silvermand1805b62022-07-20 20:47:05 -0700380 visibility = ["//aos:__subpackages__"],
381)
382
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700383cc_library(
Austin Schuh43c6a352019-09-30 22:22:10 -0700384 name = "flatbuffer_utils",
385 srcs = ["flatbuffer_utils.cc"],
386 hdrs = ["flatbuffer_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800387 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700388 visibility = ["//visibility:public"],
Austin Schuh43c6a352019-09-30 22:22:10 -0700389 deps = [
390 "@com_github_google_flatbuffers//:flatbuffers",
Brian Silvermancf4fb662021-02-10 17:54:53 -0800391 "@com_github_google_glog//:glog",
Austin Schuh43c6a352019-09-30 22:22:10 -0700392 ],
393)
394
395cc_library(
Austin Schuhd7e252d2019-10-06 13:51:02 -0700396 name = "json_tokenizer",
397 srcs = ["json_tokenizer.cc"],
398 hdrs = ["json_tokenizer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800399 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhd7e252d2019-10-06 13:51:02 -0700400 deps = [
Pallavi Madhukare2eb2812022-07-19 09:56:09 -0700401 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700402 "@com_github_google_glog//:glog",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700403 "@com_google_absl//absl/strings",
404 ],
405)
406
407cc_library(
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700408 name = "json_to_flatbuffer",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800409 srcs = [
410 "flatbuffer_introspection.cc",
411 "json_to_flatbuffer.cc",
412 ],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700413 hdrs = ["json_to_flatbuffer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800414 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700415 visibility = ["//visibility:public"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700416 deps = [
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700417 ":fast_string_builder",
Austin Schuh43c6a352019-09-30 22:22:10 -0700418 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700419 ":flatbuffers",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700420 ":json_tokenizer",
James Kuszmaulf5eb4682023-09-22 17:16:59 -0700421 "//aos/flatbuffers:builder",
Austin Schuhbba10282021-03-20 22:03:28 -0700422 "//aos/util:file",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700423 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuhe93d8642019-10-13 15:27:07 -0700424 "@com_github_google_glog//:glog",
Austin Schuhd339a9b2019-10-05 21:33:32 -0700425 "@com_google_absl//absl/strings",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700426 ],
427)
428
429cc_test(
430 name = "json_to_flatbuffer_test",
431 srcs = [
432 "json_to_flatbuffer_test.cc",
433 ],
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800434 data = [
435 ":json_to_flatbuffer_fbs_reflection_out",
Alexander Yeee61cac32023-02-11 19:40:40 -0800436 ":json_to_flatbuffer_test_spaces.json",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800437 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800438 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700439 deps = [
Alexander Yeee61cac32023-02-11 19:40:40 -0800440 ":flatbuffer_merge",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700441 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800442 ":json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700443 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700444 "//aos/testing:path",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700445 ],
446)
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700447
Tyler Chatow5e369a42019-11-23 11:57:31 -0800448cc_test(
449 name = "flatbuffer_introspection_test",
450 srcs = [
451 "flatbuffer_introspection_test.cc",
452 ],
453 data = [
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800454 ":json_to_flatbuffer_fbs_reflection_out",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800455 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800456 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800457 deps = [
458 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800459 ":json_to_flatbuffer_fbs",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800460 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700461 "//aos/testing:path",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800462 "//aos/util:file",
463 "@com_github_google_flatbuffers//:flatbuffers",
464 ],
465)
466
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700467cc_library(
468 name = "flatbuffer_merge",
469 srcs = ["flatbuffer_merge.cc"],
470 hdrs = ["flatbuffer_merge.h"],
471 copts = ["-Wno-cast-align"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800472 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700473 visibility = ["//visibility:public"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700474 deps = [
475 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700476 ":flatbuffers",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700477 "@com_github_google_flatbuffers//:flatbuffers",
478 ],
479)
480
481cc_test(
482 name = "flatbuffer_merge_test",
483 srcs = [
484 "flatbuffer_merge_test.cc",
485 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800486 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700487 deps = [
488 ":flatbuffer_merge",
489 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800490 ":json_to_flatbuffer_fbs",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700491 "//aos/testing:googletest",
492 ],
493)
Austin Schuhe93d8642019-10-13 15:27:07 -0700494
495cc_library(
496 name = "flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700497 srcs = [
498 "flatbuffers.cc",
499 ],
Austin Schuhe93d8642019-10-13 15:27:07 -0700500 hdrs = [
501 "flatbuffers.h",
502 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800503 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh40485ed2019-10-26 21:51:44 -0700504 visibility = ["//visibility:public"],
Austin Schuhe93d8642019-10-13 15:27:07 -0700505 deps = [
James Kuszmaulad8a8082020-02-14 21:21:58 -0800506 "//aos:macros",
Brian Silverman354697a2020-09-22 21:06:32 -0700507 "//aos/containers:resizeable_buffer",
davidjevans8b9b52f2021-09-17 08:57:30 -0700508 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700509 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700510 "@com_github_google_glog//:glog",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700511 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800512 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700513 ],
514)
Austin Schuhcb108412019-10-13 16:09:54 -0700515
Brian Silvermand1805b62022-07-20 20:47:05 -0700516rust_library(
517 name = "flatbuffers_rs",
518 srcs = ["flatbuffers.rs"],
519 crate_name = "aos_flatbuffers",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700520 target_compatible_with = select({
521 "//conditions:default": ["//tools/platforms/rust:has_support"],
522 "//tools:has_msan": ["@platforms//:incompatible"],
523 }),
Brian Silvermand1805b62022-07-20 20:47:05 -0700524 visibility = ["//visibility:public"],
525 deps = [
526 "@com_github_google_flatbuffers//rust",
527 ],
528)
529
530rust_test(
531 name = "flatbuffers_rs_test",
532 crate = ":flatbuffers_rs",
533 deps = [
534 ":json_to_flatbuffer_rust_fbs",
535 ],
536)
537
Austin Schuhcb108412019-10-13 16:09:54 -0700538cc_test(
539 name = "configuration_test",
540 srcs = [
541 "configuration_test.cc",
542 ],
543 data = [
Nathan Leong307c9692022-10-08 15:25:03 -0700544 "//aos/events:ping_fbs_reflection_out",
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700545 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700546 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700547 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700548 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800549 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700550 deps = [
551 ":configuration",
Nathan Leong307c9692022-10-08 15:25:03 -0700552 "//aos/events:ping_fbs",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800553 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700554 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700555 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700556 "//aos/testing:test_logging",
557 ],
558)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700559
560cc_binary(
561 name = "config_flattener",
562 srcs = [
563 "config_flattener.cc",
564 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800565 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700566 visibility = ["//visibility:public"],
567 deps = [
568 ":configuration",
569 ":init",
570 "//aos/util:file",
571 "@com_github_google_glog//:glog",
572 ],
573)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800574
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800575cc_library(
576 name = "aos_cli_utils",
577 srcs = [
578 "aos_cli_utils.cc",
579 ],
580 hdrs = [
581 "aos_cli_utils.h",
582 ],
583 target_compatible_with = ["@platforms//os:linux"],
584 visibility = ["//visibility:public"],
585 deps = [
586 ":configuration",
587 "//aos:init",
588 "//aos/events:shm_event_loop",
Austin Schuh893d7f42022-09-16 15:01:35 -0700589 "//aos/events:simulated_event_loop",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800590 "@com_github_google_glog//:glog",
591 ],
592)
593
Tyler Chatow5e369a42019-11-23 11:57:31 -0800594cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800595 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800596 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800597 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800598 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800599 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800600 visibility = ["//visibility:public"],
601 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800602 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800603 ":configuration",
604 ":json_to_flatbuffer",
605 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800606 "@com_github_google_glog//:glog",
607 ],
608)
609
610cc_binary(
611 name = "aos_send",
612 srcs = [
613 "aos_send.cc",
614 ],
615 target_compatible_with = ["@platforms//os:linux"],
616 visibility = ["//visibility:public"],
617 deps = [
618 ":aos_cli_utils",
619 ":configuration",
620 ":init",
621 ":json_to_flatbuffer",
622 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800623 "@com_github_google_glog//:glog",
624 ],
625)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500626
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700627cc_binary(
628 name = "aos_graph_nodes",
629 srcs = [
630 "aos_graph_nodes.cc",
631 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800632 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700633 visibility = ["//visibility:public"],
634 deps = [
635 ":configuration",
636 ":json_to_flatbuffer",
637 "//aos:init",
638 "//aos/events:shm_event_loop",
639 "@com_github_google_glog//:glog",
640 ],
641)
642
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500643cc_library(
644 name = "ftrace",
645 srcs = [
646 "ftrace.cc",
647 ],
648 hdrs = [
649 "ftrace.h",
650 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800651 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500652 visibility = ["//visibility:public"],
653 deps = [
654 "@com_github_google_glog//:glog",
Austin Schuhc9de0132022-12-26 18:04:53 -0800655 "@com_google_absl//absl/strings",
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500656 ],
657)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700658
659cc_library(
660 name = "fast_string_builder",
661 srcs = [
662 "fast_string_builder.cc",
663 ],
664 hdrs = [
665 "fast_string_builder.h",
666 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800667 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700668 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700669 deps = [
670 "@com_github_google_glog//:glog",
671 "@com_google_absl//absl/strings",
672 "@com_google_absl//absl/strings:str_format",
673 ],
674)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700675
Austin Schuhcc6070c2020-10-10 20:25:56 -0700676cc_test(
677 name = "realtime_test",
678 srcs = [
679 "realtime_test.cc",
680 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800681 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700682 visibility = ["//visibility:public"],
683 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700684 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700685 ":realtime",
Austin Schuh77f3f222022-06-10 16:49:21 -0700686 "@com_github_gflags_gflags//:gflags",
687 "@com_github_google_glog//:glog",
688 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700689 ],
690)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800691
692cc_test(
693 name = "flatbuffers_test",
694 srcs = [
695 "flatbuffers_test.cc",
696 ],
697 deps = [
698 ":flatbuffers",
699 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800700 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800701 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700702 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800703 ],
704)
Austin Schuh0de30f32020-12-06 12:44:28 -0800705
706py_binary(
707 name = "flatbuffers_static",
708 srcs = ["flatbuffers_static.py"],
709 visibility = ["//visibility:public"],
710)
Austin Schuh4385b142021-03-14 21:31:13 -0700711
712cc_library(
713 name = "uuid",
714 srcs = ["uuid.cc"],
715 hdrs = ["uuid.h"],
716 target_compatible_with = ["@platforms//os:linux"],
717 visibility = ["//visibility:public"],
718 deps = [
Austin Schuh8902fa52021-03-14 22:39:24 -0700719 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700720 "@com_github_google_flatbuffers//:flatbuffers",
721 "@com_github_google_glog//:glog",
722 "@com_google_absl//absl/types:span",
723 ],
724)
725
726cc_test(
James Kuszmaul05ccb272023-07-13 10:58:14 -0700727 name = "uuid_collision_test",
James Kuszmaula791b762023-07-13 14:56:21 -0700728 timeout = "eternal",
James Kuszmaul05ccb272023-07-13 10:58:14 -0700729 srcs = ["uuid_collision_test.cc"],
James Kuszmaula791b762023-07-13 14:56:21 -0700730 shard_count = 2,
James Kuszmaul05ccb272023-07-13 10:58:14 -0700731 target_compatible_with = ["@platforms//os:linux"],
732 deps = [
733 ":uuid",
734 "//aos/testing:googletest",
735 ],
736)
737
738cc_test(
Austin Schuh4385b142021-03-14 21:31:13 -0700739 name = "uuid_test",
740 srcs = ["uuid_test.cc"],
741 target_compatible_with = ["@platforms//os:linux"],
742 deps = [
743 ":uuid",
744 "//aos/testing:googletest",
745 ],
746)
Austin Schuh30f74292021-08-13 17:25:26 -0700747
Brian Silverman10599932022-08-15 06:05:53 -0700748cc_library(
749 name = "uuid_for_rust",
750 hdrs = ["uuid_for_rust.h"],
751 deps = [
752 ":uuid",
753 ],
754)
755
756autocxx_library(
757 name = "uuid_rs",
758 srcs = ["uuid.rs"],
759 crate_name = "aos_uuid",
760 libs = [
761 ":uuid",
762 ":uuid_for_rust",
763 ],
764 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
765 rs_deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700766 "@crate_index//:uuid",
Brian Silverman10599932022-08-15 06:05:53 -0700767 ],
Austin Schuhdfa127f2022-10-26 21:17:42 -0700768 target_compatible_with = select({
769 "//conditions:default": ["//tools/platforms/rust:has_support"],
770 "//tools:has_msan": ["@platforms//:incompatible"],
771 }),
Brian Silverman10599932022-08-15 06:05:53 -0700772 visibility = ["//visibility:public"],
773)
774
Austin Schuh30f74292021-08-13 17:25:26 -0700775cc_binary(
776 name = "aos_graph_channels",
777 srcs = [
778 "aos_graph_channels.cc",
779 ],
780 target_compatible_with = ["@platforms//os:linux"],
781 deps = [
782 "//aos:configuration",
783 "//aos:init",
784 "//aos:json_to_flatbuffer",
785 "//aos/events:simulated_event_loop",
786 "//aos/events/logging:log_reader",
787 "//aos/time",
788 "@com_github_gflags_gflags//:gflags",
789 "@com_github_google_glog//:glog",
790 ],
791)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700792
793cc_library(
794 name = "for_rust",
795 hdrs = [
796 "for_rust.h",
797 ],
798 visibility = ["//visibility:public"],
799 deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700800 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700801 ],
802)
Austin Schuhb0e439d2023-05-15 10:55:40 -0700803
804cc_library(
805 name = "sha256",
806 srcs = [
807 "sha256.cc",
808 ],
809 hdrs = ["sha256.h"],
810 target_compatible_with = ["@platforms//os:linux"],
811 visibility = ["//visibility:public"],
812 deps = [
James Kuszmaul56802ab2023-08-23 15:18:34 -0700813 "//aos/util:file",
Austin Schuhb0e439d2023-05-15 10:55:40 -0700814 "@boringssl//:crypto",
815 "@com_google_absl//absl/types:span",
816 ],
817)
James Kuszmaul56802ab2023-08-23 15:18:34 -0700818
819cc_test(
820 name = "sha256_test",
821 srcs = ["sha256_test.cc"],
822 deps = [
823 ":sha256",
824 "//aos/testing:googletest",
825 "//aos/testing:tmpdir",
826 ],
827)