blob: 34af003734480b64e91cb4f25b7c6abc7083504c [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")
2load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
Brian Silvermand1805b62022-07-20 20:47:05 -07003load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")
James Kuszmaule4aa01d2022-06-28 14:09:02 -07004load("//aos:flatbuffers.bzl", "cc_static_flatbuffer")
Brian Silverman7edd1ce2022-07-23 16:10:54 -07005load("//tools/build_rules:autocxx.bzl", "autocxx_library")
Austin Schuh972e47e2018-12-20 17:20:58 -08006
Austin Schuh00e302a2020-12-21 11:53:30 -08007exports_files(["aos_dump_autocomplete.sh"])
8
Brian Silverman258b9172015-09-19 14:32:57 -04009filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070010 name = "prime_binaries",
11 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080012 "//aos:aos_dump",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070013 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080014 "//aos:aos_send",
Austin Schuh91d8d062020-11-02 17:11:13 -080015 "//aos/starter",
Brian Silverman6470f442018-08-05 12:08:16 -070016 ],
17 visibility = ["//visibility:public"],
Austin Schuh1eceeb92015-11-08 21:16:06 -080018)
Austin Schuhc80dd152016-02-29 01:47:44 -080019
20filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070021 name = "prime_start_binaries",
22 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080023 "//aos/events/logging:logger_main",
Brian Silverman6470f442018-08-05 12:08:16 -070024 ],
25 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080026)
Brian Silverman6470f442018-08-05 12:08:16 -070027
Austin Schuhc80dd152016-02-29 01:47:44 -080028filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070029 name = "prime_binaries_stripped",
30 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080031 "//aos:aos_dump.stripped",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070032 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080033 "//aos:aos_send.stripped",
Austin Schuh44e0b142021-10-16 15:51:10 -070034 "//aos/starter:starter_stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070035 ],
36 visibility = ["//visibility:public"],
37)
38
39filegroup(
40 name = "prime_start_binaries_stripped",
41 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080042 "//aos/events/logging:logger_main.stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070043 ],
44 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080045)
Sabina Davis2ed5ea22017-09-26 22:27:42 -070046
47cc_library(
John Park33858a32018-09-28 23:05:48 -070048 name = "math",
49 hdrs = [
50 "commonmath.h",
51 ],
John Park33858a32018-09-28 23:05:48 -070052 visibility = ["//visibility:public"],
53)
54
Brian Silverman6470f442018-08-05 12:08:16 -070055py_library(
56 name = "python_init",
57 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -080058 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -070059 visibility = ["//visibility:public"],
Sabina Davis2ed5ea22017-09-26 22:27:42 -070060)
John Park33858a32018-09-28 23:05:48 -070061
62cc_library(
Austin Schuh972e47e2018-12-20 17:20:58 -080063 name = "macros",
64 hdrs = [
John Park33858a32018-09-28 23:05:48 -070065 "macros.h",
John Park33858a32018-09-28 23:05:48 -070066 ],
67 visibility = ["//visibility:public"],
68)
69
70cc_library(
71 name = "gtest_prod",
72 hdrs = [
73 "gtest_prod.h",
74 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080075 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070076 visibility = ["//visibility:public"],
77)
78
79cc_library(
John Park33858a32018-09-28 23:05:48 -070080 name = "unique_malloc_ptr",
81 hdrs = [
82 "unique_malloc_ptr.h",
83 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080084 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070085 visibility = ["//visibility:public"],
86)
87
88cc_library(
89 name = "condition",
90 srcs = [
91 "condition.cc",
92 ],
93 hdrs = [
94 "condition.h",
95 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080096 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070097 visibility = ["//visibility:public"],
Austin Schuh972e47e2018-12-20 17:20:58 -080098 deps = [
99 "//aos/ipc_lib:aos_sync",
Austin Schuh972e47e2018-12-20 17:20:58 -0800100 "//aos/mutex",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700101 "@com_github_google_glog//:glog",
Austin Schuh972e47e2018-12-20 17:20:58 -0800102 ],
John Park33858a32018-09-28 23:05:48 -0700103)
104
105cc_test(
106 name = "condition_test",
107 srcs = [
108 "condition_test.cc",
109 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800110 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700111 deps = [
112 ":condition",
113 "//aos:die",
John Park398c74a2018-10-20 21:17:39 -0700114 "//aos/ipc_lib:aos_sync",
115 "//aos/ipc_lib:core_lib",
Austin Schuh972e47e2018-12-20 17:20:58 -0800116 "//aos/logging",
117 "//aos/mutex",
John Park33858a32018-09-28 23:05:48 -0700118 "//aos/testing:googletest",
119 "//aos/testing:prevent_exit",
120 "//aos/testing:test_shm",
Austin Schuh972e47e2018-12-20 17:20:58 -0800121 "//aos/time",
John Park33858a32018-09-28 23:05:48 -0700122 ],
123)
124
125cc_library(
126 name = "die",
127 srcs = [
128 "die.cc",
129 ],
130 hdrs = [
131 "die.h",
132 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800133 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800134 visibility = ["//visibility:public"],
John Park33858a32018-09-28 23:05:48 -0700135 deps = [
136 "//aos:macros",
137 "//aos/libc:aos_strerror",
138 ],
John Park33858a32018-09-28 23:05:48 -0700139)
140
John Park33858a32018-09-28 23:05:48 -0700141cc_test(
142 name = "die_test",
143 srcs = [
144 "die_test.cc",
145 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800146 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700147 deps = [
148 ":die",
149 "//aos/testing:googletest",
150 ],
151)
152
John Park398c74a2018-10-20 21:17:39 -0700153cc_binary(
154 name = "dump_rtprio",
155 srcs = [
156 "dump_rtprio.cc",
157 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800158 target_compatible_with = ["@platforms//os:linux"],
John Park398c74a2018-10-20 21:17:39 -0700159 deps = [
Austin Schuh14056182023-01-03 21:19:38 -0800160 "//aos:init",
161 "//aos/events:shm_event_loop",
Austin Schuh972e47e2018-12-20 17:20:58 -0800162 "//aos/time",
Austin Schuh14056182023-01-03 21:19:38 -0800163 "//aos/util:top",
Brian Silverman3eb60d22021-11-04 19:06:47 -0700164 "@com_github_google_glog//:glog",
John Park398c74a2018-10-20 21:17:39 -0700165 ],
166)
167
168cc_library(
John Park398c74a2018-10-20 21:17:39 -0700169 name = "init",
170 srcs = [
171 "init.cc",
172 ],
173 hdrs = [
174 "init.h",
175 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800176 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800177 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700178 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700179 ":realtime",
James Kuszmaula791b762023-07-13 14:56:21 -0700180 ":uuid",
John Park398c74a2018-10-20 21:17:39 -0700181 "//aos:die",
Austin Schuhfc0caa82023-08-25 14:25:03 -0700182 "//aos/logging",
John Park398c74a2018-10-20 21:17:39 -0700183 ],
John Park398c74a2018-10-20 21:17:39 -0700184)
185
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700186autocxx_library(
187 name = "init_rs",
188 srcs = ["init.rs"],
189 crate_name = "aos_init",
190 libs = [
191 ":init",
192 ],
193 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700194 target_compatible_with = select({
195 "//conditions:default": ["//tools/platforms/rust:has_support"],
196 "//tools:has_msan": ["@platforms//:incompatible"],
197 }),
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700198 visibility = ["//visibility:public"],
199)
200
Alex Perrycb7da4b2019-08-28 19:35:56 -0700201cc_library(
202 name = "realtime",
203 srcs = [
204 "realtime.cc",
205 ],
206 hdrs = [
207 "realtime.h",
208 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800209 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700210 visibility = ["//visibility:public"],
211 deps = [
James Kuszmaula791b762023-07-13 14:56:21 -0700212 ":uuid",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700213 "@com_github_google_glog//:glog",
214 ],
215)
216
Austin Schuhcb108412019-10-13 16:09:54 -0700217flatbuffer_cc_library(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700218 name = "configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700219 srcs = ["configuration.fbs"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700220 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800221 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700222 visibility = ["//visibility:public"],
Austin Schuhcb108412019-10-13 16:09:54 -0700223)
224
James Kuszmaule4aa01d2022-06-28 14:09:02 -0700225cc_static_flatbuffer(
226 name = "configuration_schema",
227 function = "aos::ConfigurationSchema",
228 target = ":configuration_fbs_reflection_out",
229 visibility = ["//visibility:public"],
230)
231
Alex Perryd5e13572020-02-22 15:15:08 -0800232flatbuffer_ts_library(
233 name = "configuration_ts_fbs",
234 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800235 target_compatible_with = ["@platforms//os:linux"],
Alex Perryd5e13572020-02-22 15:15:08 -0800236 visibility = ["//visibility:public"],
237)
238
Brian Silverman28760272020-02-02 13:21:51 -0800239flatbuffer_py_library(
James Kuszmaul7daef362019-12-31 18:28:17 -0800240 name = "configuration_fbs_python",
241 srcs = ["configuration.fbs"],
242 namespace = "aos",
243 tables = [
244 "Configuration",
245 "Channel",
James Kuszmaul84ff3e52020-01-03 19:48:53 -0800246 "Connection",
James Kuszmaul7daef362019-12-31 18:28:17 -0800247 "Map",
248 "Node",
249 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800250 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul7daef362019-12-31 18:28:17 -0800251 visibility = ["//visibility:public"],
252)
253
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700254flatbuffer_rust_library(
255 name = "configuration_rust_fbs",
256 srcs = ["configuration.fbs"],
257 crate_name = "aos_configuration_fbs",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700258 target_compatible_with = select({
259 "//conditions:default": ["//tools/platforms/rust:has_support"],
260 "//tools:has_msan": ["@platforms//:incompatible"],
261 }),
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700262 visibility = ["//visibility:public"],
263)
264
John Park398c74a2018-10-20 21:17:39 -0700265cc_library(
266 name = "configuration",
267 srcs = [
268 "configuration.cc",
269 ],
270 hdrs = [
271 "configuration.h",
272 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800273 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800274 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700275 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700276 ":configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700277 ":flatbuffer_merge",
278 ":flatbuffers",
279 ":json_to_flatbuffer",
John Park398c74a2018-10-20 21:17:39 -0700280 "//aos:unique_malloc_ptr",
Austin Schuh83cbb1e2023-06-23 12:59:02 -0700281 "//aos/ipc_lib:index",
Austin Schuh217a9782019-12-21 23:02:50 -0800282 "//aos/network:team_number",
Austin Schuhcb108412019-10-13 16:09:54 -0700283 "//aos/util:file",
284 "@com_github_google_glog//:glog",
285 "@com_google_absl//absl/container:btree",
286 "@com_google_absl//absl/strings",
John Park398c74a2018-10-20 21:17:39 -0700287 ],
John Park398c74a2018-10-20 21:17:39 -0700288)
289
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700290cc_library(
291 name = "configuration_for_rust",
292 srcs = [
293 "configuration_for_rust.cc",
294 ],
295 hdrs = [
296 "configuration_for_rust.h",
297 ],
298 deps = [
299 ":configuration",
300 ":for_rust",
Adam Snaider770b97b2023-08-04 21:07:48 -0700301 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700302 ],
303)
304
305autocxx_library(
306 name = "configuration_rs",
307 srcs = ["configuration.rs"],
308 crate_name = "aos_configuration",
309 libs = [
310 ":configuration",
311 ":configuration_for_rust",
312 ":configuration_fbs",
313 ],
314 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700315 target_compatible_with = select({
316 "//conditions:default": ["//tools/platforms/rust:has_support"],
317 "//tools:has_msan": ["@platforms//:incompatible"],
318 }),
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700319 visibility = ["//visibility:public"],
320 deps = [
321 ":configuration_rust_fbs",
322 ":flatbuffers_rs",
Adam Snaider770b97b2023-08-04 21:07:48 -0700323 "@crate_index//:thiserror",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700324 ],
325)
326
327rust_test(
328 name = "configuration_rs_test",
329 crate = ":configuration_rs",
330 data = [
331 "//aos/testdata:test_configs",
332 ],
333 # TODO: Make Rust play happy with pic vs nopic. Details at:
334 # https://github.com/bazelbuild/rules_rust/issues/118
335 rustc_flags = ["-Crelocation-model=static"],
336)
337
James Kuszmaulabb77132020-08-01 19:56:16 -0700338flatbuffer_ts_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800339 name = "json_to_flatbuffer_fbs_ts",
James Kuszmaulabb77132020-08-01 19:56:16 -0700340 srcs = ["json_to_flatbuffer.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800341 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700342 visibility = ["//aos:__subpackages__"],
343)
344
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700345flatbuffer_cc_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800346 name = "json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700347 srcs = ["json_to_flatbuffer.fbs"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800348 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800349 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700350 visibility = ["//aos:__subpackages__"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700351)
352
Brian Silvermand1805b62022-07-20 20:47:05 -0700353flatbuffer_rust_library(
354 name = "json_to_flatbuffer_rust_fbs",
355 srcs = ["json_to_flatbuffer.fbs"],
356 crate_name = "aos_json_to_flatbuffer_fbs",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700357 target_compatible_with = select({
358 "//conditions:default": ["//tools/platforms/rust:has_support"],
359 "//tools:has_msan": ["@platforms//:incompatible"],
360 }),
Brian Silvermand1805b62022-07-20 20:47:05 -0700361 visibility = ["//aos:__subpackages__"],
362)
363
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700364cc_library(
Austin Schuh43c6a352019-09-30 22:22:10 -0700365 name = "flatbuffer_utils",
366 srcs = ["flatbuffer_utils.cc"],
367 hdrs = ["flatbuffer_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800368 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700369 visibility = ["//visibility:public"],
Austin Schuh43c6a352019-09-30 22:22:10 -0700370 deps = [
371 "@com_github_google_flatbuffers//:flatbuffers",
Brian Silvermancf4fb662021-02-10 17:54:53 -0800372 "@com_github_google_glog//:glog",
Austin Schuh43c6a352019-09-30 22:22:10 -0700373 ],
374)
375
376cc_library(
Austin Schuhd7e252d2019-10-06 13:51:02 -0700377 name = "json_tokenizer",
378 srcs = ["json_tokenizer.cc"],
379 hdrs = ["json_tokenizer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800380 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhd7e252d2019-10-06 13:51:02 -0700381 deps = [
Pallavi Madhukare2eb2812022-07-19 09:56:09 -0700382 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700383 "@com_github_google_glog//:glog",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700384 "@com_google_absl//absl/strings",
385 ],
386)
387
388cc_library(
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700389 name = "json_to_flatbuffer",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800390 srcs = [
391 "flatbuffer_introspection.cc",
392 "json_to_flatbuffer.cc",
393 ],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700394 hdrs = ["json_to_flatbuffer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800395 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700396 visibility = ["//visibility:public"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700397 deps = [
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700398 ":fast_string_builder",
Austin Schuh43c6a352019-09-30 22:22:10 -0700399 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700400 ":flatbuffers",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700401 ":json_tokenizer",
Austin Schuhbba10282021-03-20 22:03:28 -0700402 "//aos/util:file",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700403 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuhe93d8642019-10-13 15:27:07 -0700404 "@com_github_google_glog//:glog",
Austin Schuhd339a9b2019-10-05 21:33:32 -0700405 "@com_google_absl//absl/strings",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700406 ],
407)
408
409cc_test(
410 name = "json_to_flatbuffer_test",
411 srcs = [
412 "json_to_flatbuffer_test.cc",
413 ],
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800414 data = [
415 ":json_to_flatbuffer_fbs_reflection_out",
Alexander Yeee61cac32023-02-11 19:40:40 -0800416 ":json_to_flatbuffer_test_spaces.json",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800417 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800418 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700419 deps = [
Alexander Yeee61cac32023-02-11 19:40:40 -0800420 ":flatbuffer_merge",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700421 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800422 ":json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700423 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700424 "//aos/testing:path",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700425 ],
426)
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700427
Tyler Chatow5e369a42019-11-23 11:57:31 -0800428cc_test(
429 name = "flatbuffer_introspection_test",
430 srcs = [
431 "flatbuffer_introspection_test.cc",
432 ],
433 data = [
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800434 ":json_to_flatbuffer_fbs_reflection_out",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800435 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800436 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800437 deps = [
438 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800439 ":json_to_flatbuffer_fbs",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800440 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700441 "//aos/testing:path",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800442 "//aos/util:file",
443 "@com_github_google_flatbuffers//:flatbuffers",
444 ],
445)
446
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700447cc_library(
448 name = "flatbuffer_merge",
449 srcs = ["flatbuffer_merge.cc"],
450 hdrs = ["flatbuffer_merge.h"],
451 copts = ["-Wno-cast-align"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800452 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700453 visibility = ["//visibility:public"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700454 deps = [
455 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700456 ":flatbuffers",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700457 "@com_github_google_flatbuffers//:flatbuffers",
458 ],
459)
460
461cc_test(
462 name = "flatbuffer_merge_test",
463 srcs = [
464 "flatbuffer_merge_test.cc",
465 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800466 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700467 deps = [
468 ":flatbuffer_merge",
469 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800470 ":json_to_flatbuffer_fbs",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700471 "//aos/testing:googletest",
472 ],
473)
Austin Schuhe93d8642019-10-13 15:27:07 -0700474
475cc_library(
476 name = "flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700477 srcs = [
478 "flatbuffers.cc",
479 ],
Austin Schuhe93d8642019-10-13 15:27:07 -0700480 hdrs = [
481 "flatbuffers.h",
482 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800483 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh40485ed2019-10-26 21:51:44 -0700484 visibility = ["//visibility:public"],
Austin Schuhe93d8642019-10-13 15:27:07 -0700485 deps = [
James Kuszmaulad8a8082020-02-14 21:21:58 -0800486 "//aos:macros",
Brian Silverman354697a2020-09-22 21:06:32 -0700487 "//aos/containers:resizeable_buffer",
davidjevans8b9b52f2021-09-17 08:57:30 -0700488 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700489 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700490 "@com_github_google_glog//:glog",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700491 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800492 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700493 ],
494)
Austin Schuhcb108412019-10-13 16:09:54 -0700495
Brian Silvermand1805b62022-07-20 20:47:05 -0700496rust_library(
497 name = "flatbuffers_rs",
498 srcs = ["flatbuffers.rs"],
499 crate_name = "aos_flatbuffers",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700500 target_compatible_with = select({
501 "//conditions:default": ["//tools/platforms/rust:has_support"],
502 "//tools:has_msan": ["@platforms//:incompatible"],
503 }),
Brian Silvermand1805b62022-07-20 20:47:05 -0700504 visibility = ["//visibility:public"],
505 deps = [
506 "@com_github_google_flatbuffers//rust",
507 ],
508)
509
510rust_test(
511 name = "flatbuffers_rs_test",
512 crate = ":flatbuffers_rs",
513 deps = [
514 ":json_to_flatbuffer_rust_fbs",
515 ],
516)
517
Austin Schuhcb108412019-10-13 16:09:54 -0700518cc_test(
519 name = "configuration_test",
520 srcs = [
521 "configuration_test.cc",
522 ],
523 data = [
Nathan Leong307c9692022-10-08 15:25:03 -0700524 "//aos/events:ping_fbs_reflection_out",
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700525 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700526 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700527 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700528 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800529 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700530 deps = [
531 ":configuration",
Nathan Leong307c9692022-10-08 15:25:03 -0700532 "//aos/events:ping_fbs",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800533 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700534 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700535 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700536 "//aos/testing:test_logging",
537 ],
538)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700539
540cc_binary(
541 name = "config_flattener",
542 srcs = [
543 "config_flattener.cc",
544 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800545 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700546 visibility = ["//visibility:public"],
547 deps = [
548 ":configuration",
549 ":init",
550 "//aos/util:file",
551 "@com_github_google_glog//:glog",
552 ],
553)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800554
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800555cc_library(
556 name = "aos_cli_utils",
557 srcs = [
558 "aos_cli_utils.cc",
559 ],
560 hdrs = [
561 "aos_cli_utils.h",
562 ],
563 target_compatible_with = ["@platforms//os:linux"],
564 visibility = ["//visibility:public"],
565 deps = [
566 ":configuration",
567 "//aos:init",
568 "//aos/events:shm_event_loop",
Austin Schuh893d7f42022-09-16 15:01:35 -0700569 "//aos/events:simulated_event_loop",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800570 "@com_github_google_glog//:glog",
571 ],
572)
573
Tyler Chatow5e369a42019-11-23 11:57:31 -0800574cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800575 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800576 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800577 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800578 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800579 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800580 visibility = ["//visibility:public"],
581 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800582 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800583 ":configuration",
584 ":json_to_flatbuffer",
585 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800586 "@com_github_google_glog//:glog",
587 ],
588)
589
590cc_binary(
591 name = "aos_send",
592 srcs = [
593 "aos_send.cc",
594 ],
595 target_compatible_with = ["@platforms//os:linux"],
596 visibility = ["//visibility:public"],
597 deps = [
598 ":aos_cli_utils",
599 ":configuration",
600 ":init",
601 ":json_to_flatbuffer",
602 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800603 "@com_github_google_glog//:glog",
604 ],
605)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500606
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700607cc_binary(
608 name = "aos_graph_nodes",
609 srcs = [
610 "aos_graph_nodes.cc",
611 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800612 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700613 visibility = ["//visibility:public"],
614 deps = [
615 ":configuration",
616 ":json_to_flatbuffer",
617 "//aos:init",
618 "//aos/events:shm_event_loop",
619 "@com_github_google_glog//:glog",
620 ],
621)
622
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500623cc_library(
624 name = "ftrace",
625 srcs = [
626 "ftrace.cc",
627 ],
628 hdrs = [
629 "ftrace.h",
630 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800631 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500632 visibility = ["//visibility:public"],
633 deps = [
634 "@com_github_google_glog//:glog",
Austin Schuhc9de0132022-12-26 18:04:53 -0800635 "@com_google_absl//absl/strings",
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500636 ],
637)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700638
639cc_library(
640 name = "fast_string_builder",
641 srcs = [
642 "fast_string_builder.cc",
643 ],
644 hdrs = [
645 "fast_string_builder.h",
646 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800647 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700648 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700649 deps = [
650 "@com_github_google_glog//:glog",
651 "@com_google_absl//absl/strings",
652 "@com_google_absl//absl/strings:str_format",
653 ],
654)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700655
Austin Schuhcc6070c2020-10-10 20:25:56 -0700656cc_test(
657 name = "realtime_test",
658 srcs = [
659 "realtime_test.cc",
660 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800661 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700662 visibility = ["//visibility:public"],
663 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700664 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700665 ":realtime",
Austin Schuh77f3f222022-06-10 16:49:21 -0700666 "@com_github_gflags_gflags//:gflags",
667 "@com_github_google_glog//:glog",
668 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700669 ],
670)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800671
672cc_test(
673 name = "flatbuffers_test",
674 srcs = [
675 "flatbuffers_test.cc",
676 ],
677 deps = [
678 ":flatbuffers",
679 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800680 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800681 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700682 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800683 ],
684)
Austin Schuh0de30f32020-12-06 12:44:28 -0800685
686py_binary(
687 name = "flatbuffers_static",
688 srcs = ["flatbuffers_static.py"],
689 visibility = ["//visibility:public"],
690)
Austin Schuh4385b142021-03-14 21:31:13 -0700691
692cc_library(
693 name = "uuid",
694 srcs = ["uuid.cc"],
695 hdrs = ["uuid.h"],
696 target_compatible_with = ["@platforms//os:linux"],
697 visibility = ["//visibility:public"],
698 deps = [
Austin Schuh8902fa52021-03-14 22:39:24 -0700699 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700700 "@com_github_google_flatbuffers//:flatbuffers",
701 "@com_github_google_glog//:glog",
702 "@com_google_absl//absl/types:span",
703 ],
704)
705
706cc_test(
James Kuszmaul05ccb272023-07-13 10:58:14 -0700707 name = "uuid_collision_test",
James Kuszmaula791b762023-07-13 14:56:21 -0700708 timeout = "eternal",
James Kuszmaul05ccb272023-07-13 10:58:14 -0700709 srcs = ["uuid_collision_test.cc"],
James Kuszmaula791b762023-07-13 14:56:21 -0700710 shard_count = 2,
James Kuszmaul05ccb272023-07-13 10:58:14 -0700711 target_compatible_with = ["@platforms//os:linux"],
712 deps = [
713 ":uuid",
714 "//aos/testing:googletest",
715 ],
716)
717
718cc_test(
Austin Schuh4385b142021-03-14 21:31:13 -0700719 name = "uuid_test",
720 srcs = ["uuid_test.cc"],
721 target_compatible_with = ["@platforms//os:linux"],
722 deps = [
723 ":uuid",
724 "//aos/testing:googletest",
725 ],
726)
Austin Schuh30f74292021-08-13 17:25:26 -0700727
Brian Silverman10599932022-08-15 06:05:53 -0700728cc_library(
729 name = "uuid_for_rust",
730 hdrs = ["uuid_for_rust.h"],
731 deps = [
732 ":uuid",
733 ],
734)
735
736autocxx_library(
737 name = "uuid_rs",
738 srcs = ["uuid.rs"],
739 crate_name = "aos_uuid",
740 libs = [
741 ":uuid",
742 ":uuid_for_rust",
743 ],
744 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
745 rs_deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700746 "@crate_index//:uuid",
Brian Silverman10599932022-08-15 06:05:53 -0700747 ],
Austin Schuhdfa127f2022-10-26 21:17:42 -0700748 target_compatible_with = select({
749 "//conditions:default": ["//tools/platforms/rust:has_support"],
750 "//tools:has_msan": ["@platforms//:incompatible"],
751 }),
Brian Silverman10599932022-08-15 06:05:53 -0700752 visibility = ["//visibility:public"],
753)
754
Austin Schuh30f74292021-08-13 17:25:26 -0700755cc_binary(
756 name = "aos_graph_channels",
757 srcs = [
758 "aos_graph_channels.cc",
759 ],
760 target_compatible_with = ["@platforms//os:linux"],
761 deps = [
762 "//aos:configuration",
763 "//aos:init",
764 "//aos:json_to_flatbuffer",
765 "//aos/events:simulated_event_loop",
766 "//aos/events/logging:log_reader",
767 "//aos/time",
768 "@com_github_gflags_gflags//:gflags",
769 "@com_github_google_glog//:glog",
770 ],
771)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700772
773cc_library(
774 name = "for_rust",
775 hdrs = [
776 "for_rust.h",
777 ],
778 visibility = ["//visibility:public"],
779 deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700780 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700781 ],
782)
Austin Schuhb0e439d2023-05-15 10:55:40 -0700783
784cc_library(
785 name = "sha256",
786 srcs = [
787 "sha256.cc",
788 ],
789 hdrs = ["sha256.h"],
790 target_compatible_with = ["@platforms//os:linux"],
791 visibility = ["//visibility:public"],
792 deps = [
793 "@boringssl//:crypto",
794 "@com_google_absl//absl/types:span",
795 ],
796)