blob: 64c6587e64b5e01922c89b6185aa53de89fc3552 [file] [log] [blame]
Adam Snaider0967b812023-11-02 15:29:43 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_py_library")
Austin Schuha1d006e2022-09-14 21:50:42 -07002load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
James Kuszmaule4aa01d2022-06-28 14:09:02 -07003load("//aos:flatbuffers.bzl", "cc_static_flatbuffer")
Austin Schuh8f99c822024-05-05 22:43:40 -07004load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
Brian Silverman7edd1ce2022-07-23 16:10:54 -07005load("//tools/build_rules:autocxx.bzl", "autocxx_library")
Austin Schuh605d5ff2024-05-10 15:59:54 -07006load("//tools/build_rules:select.bzl", "compiler_select")
Adam Snaiderf560ae92023-11-07 17:06:21 -08007load("//tools/rust:defs.bzl", "flatbuffer_rust_library", "rust_library")
Austin Schuh972e47e2018-12-20 17:20:58 -08008
Austin Schuh00e302a2020-12-21 11:53:30 -08009exports_files(["aos_dump_autocomplete.sh"])
10
Brian Silverman258b9172015-09-19 14:32:57 -040011filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070012 name = "prime_binaries",
13 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080014 "//aos:aos_dump",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070015 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080016 "//aos:aos_send",
Austin Schuh91d8d062020-11-02 17:11:13 -080017 "//aos/starter",
Brian Silverman6470f442018-08-05 12:08:16 -070018 ],
19 visibility = ["//visibility:public"],
Austin Schuh1eceeb92015-11-08 21:16:06 -080020)
Austin Schuhc80dd152016-02-29 01:47:44 -080021
22filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070023 name = "prime_start_binaries",
24 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080025 "//aos/events/logging:logger_main",
Brian Silverman6470f442018-08-05 12:08:16 -070026 ],
27 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080028)
Brian Silverman6470f442018-08-05 12:08:16 -070029
Austin Schuhc80dd152016-02-29 01:47:44 -080030filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070031 name = "prime_binaries_stripped",
32 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080033 "//aos:aos_dump.stripped",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070034 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080035 "//aos:aos_send.stripped",
Austin Schuh44e0b142021-10-16 15:51:10 -070036 "//aos/starter:starter_stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070037 ],
38 visibility = ["//visibility:public"],
39)
40
41filegroup(
42 name = "prime_start_binaries_stripped",
43 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080044 "//aos/events/logging:logger_main.stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070045 ],
46 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080047)
Sabina Davis2ed5ea22017-09-26 22:27:42 -070048
49cc_library(
John Park33858a32018-09-28 23:05:48 -070050 name = "math",
51 hdrs = [
52 "commonmath.h",
53 ],
John Park33858a32018-09-28 23:05:48 -070054 visibility = ["//visibility:public"],
55)
56
Brian Silverman6470f442018-08-05 12:08:16 -070057py_library(
58 name = "python_init",
59 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -080060 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -070061 visibility = ["//visibility:public"],
Sabina Davis2ed5ea22017-09-26 22:27:42 -070062)
John Park33858a32018-09-28 23:05:48 -070063
64cc_library(
Austin Schuh972e47e2018-12-20 17:20:58 -080065 name = "macros",
66 hdrs = [
John Park33858a32018-09-28 23:05:48 -070067 "macros.h",
John Park33858a32018-09-28 23:05:48 -070068 ],
69 visibility = ["//visibility:public"],
70)
71
72cc_library(
73 name = "gtest_prod",
74 hdrs = [
75 "gtest_prod.h",
76 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080077 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070078 visibility = ["//visibility:public"],
79)
80
81cc_library(
John Park33858a32018-09-28 23:05:48 -070082 name = "unique_malloc_ptr",
83 hdrs = [
84 "unique_malloc_ptr.h",
85 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080086 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070087 visibility = ["//visibility:public"],
88)
89
90cc_library(
91 name = "condition",
92 srcs = [
93 "condition.cc",
94 ],
95 hdrs = [
96 "condition.h",
97 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080098 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070099 visibility = ["//visibility:public"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800100 deps = [
101 "//aos/ipc_lib:aos_sync",
Austin Schuh972e47e2018-12-20 17:20:58 -0800102 "//aos/mutex",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700103 "@com_google_absl//absl/log",
104 "@com_google_absl//absl/log:check",
Austin Schuh972e47e2018-12-20 17:20:58 -0800105 ],
John Park33858a32018-09-28 23:05:48 -0700106)
107
108cc_test(
109 name = "condition_test",
110 srcs = [
111 "condition_test.cc",
112 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800113 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700114 deps = [
115 ":condition",
116 "//aos:die",
John Park398c74a2018-10-20 21:17:39 -0700117 "//aos/ipc_lib:aos_sync",
118 "//aos/ipc_lib:core_lib",
Austin Schuh972e47e2018-12-20 17:20:58 -0800119 "//aos/logging",
120 "//aos/mutex",
John Park33858a32018-09-28 23:05:48 -0700121 "//aos/testing:googletest",
122 "//aos/testing:prevent_exit",
123 "//aos/testing:test_shm",
Austin Schuh972e47e2018-12-20 17:20:58 -0800124 "//aos/time",
John Park33858a32018-09-28 23:05:48 -0700125 ],
126)
127
128cc_library(
129 name = "die",
130 srcs = [
131 "die.cc",
132 ],
133 hdrs = [
134 "die.h",
135 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800136 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800137 visibility = ["//visibility:public"],
John Park33858a32018-09-28 23:05:48 -0700138 deps = [
139 "//aos:macros",
140 "//aos/libc:aos_strerror",
141 ],
John Park33858a32018-09-28 23:05:48 -0700142)
143
John Park33858a32018-09-28 23:05:48 -0700144cc_test(
145 name = "die_test",
146 srcs = [
147 "die_test.cc",
148 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800149 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700150 deps = [
151 ":die",
152 "//aos/testing:googletest",
153 ],
154)
155
John Park398c74a2018-10-20 21:17:39 -0700156cc_binary(
157 name = "dump_rtprio",
158 srcs = [
159 "dump_rtprio.cc",
160 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800161 target_compatible_with = ["@platforms//os:linux"],
John Park398c74a2018-10-20 21:17:39 -0700162 deps = [
Austin Schuh14056182023-01-03 21:19:38 -0800163 "//aos:init",
164 "//aos/events:shm_event_loop",
Austin Schuh972e47e2018-12-20 17:20:58 -0800165 "//aos/time",
Austin Schuh14056182023-01-03 21:19:38 -0800166 "//aos/util:top",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700167 "@com_google_absl//absl/log",
168 "@com_google_absl//absl/log:check",
John Park398c74a2018-10-20 21:17:39 -0700169 ],
170)
171
172cc_library(
John Park398c74a2018-10-20 21:17:39 -0700173 name = "init",
174 srcs = [
175 "init.cc",
176 ],
177 hdrs = [
178 "init.h",
179 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800180 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800181 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700182 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700183 ":realtime",
James Kuszmaula791b762023-07-13 14:56:21 -0700184 ":uuid",
John Park398c74a2018-10-20 21:17:39 -0700185 "//aos:die",
Austin Schuhfc0caa82023-08-25 14:25:03 -0700186 "//aos/logging",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700187 "@com_google_absl//absl/debugging:failure_signal_handler",
188 "@com_google_absl//absl/flags:flag",
189 "@com_google_absl//absl/flags:parse",
190 "@com_google_absl//absl/log",
191 "@com_google_absl//absl/log:check",
192 "@com_google_absl//absl/log:flags",
193 "@com_google_absl//absl/log:globals",
194 "@com_google_absl//absl/log:initialize",
John Park398c74a2018-10-20 21:17:39 -0700195 ],
John Park398c74a2018-10-20 21:17:39 -0700196)
197
Adam Snaider48a62f32023-10-02 15:49:23 -0700198cc_library(
199 name = "init_for_rust",
200 srcs = [
201 "init_for_rust.cc",
202 ],
203 hdrs = [
204 "init_for_rust.h",
205 ],
206 deps = [
207 ":for_rust",
208 ":init",
209 "//aos/logging",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700210 "@com_google_absl//absl/flags:flag",
211 "@com_google_absl//absl/log:flags",
Adam Snaider48a62f32023-10-02 15:49:23 -0700212 "@crate_index//:cxx_cc",
213 ],
214)
215
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700216autocxx_library(
217 name = "init_rs",
218 srcs = ["init.rs"],
219 crate_name = "aos_init",
220 libs = [
Adam Snaider48a62f32023-10-02 15:49:23 -0700221 ":init_for_rust",
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700222 ],
223 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700224 visibility = ["//visibility:public"],
Adam Snaider48a62f32023-10-02 15:49:23 -0700225 deps = [
226 "@crate_index//:clap",
Adam Snaider9121b302023-12-14 15:30:54 -0800227 "@crate_index//:env_logger",
Adam Snaider48a62f32023-10-02 15:49:23 -0700228 ],
229)
230
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700231autocxx_library(
232 name = "test_init_rs",
233 testonly = True,
234 srcs = ["test_init.rs"],
235 crate_name = "aos_test_init",
Adam Snaiderf560ae92023-11-07 17:06:21 -0800236 gen_docs = False,
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700237 libs = [
238 "//aos/testing:tmpdir",
239 ],
240 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700241 visibility = ["//visibility:public"],
242 deps = [
243 ":init_rs",
Adam Snaider9121b302023-12-14 15:30:54 -0800244 "@crate_index//:env_logger",
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700245 ],
246)
247
Alex Perrycb7da4b2019-08-28 19:35:56 -0700248cc_library(
249 name = "realtime",
250 srcs = [
251 "realtime.cc",
252 ],
253 hdrs = [
254 "realtime.h",
255 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800256 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700257 visibility = ["//visibility:public"],
258 deps = [
James Kuszmaula791b762023-07-13 14:56:21 -0700259 ":uuid",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700260 "@com_google_absl//absl/log",
261 "@com_google_absl//absl/log:check",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700262 ],
263)
264
James Kuszmaulf01da392023-12-14 11:22:14 -0800265static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700266 name = "configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700267 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800268 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700269 visibility = ["//visibility:public"],
James Kuszmaul1e57af92023-12-20 15:34:54 -0800270 deps = ["//aos/flatbuffers/reflection:reflection_fbs"],
Austin Schuhcb108412019-10-13 16:09:54 -0700271)
272
James Kuszmaule4aa01d2022-06-28 14:09:02 -0700273cc_static_flatbuffer(
274 name = "configuration_schema",
275 function = "aos::ConfigurationSchema",
276 target = ":configuration_fbs_reflection_out",
277 visibility = ["//visibility:public"],
278)
279
Alex Perryd5e13572020-02-22 15:15:08 -0800280flatbuffer_ts_library(
281 name = "configuration_ts_fbs",
282 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800283 target_compatible_with = ["@platforms//os:linux"],
Alex Perryd5e13572020-02-22 15:15:08 -0800284 visibility = ["//visibility:public"],
285)
286
Brian Silverman28760272020-02-02 13:21:51 -0800287flatbuffer_py_library(
James Kuszmaul7daef362019-12-31 18:28:17 -0800288 name = "configuration_fbs_python",
289 srcs = ["configuration.fbs"],
290 namespace = "aos",
291 tables = [
292 "Configuration",
293 "Channel",
James Kuszmaul84ff3e52020-01-03 19:48:53 -0800294 "Connection",
James Kuszmaul7daef362019-12-31 18:28:17 -0800295 "Map",
296 "Node",
297 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800298 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul7daef362019-12-31 18:28:17 -0800299 visibility = ["//visibility:public"],
300)
301
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700302flatbuffer_rust_library(
303 name = "configuration_rust_fbs",
304 srcs = ["configuration.fbs"],
305 crate_name = "aos_configuration_fbs",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700306 visibility = ["//visibility:public"],
307)
308
John Park398c74a2018-10-20 21:17:39 -0700309cc_library(
310 name = "configuration",
311 srcs = [
312 "configuration.cc",
313 ],
314 hdrs = [
315 "configuration.h",
316 ],
Austin Schuh605d5ff2024-05-10 15:59:54 -0700317 copts = compiler_select({
318 "clang": [],
319 "gcc": ["-Wno-missing-field-initializers"],
320 }),
Philipp Schraderdada1072020-11-24 11:34:46 -0800321 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800322 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700323 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700324 ":configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700325 ":flatbuffer_merge",
326 ":flatbuffers",
327 ":json_to_flatbuffer",
John Park398c74a2018-10-20 21:17:39 -0700328 "//aos:unique_malloc_ptr",
Austin Schuh83cbb1e2023-06-23 12:59:02 -0700329 "//aos/ipc_lib:index",
Austin Schuh217a9782019-12-21 23:02:50 -0800330 "//aos/network:team_number",
Austin Schuhcb108412019-10-13 16:09:54 -0700331 "//aos/util:file",
Austin Schuhcb108412019-10-13 16:09:54 -0700332 "@com_google_absl//absl/container:btree",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700333 "@com_google_absl//absl/log",
334 "@com_google_absl//absl/log:check",
Austin Schuhcb108412019-10-13 16:09:54 -0700335 "@com_google_absl//absl/strings",
John Park398c74a2018-10-20 21:17:39 -0700336 ],
John Park398c74a2018-10-20 21:17:39 -0700337)
338
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700339cc_library(
340 name = "configuration_for_rust",
341 srcs = [
342 "configuration_for_rust.cc",
343 ],
344 hdrs = [
345 "configuration_for_rust.h",
346 ],
347 deps = [
348 ":configuration",
349 ":for_rust",
Adam Snaider770b97b2023-08-04 21:07:48 -0700350 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700351 ],
352)
353
354autocxx_library(
355 name = "configuration_rs",
356 srcs = ["configuration.rs"],
357 crate_name = "aos_configuration",
358 libs = [
359 ":configuration",
360 ":configuration_for_rust",
361 ":configuration_fbs",
362 ],
363 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Adam Snaiderf560ae92023-11-07 17:06:21 -0800364 test_data = [
365 "//aos/testdata:test_configs",
366 ],
James Kuszmaul1cd3c2b2024-05-21 17:08:10 -0700367 test_deps = [
368 "//aos/testing:path_rs",
369 ],
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700370 visibility = ["//visibility:public"],
371 deps = [
372 ":configuration_rust_fbs",
373 ":flatbuffers_rs",
Adam Snaider770b97b2023-08-04 21:07:48 -0700374 "@crate_index//:thiserror",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700375 ],
376)
377
James Kuszmaulabb77132020-08-01 19:56:16 -0700378flatbuffer_ts_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800379 name = "json_to_flatbuffer_fbs_ts",
James Kuszmaulabb77132020-08-01 19:56:16 -0700380 srcs = ["json_to_flatbuffer.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800381 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700382 visibility = ["//aos:__subpackages__"],
383)
384
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700385flatbuffer_cc_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800386 name = "json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700387 srcs = ["json_to_flatbuffer.fbs"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800388 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -0800389 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700390 visibility = ["//aos:__subpackages__"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700391)
392
Brian Silvermand1805b62022-07-20 20:47:05 -0700393flatbuffer_rust_library(
394 name = "json_to_flatbuffer_rust_fbs",
395 srcs = ["json_to_flatbuffer.fbs"],
396 crate_name = "aos_json_to_flatbuffer_fbs",
Brian Silvermand1805b62022-07-20 20:47:05 -0700397 visibility = ["//aos:__subpackages__"],
398)
399
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700400cc_library(
Austin Schuh43c6a352019-09-30 22:22:10 -0700401 name = "flatbuffer_utils",
402 srcs = ["flatbuffer_utils.cc"],
403 hdrs = ["flatbuffer_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800404 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700405 visibility = ["//visibility:public"],
Austin Schuh43c6a352019-09-30 22:22:10 -0700406 deps = [
407 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700408 "@com_google_absl//absl/log",
409 "@com_google_absl//absl/log:check",
Austin Schuh43c6a352019-09-30 22:22:10 -0700410 ],
411)
412
413cc_library(
Austin Schuhd7e252d2019-10-06 13:51:02 -0700414 name = "json_tokenizer",
415 srcs = ["json_tokenizer.cc"],
416 hdrs = ["json_tokenizer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800417 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhd7e252d2019-10-06 13:51:02 -0700418 deps = [
Pallavi Madhukare2eb2812022-07-19 09:56:09 -0700419 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700420 "@com_google_absl//absl/log",
421 "@com_google_absl//absl/log:check",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700422 "@com_google_absl//absl/strings",
423 ],
424)
425
426cc_library(
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700427 name = "json_to_flatbuffer",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800428 srcs = [
429 "flatbuffer_introspection.cc",
430 "json_to_flatbuffer.cc",
431 ],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700432 hdrs = ["json_to_flatbuffer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800433 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700434 visibility = ["//visibility:public"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700435 deps = [
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700436 ":fast_string_builder",
Austin Schuh43c6a352019-09-30 22:22:10 -0700437 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700438 ":flatbuffers",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700439 ":json_tokenizer",
James Kuszmaulf5eb4682023-09-22 17:16:59 -0700440 "//aos/flatbuffers:builder",
Austin Schuhbba10282021-03-20 22:03:28 -0700441 "//aos/util:file",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700442 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700443 "@com_google_absl//absl/log",
444 "@com_google_absl//absl/log:check",
Austin Schuhd339a9b2019-10-05 21:33:32 -0700445 "@com_google_absl//absl/strings",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700446 ],
447)
448
449cc_test(
450 name = "json_to_flatbuffer_test",
451 srcs = [
452 "json_to_flatbuffer_test.cc",
453 ],
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800454 data = [
455 ":json_to_flatbuffer_fbs_reflection_out",
Alexander Yeee61cac32023-02-11 19:40:40 -0800456 ":json_to_flatbuffer_test_spaces.json",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800457 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800458 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700459 deps = [
Alexander Yeee61cac32023-02-11 19:40:40 -0800460 ":flatbuffer_merge",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700461 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800462 ":json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700463 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700464 "//aos/testing:path",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700465 ],
466)
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700467
Tyler Chatow5e369a42019-11-23 11:57:31 -0800468cc_test(
469 name = "flatbuffer_introspection_test",
470 srcs = [
471 "flatbuffer_introspection_test.cc",
472 ],
473 data = [
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800474 ":json_to_flatbuffer_fbs_reflection_out",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800475 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800476 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800477 deps = [
478 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800479 ":json_to_flatbuffer_fbs",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800480 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700481 "//aos/testing:path",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800482 "//aos/util:file",
483 "@com_github_google_flatbuffers//:flatbuffers",
484 ],
485)
486
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700487cc_library(
488 name = "flatbuffer_merge",
489 srcs = ["flatbuffer_merge.cc"],
490 hdrs = ["flatbuffer_merge.h"],
491 copts = ["-Wno-cast-align"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800492 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700493 visibility = ["//visibility:public"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700494 deps = [
495 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700496 ":flatbuffers",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700497 "@com_github_google_flatbuffers//:flatbuffers",
498 ],
499)
500
501cc_test(
502 name = "flatbuffer_merge_test",
503 srcs = [
504 "flatbuffer_merge_test.cc",
505 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800506 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700507 deps = [
508 ":flatbuffer_merge",
509 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800510 ":json_to_flatbuffer_fbs",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700511 "//aos/testing:googletest",
512 ],
513)
Austin Schuhe93d8642019-10-13 15:27:07 -0700514
515cc_library(
516 name = "flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700517 srcs = [
518 "flatbuffers.cc",
519 ],
Austin Schuhe93d8642019-10-13 15:27:07 -0700520 hdrs = [
521 "flatbuffers.h",
522 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800523 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh40485ed2019-10-26 21:51:44 -0700524 visibility = ["//visibility:public"],
Austin Schuhe93d8642019-10-13 15:27:07 -0700525 deps = [
James Kuszmaulad8a8082020-02-14 21:21:58 -0800526 "//aos:macros",
Brian Silverman354697a2020-09-22 21:06:32 -0700527 "//aos/containers:resizeable_buffer",
Austin Schuh3c9f92c2024-04-30 17:56:42 -0700528 "//aos/ipc_lib:data_alignment",
davidjevans8b9b52f2021-09-17 08:57:30 -0700529 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700530 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700531 "@com_google_absl//absl/log",
532 "@com_google_absl//absl/log:check",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700533 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800534 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700535 ],
536)
Austin Schuhcb108412019-10-13 16:09:54 -0700537
Brian Silvermand1805b62022-07-20 20:47:05 -0700538rust_library(
539 name = "flatbuffers_rs",
540 srcs = ["flatbuffers.rs"],
541 crate_name = "aos_flatbuffers",
Adam Snaiderf560ae92023-11-07 17:06:21 -0800542 test_deps = [
543 ":json_to_flatbuffer_rust_fbs",
544 ],
Brian Silvermand1805b62022-07-20 20:47:05 -0700545 visibility = ["//visibility:public"],
546 deps = [
547 "@com_github_google_flatbuffers//rust",
548 ],
549)
550
Austin Schuhcb108412019-10-13 16:09:54 -0700551cc_test(
552 name = "configuration_test",
553 srcs = [
554 "configuration_test.cc",
555 ],
556 data = [
Nathan Leong307c9692022-10-08 15:25:03 -0700557 "//aos/events:ping_fbs_reflection_out",
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700558 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700559 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700560 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700561 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800562 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700563 deps = [
564 ":configuration",
Nathan Leong307c9692022-10-08 15:25:03 -0700565 "//aos/events:ping_fbs",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800566 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700567 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700568 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700569 "//aos/testing:test_logging",
570 ],
571)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700572
573cc_binary(
574 name = "config_flattener",
575 srcs = [
576 "config_flattener.cc",
577 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800578 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700579 visibility = ["//visibility:public"],
580 deps = [
581 ":configuration",
582 ":init",
583 "//aos/util:file",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700584 "@com_google_absl//absl/log",
585 "@com_google_absl//absl/log:check",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700586 ],
587)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800588
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800589cc_library(
590 name = "aos_cli_utils",
591 srcs = [
592 "aos_cli_utils.cc",
593 ],
594 hdrs = [
595 "aos_cli_utils.h",
596 ],
597 target_compatible_with = ["@platforms//os:linux"],
598 visibility = ["//visibility:public"],
599 deps = [
600 ":configuration",
601 "//aos:init",
602 "//aos/events:shm_event_loop",
Austin Schuh893d7f42022-09-16 15:01:35 -0700603 "//aos/events:simulated_event_loop",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700604 "@com_google_absl//absl/log",
605 "@com_google_absl//absl/log:check",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800606 ],
607)
608
Tyler Chatow5e369a42019-11-23 11:57:31 -0800609cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800610 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800611 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800612 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800613 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800614 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800615 visibility = ["//visibility:public"],
616 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800617 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800618 ":configuration",
619 ":json_to_flatbuffer",
620 "//aos:init",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700621 "@com_google_absl//absl/log",
622 "@com_google_absl//absl/log:check",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800623 ],
624)
625
626cc_binary(
Austin Schuh99004602024-03-16 11:59:24 -0700627 name = "aos_jitter",
628 srcs = [
629 "aos_jitter.cc",
630 ],
631 target_compatible_with = ["@platforms//os:linux"],
632 visibility = ["//visibility:public"],
633 deps = [
634 ":aos_cli_utils",
635 ":configuration",
636 ":init",
637 ":json_to_flatbuffer",
638 ":realtime",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700639 "@com_google_absl//absl/log",
640 "@com_google_absl//absl/log:check",
Austin Schuh99004602024-03-16 11:59:24 -0700641 ],
642)
643
644cc_binary(
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800645 name = "aos_send",
646 srcs = [
647 "aos_send.cc",
648 ],
649 target_compatible_with = ["@platforms//os:linux"],
650 visibility = ["//visibility:public"],
651 deps = [
652 ":aos_cli_utils",
653 ":configuration",
654 ":init",
655 ":json_to_flatbuffer",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700656 "@com_google_absl//absl/flags:flag",
657 "@com_google_absl//absl/log",
658 "@com_google_absl//absl/log:check",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800659 ],
660)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500661
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700662cc_binary(
663 name = "aos_graph_nodes",
664 srcs = [
665 "aos_graph_nodes.cc",
666 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800667 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700668 visibility = ["//visibility:public"],
669 deps = [
670 ":configuration",
671 ":json_to_flatbuffer",
672 "//aos:init",
673 "//aos/events:shm_event_loop",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700674 "@com_google_absl//absl/log",
675 "@com_google_absl//absl/log:check",
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700676 ],
677)
678
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500679cc_library(
680 name = "ftrace",
681 srcs = [
682 "ftrace.cc",
683 ],
684 hdrs = [
685 "ftrace.h",
686 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800687 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500688 visibility = ["//visibility:public"],
689 deps = [
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700690 "@com_google_absl//absl/flags:flag",
691 "@com_google_absl//absl/log:check",
Austin Schuhc9de0132022-12-26 18:04:53 -0800692 "@com_google_absl//absl/strings",
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500693 ],
694)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700695
696cc_library(
697 name = "fast_string_builder",
698 srcs = [
699 "fast_string_builder.cc",
700 ],
701 hdrs = [
702 "fast_string_builder.h",
703 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800704 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700705 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700706 deps = [
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700707 "@com_google_absl//absl/log",
708 "@com_google_absl//absl/log:check",
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700709 "@com_google_absl//absl/strings",
710 "@com_google_absl//absl/strings:str_format",
711 ],
712)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700713
Austin Schuhcc6070c2020-10-10 20:25:56 -0700714cc_test(
715 name = "realtime_test",
716 srcs = [
717 "realtime_test.cc",
718 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800719 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700720 visibility = ["//visibility:public"],
721 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700722 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700723 ":realtime",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700724 "@com_google_absl//absl/flags:flag",
725 "@com_google_absl//absl/log",
726 "@com_google_absl//absl/log:check",
Austin Schuh77f3f222022-06-10 16:49:21 -0700727 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700728 ],
729)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800730
731cc_test(
732 name = "flatbuffers_test",
733 srcs = [
734 "flatbuffers_test.cc",
735 ],
736 deps = [
737 ":flatbuffers",
738 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800739 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800740 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700741 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800742 ],
743)
Austin Schuh0de30f32020-12-06 12:44:28 -0800744
745py_binary(
746 name = "flatbuffers_static",
747 srcs = ["flatbuffers_static.py"],
748 visibility = ["//visibility:public"],
749)
Austin Schuh4385b142021-03-14 21:31:13 -0700750
751cc_library(
752 name = "uuid",
753 srcs = ["uuid.cc"],
754 hdrs = ["uuid.h"],
755 target_compatible_with = ["@platforms//os:linux"],
756 visibility = ["//visibility:public"],
757 deps = [
758 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700759 "@com_google_absl//absl/flags:flag",
760 "@com_google_absl//absl/log",
761 "@com_google_absl//absl/log:check",
Austin Schuh4385b142021-03-14 21:31:13 -0700762 "@com_google_absl//absl/types:span",
763 ],
764)
765
766cc_test(
James Kuszmaul05ccb272023-07-13 10:58:14 -0700767 name = "uuid_collision_test",
James Kuszmaula791b762023-07-13 14:56:21 -0700768 timeout = "eternal",
James Kuszmaul05ccb272023-07-13 10:58:14 -0700769 srcs = ["uuid_collision_test.cc"],
James Kuszmaula791b762023-07-13 14:56:21 -0700770 shard_count = 2,
James Kuszmaul05ccb272023-07-13 10:58:14 -0700771 target_compatible_with = ["@platforms//os:linux"],
772 deps = [
773 ":uuid",
774 "//aos/testing:googletest",
775 ],
776)
777
778cc_test(
Austin Schuh4385b142021-03-14 21:31:13 -0700779 name = "uuid_test",
780 srcs = ["uuid_test.cc"],
781 target_compatible_with = ["@platforms//os:linux"],
782 deps = [
783 ":uuid",
784 "//aos/testing:googletest",
785 ],
786)
Austin Schuh30f74292021-08-13 17:25:26 -0700787
Brian Silverman10599932022-08-15 06:05:53 -0700788cc_library(
789 name = "uuid_for_rust",
790 hdrs = ["uuid_for_rust.h"],
791 deps = [
792 ":uuid",
793 ],
794)
795
796autocxx_library(
797 name = "uuid_rs",
798 srcs = ["uuid.rs"],
799 crate_name = "aos_uuid",
800 libs = [
801 ":uuid",
802 ":uuid_for_rust",
803 ],
804 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
805 rs_deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700806 "@crate_index//:uuid",
Brian Silverman10599932022-08-15 06:05:53 -0700807 ],
Brian Silverman10599932022-08-15 06:05:53 -0700808 visibility = ["//visibility:public"],
809)
810
Austin Schuh30f74292021-08-13 17:25:26 -0700811cc_binary(
812 name = "aos_graph_channels",
813 srcs = [
814 "aos_graph_channels.cc",
815 ],
816 target_compatible_with = ["@platforms//os:linux"],
817 deps = [
818 "//aos:configuration",
819 "//aos:init",
820 "//aos:json_to_flatbuffer",
821 "//aos/events:simulated_event_loop",
822 "//aos/events/logging:log_reader",
823 "//aos/time",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700824 "@com_google_absl//absl/flags:flag",
825 "@com_google_absl//absl/log",
826 "@com_google_absl//absl/log:check",
Austin Schuh30f74292021-08-13 17:25:26 -0700827 ],
828)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700829
830cc_library(
831 name = "for_rust",
832 hdrs = [
833 "for_rust.h",
834 ],
835 visibility = ["//visibility:public"],
836 deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700837 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700838 ],
839)
Austin Schuhb0e439d2023-05-15 10:55:40 -0700840
841cc_library(
842 name = "sha256",
843 srcs = [
844 "sha256.cc",
845 ],
846 hdrs = ["sha256.h"],
847 target_compatible_with = ["@platforms//os:linux"],
848 visibility = ["//visibility:public"],
849 deps = [
James Kuszmaul56802ab2023-08-23 15:18:34 -0700850 "//aos/util:file",
Austin Schuhb0e439d2023-05-15 10:55:40 -0700851 "@boringssl//:crypto",
852 "@com_google_absl//absl/types:span",
853 ],
854)
James Kuszmaul56802ab2023-08-23 15:18:34 -0700855
856cc_test(
857 name = "sha256_test",
858 srcs = ["sha256_test.cc"],
859 deps = [
860 ":sha256",
861 "//aos/testing:googletest",
862 "//aos/testing:tmpdir",
863 ],
864)
Adam Snaidercc622812023-11-07 17:59:27 -0800865
866rust_library(
867 name = "aos_rs",
868 srcs = ["aos.rs"],
869 crate_name = "aos",
870 visibility = ["//visibility:public"],
871 deps = [
872 ":configuration_rs",
873 ":flatbuffers_rs",
874 ":init_rs",
875 ":uuid_rs",
876 "//aos/events:event_loop_runtime",
877 "//aos/events:shm_event_loop_rs",
878 "//aos/events:simulated_event_loop_rs",
879 ],
880)
Austin Schuh8a399de2024-06-05 10:46:23 -0700881
882cc_library(
883 name = "shared_span",
884 hdrs = ["shared_span.h"],
885 visibility = ["//visibility:public"],
886 deps = [
887 "@com_google_absl//absl/types:span",
888 ],
889)