Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 1 | load("//aos/seasocks:gen_embedded.bzl", "gen_embedded") |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 2 | load("//aos:config.bzl", "aos_config") |
Austin Schuh | 0de30f3 | 2020-12-06 12:44:28 -0800 | [diff] [blame] | 3 | load("//aos:flatbuffers.bzl", "cc_static_flatbuffer") |
Austin Schuh | a1d006e | 2022-09-14 21:50:42 -0700 | [diff] [blame] | 4 | load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") |
| 5 | load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library") |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 6 | |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 7 | package(default_visibility = ["//visibility:public"]) |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 8 | |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 9 | flatbuffer_cc_library( |
Austin Schuh | 0de30f3 | 2020-12-06 12:44:28 -0800 | [diff] [blame] | 10 | name = "remote_message_fbs", |
| 11 | srcs = ["remote_message.fbs"], |
| 12 | gen_reflections = 1, |
| 13 | ) |
| 14 | |
| 15 | cc_static_flatbuffer( |
| 16 | name = "remote_message_schema", |
| 17 | function = "aos::message_bridge::RemoteMessageSchema", |
| 18 | target = ":remote_message_fbs_reflection_out", |
| 19 | ) |
| 20 | |
| 21 | flatbuffer_cc_library( |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 22 | name = "connect_fbs", |
| 23 | srcs = ["connect.fbs"], |
| 24 | gen_reflections = 1, |
| 25 | includes = [ |
| 26 | "//aos:configuration_fbs_includes", |
| 27 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 28 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 29 | ) |
| 30 | |
Alex Perry | d5e1357 | 2020-02-22 15:15:08 -0800 | [diff] [blame] | 31 | flatbuffer_ts_library( |
| 32 | name = "connect_ts_fbs", |
| 33 | srcs = ["connect.fbs"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 34 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | dac091f | 2022-03-22 09:35:06 -0700 | [diff] [blame] | 35 | deps = [ |
| 36 | "//aos:configuration_ts_fbs", |
| 37 | ], |
Alex Perry | d5e1357 | 2020-02-22 15:15:08 -0800 | [diff] [blame] | 38 | ) |
| 39 | |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 40 | flatbuffer_cc_library( |
Austin Schuh | f068dca | 2021-03-14 21:38:40 -0700 | [diff] [blame] | 41 | name = "remote_data_fbs", |
| 42 | srcs = ["remote_data.fbs"], |
| 43 | gen_reflections = 1, |
| 44 | target_compatible_with = ["@platforms//os:linux"], |
| 45 | ) |
| 46 | |
| 47 | flatbuffer_cc_library( |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 48 | name = "timestamp_fbs", |
| 49 | srcs = ["timestamp.fbs"], |
| 50 | gen_reflections = 1, |
| 51 | includes = [ |
| 52 | "//aos:configuration_fbs_includes", |
| 53 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 54 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 55 | ) |
| 56 | |
Austin Schuh | a9df9ad | 2021-06-16 14:49:39 -0700 | [diff] [blame] | 57 | cc_static_flatbuffer( |
| 58 | name = "timestamp_schema", |
| 59 | function = "aos::message_bridge::TimestampSchema", |
| 60 | target = ":timestamp_fbs_reflection_out", |
| 61 | visibility = ["//visibility:public"], |
| 62 | ) |
| 63 | |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 64 | flatbuffer_cc_library( |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 65 | name = "message_bridge_client_fbs", |
| 66 | srcs = ["message_bridge_client.fbs"], |
| 67 | gen_reflections = 1, |
| 68 | includes = [ |
| 69 | ":message_bridge_server_fbs_includes", |
| 70 | "//aos:configuration_fbs_includes", |
| 71 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 72 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 73 | ) |
| 74 | |
Austin Schuh | a9df9ad | 2021-06-16 14:49:39 -0700 | [diff] [blame] | 75 | cc_static_flatbuffer( |
| 76 | name = "message_bridge_client_schema", |
| 77 | function = "aos::message_bridge::ClientStatisticsSchema", |
| 78 | target = ":message_bridge_client_fbs_reflection_out", |
| 79 | visibility = ["//visibility:public"], |
| 80 | ) |
| 81 | |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 82 | flatbuffer_cc_library( |
| 83 | name = "message_bridge_server_fbs", |
| 84 | srcs = ["message_bridge_server.fbs"], |
| 85 | gen_reflections = 1, |
| 86 | includes = [ |
| 87 | "//aos:configuration_fbs_includes", |
| 88 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 89 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 90 | ) |
| 91 | |
Austin Schuh | a9df9ad | 2021-06-16 14:49:39 -0700 | [diff] [blame] | 92 | cc_static_flatbuffer( |
| 93 | name = "message_bridge_server_schema", |
| 94 | function = "aos::message_bridge::ServerStatisticsSchema", |
| 95 | target = ":message_bridge_server_fbs_reflection_out", |
| 96 | visibility = ["//visibility:public"], |
| 97 | ) |
| 98 | |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 99 | cc_library( |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 100 | name = "team_number", |
| 101 | srcs = [ |
| 102 | "team_number.cc", |
| 103 | ], |
| 104 | hdrs = [ |
| 105 | "team_number.h", |
| 106 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 107 | target_compatible_with = ["@platforms//os:linux"], |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 108 | deps = [ |
Brian Silverman | 3dfbfb1 | 2020-02-17 20:35:18 -0800 | [diff] [blame] | 109 | "@com_github_google_glog//:glog", |
Austin Schuh | 4c84abb | 2021-06-20 18:16:32 -0700 | [diff] [blame] | 110 | "@com_google_absl//absl/strings", |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 111 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 112 | ) |
| 113 | |
Austin Schuh | df5591e | 2015-12-19 22:36:50 -0800 | [diff] [blame] | 114 | cc_test( |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 115 | name = "team_number_test", |
| 116 | srcs = [ |
| 117 | "team_number_test.cc", |
| 118 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 119 | target_compatible_with = ["@platforms//os:linux"], |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 120 | deps = [ |
| 121 | ":team_number", |
Jim Ostrowski | 8565b40 | 2020-02-29 20:26:53 -0800 | [diff] [blame] | 122 | "//aos:configuration", |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 123 | "//aos/testing:googletest", |
| 124 | ], |
Austin Schuh | df5591e | 2015-12-19 22:36:50 -0800 | [diff] [blame] | 125 | ) |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 126 | |
| 127 | cc_library( |
| 128 | name = "sctp_lib", |
| 129 | srcs = [ |
| 130 | "sctp_lib.cc", |
| 131 | ], |
| 132 | hdrs = [ |
| 133 | "sctp_lib.h", |
| 134 | ], |
| 135 | copts = [ |
| 136 | # The casts required to read datastructures from sockets trip -Wcast-align. |
| 137 | "-Wno-cast-align", |
| 138 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 139 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 140 | deps = [ |
| 141 | "//aos:unique_malloc_ptr", |
Austin Schuh | 2fe4b71 | 2020-03-15 14:21:45 -0700 | [diff] [blame] | 142 | "//aos/util:file", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 143 | "//third_party/lksctp-tools:sctp", |
| 144 | "@com_github_google_glog//:glog", |
| 145 | ], |
| 146 | ) |
| 147 | |
| 148 | cc_library( |
| 149 | name = "sctp_server", |
| 150 | srcs = [ |
| 151 | "sctp_server.cc", |
| 152 | ], |
| 153 | hdrs = [ |
| 154 | "sctp_server.h", |
| 155 | ], |
| 156 | copts = [ |
| 157 | "-Wno-cast-align", |
| 158 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 159 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 160 | deps = [ |
| 161 | ":sctp_lib", |
| 162 | "//third_party/lksctp-tools:sctp", |
| 163 | ], |
| 164 | ) |
| 165 | |
| 166 | cc_library( |
| 167 | name = "message_bridge_protocol", |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 168 | srcs = [ |
| 169 | "message_bridge_protocol.cc", |
| 170 | ], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 171 | hdrs = [ |
| 172 | "message_bridge_protocol.h", |
| 173 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 174 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 175 | deps = [ |
| 176 | ":connect_fbs", |
| 177 | "//aos:configuration", |
| 178 | "//aos:flatbuffer_merge", |
| 179 | "//aos:flatbuffers", |
Austin Schuh | 4385b14 | 2021-03-14 21:31:13 -0700 | [diff] [blame] | 180 | "//aos:uuid", |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 181 | "@com_github_google_flatbuffers//:flatbuffers", |
| 182 | ], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 183 | ) |
| 184 | |
| 185 | cc_library( |
Austin Schuh | e19b675 | 2020-08-27 23:20:19 -0700 | [diff] [blame] | 186 | name = "message_bridge_server_status", |
| 187 | srcs = [ |
| 188 | "message_bridge_server_status.cc", |
| 189 | ], |
| 190 | hdrs = [ |
| 191 | "message_bridge_server_status.h", |
| 192 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 193 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e19b675 | 2020-08-27 23:20:19 -0700 | [diff] [blame] | 194 | deps = [ |
| 195 | ":message_bridge_client_fbs", |
| 196 | ":message_bridge_server_fbs", |
| 197 | ":timestamp_fbs", |
| 198 | ":timestamp_filter", |
| 199 | "//aos:flatbuffer_merge", |
| 200 | "//aos:flatbuffers", |
| 201 | "//aos/events:event_loop", |
| 202 | "//aos/time", |
| 203 | ], |
| 204 | ) |
| 205 | |
| 206 | cc_library( |
Austin Schuh | 36a2c3e | 2021-02-18 22:28:38 -0800 | [diff] [blame] | 207 | name = "timestamp_channel", |
| 208 | srcs = ["timestamp_channel.cc"], |
| 209 | hdrs = ["timestamp_channel.h"], |
| 210 | deps = [ |
| 211 | ":remote_message_fbs", |
| 212 | "//aos:configuration", |
| 213 | "//aos/events:event_loop", |
| 214 | "@com_github_google_glog//:glog", |
| 215 | "@com_google_absl//absl/container:btree", |
| 216 | "@com_google_absl//absl/strings", |
| 217 | ], |
| 218 | ) |
| 219 | |
| 220 | cc_library( |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 221 | name = "message_bridge_server_lib", |
| 222 | srcs = [ |
| 223 | "message_bridge_server_lib.cc", |
| 224 | ], |
| 225 | hdrs = [ |
| 226 | "message_bridge_server_lib.h", |
| 227 | ], |
| 228 | copts = [ |
| 229 | "-Wno-cast-align", |
| 230 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 231 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 232 | deps = [ |
| 233 | ":connect_fbs", |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 234 | ":message_bridge_client_fbs", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 235 | ":message_bridge_protocol", |
| 236 | ":message_bridge_server_fbs", |
Austin Schuh | e19b675 | 2020-08-27 23:20:19 -0700 | [diff] [blame] | 237 | ":message_bridge_server_status", |
Austin Schuh | f068dca | 2021-03-14 21:38:40 -0700 | [diff] [blame] | 238 | ":remote_data_fbs", |
Austin Schuh | 0de30f3 | 2020-12-06 12:44:28 -0800 | [diff] [blame] | 239 | ":remote_message_fbs", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 240 | ":sctp_lib", |
| 241 | ":sctp_server", |
Austin Schuh | 36a2c3e | 2021-02-18 22:28:38 -0800 | [diff] [blame] | 242 | ":timestamp_channel", |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 243 | ":timestamp_fbs", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 244 | "//aos:unique_malloc_ptr", |
| 245 | "//aos/events:shm_event_loop", |
Austin Schuh | b06f03b | 2021-02-17 22:00:37 -0800 | [diff] [blame] | 246 | "//aos/events/logging:log_reader", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 247 | "//third_party/lksctp-tools:sctp", |
| 248 | ], |
| 249 | ) |
| 250 | |
| 251 | cc_binary( |
| 252 | name = "message_bridge_server", |
| 253 | srcs = [ |
| 254 | "message_bridge_server.cc", |
| 255 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 256 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 257 | deps = [ |
| 258 | ":message_bridge_server_lib", |
| 259 | "//aos:init", |
| 260 | "//aos:json_to_flatbuffer", |
| 261 | "//aos/events:shm_event_loop", |
Sarah Newman | 45a64df | 2022-04-11 19:33:46 -0700 | [diff] [blame] | 262 | "//aos/logging:dynamic_logging", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 263 | ], |
| 264 | ) |
| 265 | |
| 266 | cc_library( |
| 267 | name = "sctp_client", |
| 268 | srcs = [ |
| 269 | "sctp_client.cc", |
| 270 | ], |
| 271 | hdrs = [ |
| 272 | "sctp_client.h", |
| 273 | ], |
| 274 | copts = [ |
| 275 | "-Wno-cast-align", |
| 276 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 277 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 278 | deps = [ |
| 279 | ":sctp_lib", |
| 280 | "//third_party/lksctp-tools:sctp", |
| 281 | ], |
| 282 | ) |
| 283 | |
| 284 | cc_library( |
Austin Schuh | ae2e7bf | 2020-08-27 23:42:56 -0700 | [diff] [blame] | 285 | name = "message_bridge_client_status", |
| 286 | srcs = [ |
| 287 | "message_bridge_client_status.cc", |
| 288 | ], |
| 289 | hdrs = [ |
| 290 | "message_bridge_client_status.h", |
| 291 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 292 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | ae2e7bf | 2020-08-27 23:42:56 -0700 | [diff] [blame] | 293 | deps = [ |
| 294 | ":message_bridge_client_fbs", |
| 295 | ":message_bridge_server_fbs", |
| 296 | ":timestamp_filter", |
| 297 | "//aos:flatbuffers", |
| 298 | "//aos/events:event_loop", |
| 299 | "//aos/time", |
| 300 | ], |
| 301 | ) |
| 302 | |
| 303 | cc_library( |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 304 | name = "message_bridge_client_lib", |
| 305 | srcs = [ |
| 306 | "message_bridge_client_lib.cc", |
| 307 | ], |
| 308 | hdrs = [ |
| 309 | "message_bridge_client_lib.h", |
| 310 | ], |
| 311 | copts = [ |
| 312 | "-Wno-cast-align", |
| 313 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 314 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 315 | deps = [ |
| 316 | ":connect_fbs", |
| 317 | ":message_bridge_client_fbs", |
Austin Schuh | ae2e7bf | 2020-08-27 23:42:56 -0700 | [diff] [blame] | 318 | ":message_bridge_client_status", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 319 | ":message_bridge_protocol", |
| 320 | ":message_bridge_server_fbs", |
Austin Schuh | f068dca | 2021-03-14 21:38:40 -0700 | [diff] [blame] | 321 | ":remote_data_fbs", |
Austin Schuh | 0de30f3 | 2020-12-06 12:44:28 -0800 | [diff] [blame] | 322 | ":remote_message_fbs", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 323 | ":sctp_client", |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 324 | ":timestamp_fbs", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 325 | "//aos/events:shm_event_loop", |
Austin Schuh | b06f03b | 2021-02-17 22:00:37 -0800 | [diff] [blame] | 326 | "//aos/events/logging:log_reader", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 327 | ], |
| 328 | ) |
| 329 | |
| 330 | cc_binary( |
| 331 | name = "message_bridge_client", |
| 332 | srcs = [ |
| 333 | "message_bridge_client.cc", |
| 334 | ], |
| 335 | copts = [ |
| 336 | "-Wno-cast-align", |
| 337 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 338 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 339 | deps = [ |
| 340 | ":message_bridge_client_lib", |
| 341 | "//aos:init", |
| 342 | "//aos:json_to_flatbuffer", |
| 343 | "//aos/events:shm_event_loop", |
Sarah Newman | 45a64df | 2022-04-11 19:33:46 -0700 | [diff] [blame] | 344 | "//aos/logging:dynamic_logging", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 345 | ], |
| 346 | ) |
| 347 | |
| 348 | aos_config( |
Austin Schuh | 36a2c3e | 2021-02-18 22:28:38 -0800 | [diff] [blame] | 349 | name = "message_bridge_test_combined_timestamps_common_config", |
| 350 | src = "message_bridge_test_combined_timestamps_common.json", |
| 351 | flatbuffers = [ |
| 352 | ":remote_message_fbs", |
| 353 | "//aos/events:ping_fbs", |
| 354 | "//aos/events:pong_fbs", |
| 355 | "//aos/network:message_bridge_client_fbs", |
| 356 | "//aos/network:message_bridge_server_fbs", |
| 357 | "//aos/network:timestamp_fbs", |
| 358 | ], |
| 359 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | c5fa6d9 | 2022-02-25 14:36:28 -0800 | [diff] [blame] | 360 | deps = ["//aos/events:aos_config"], |
Austin Schuh | 36a2c3e | 2021-02-18 22:28:38 -0800 | [diff] [blame] | 361 | ) |
| 362 | |
| 363 | aos_config( |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 364 | name = "message_bridge_test_common_config", |
| 365 | src = "message_bridge_test_common.json", |
| 366 | flatbuffers = [ |
Austin Schuh | 0de30f3 | 2020-12-06 12:44:28 -0800 | [diff] [blame] | 367 | ":remote_message_fbs", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 368 | "//aos/events:ping_fbs", |
| 369 | "//aos/events:pong_fbs", |
| 370 | "//aos/network:message_bridge_client_fbs", |
| 371 | "//aos/network:message_bridge_server_fbs", |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 372 | "//aos/network:timestamp_fbs", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 373 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 374 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | c5fa6d9 | 2022-02-25 14:36:28 -0800 | [diff] [blame] | 375 | deps = ["//aos/events:aos_config"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 376 | ) |
| 377 | |
James Kuszmaul | 839c8aa | 2023-01-10 15:27:57 -0800 | [diff] [blame] | 378 | aos_config( |
| 379 | name = "timestamp_channel_test_config", |
| 380 | src = "timestamp_channel_test.json", |
| 381 | flatbuffers = [ |
| 382 | ":remote_message_fbs", |
| 383 | "//aos/events:ping_fbs", |
| 384 | "//aos/events:pong_fbs", |
| 385 | "//aos/network:message_bridge_client_fbs", |
| 386 | "//aos/network:message_bridge_server_fbs", |
| 387 | "//aos/network:timestamp_fbs", |
| 388 | ], |
| 389 | target_compatible_with = ["@platforms//os:linux"], |
| 390 | deps = ["//aos/events:aos_config"], |
| 391 | ) |
| 392 | |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 393 | cc_test( |
| 394 | name = "message_bridge_test", |
| 395 | srcs = [ |
| 396 | "message_bridge_test.cc", |
| 397 | ], |
| 398 | data = [ |
Austin Schuh | 36a2c3e | 2021-02-18 22:28:38 -0800 | [diff] [blame] | 399 | ":message_bridge_test_combined_timestamps_common_config", |
Austin Schuh | f466ab5 | 2021-02-16 22:00:38 -0800 | [diff] [blame] | 400 | ":message_bridge_test_common_config", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 401 | ], |
Austin Schuh | 025ff51 | 2021-02-07 23:06:48 -0800 | [diff] [blame] | 402 | flaky = True, |
Austin Schuh | 36a2c3e | 2021-02-18 22:28:38 -0800 | [diff] [blame] | 403 | shard_count = 10, |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 404 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 405 | deps = [ |
| 406 | ":message_bridge_client_lib", |
| 407 | ":message_bridge_server_lib", |
| 408 | "//aos:json_to_flatbuffer", |
| 409 | "//aos/events:ping_fbs", |
| 410 | "//aos/events:pong_fbs", |
| 411 | "//aos/events:shm_event_loop", |
Brian Silverman | 7b266d9 | 2021-02-17 21:24:02 -0800 | [diff] [blame] | 412 | "//aos/ipc_lib:event", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 413 | "//aos/testing:googletest", |
Austin Schuh | 373f176 | 2021-06-02 21:07:09 -0700 | [diff] [blame] | 414 | "//aos/testing:path", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 415 | ], |
| 416 | ) |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 417 | |
| 418 | flatbuffer_cc_library( |
| 419 | name = "web_proxy_fbs", |
| 420 | srcs = ["web_proxy.fbs"], |
Brian Silverman | 3dfbfb1 | 2020-02-17 20:35:18 -0800 | [diff] [blame] | 421 | gen_reflections = True, |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 422 | includes = [ |
| 423 | ":connect_fbs_includes", |
| 424 | "//aos:configuration_fbs_includes", |
| 425 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 426 | target_compatible_with = ["@platforms//os:linux"], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 427 | ) |
| 428 | |
| 429 | flatbuffer_ts_library( |
| 430 | name = "web_proxy_ts_fbs", |
| 431 | srcs = ["web_proxy.fbs"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 432 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | dac091f | 2022-03-22 09:35:06 -0700 | [diff] [blame] | 433 | deps = [ |
| 434 | ":connect_ts_fbs", |
| 435 | "//aos:configuration_ts_fbs", |
| 436 | ], |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 437 | ) |
| 438 | |
| 439 | cc_library( |
| 440 | name = "web_proxy_utils", |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 441 | srcs = ["web_proxy_utils.cc"], |
Brian Silverman | 3dfbfb1 | 2020-02-17 20:35:18 -0800 | [diff] [blame] | 442 | hdrs = ["web_proxy_utils.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 443 | target_compatible_with = ["@platforms//os:linux"], |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 444 | deps = [ |
| 445 | ":connect_fbs", |
| 446 | ":web_proxy_fbs", |
| 447 | "//aos:configuration_fbs", |
| 448 | "//aos/events:event_loop", |
| 449 | "@com_github_google_flatbuffers//:flatbuffers", |
| 450 | ], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 451 | ) |
| 452 | |
| 453 | cc_library( |
| 454 | name = "web_proxy", |
Austin Schuh | 52e5e3a | 2021-04-24 22:30:02 -0700 | [diff] [blame] | 455 | srcs = [ |
| 456 | "rawrtc.cc", |
| 457 | "web_proxy.cc", |
| 458 | ], |
| 459 | hdrs = [ |
| 460 | "rawrtc.h", |
| 461 | "web_proxy.h", |
| 462 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 463 | target_compatible_with = ["@platforms//os:linux"], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 464 | deps = [ |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 465 | ":connect_fbs", |
James Kuszmaul | 4867136 | 2020-12-24 13:54:16 -0800 | [diff] [blame] | 466 | ":gen_embedded", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 467 | ":web_proxy_fbs", |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 468 | ":web_proxy_utils", |
| 469 | "//aos/events:shm_event_loop", |
James Kuszmaul | 8d928d0 | 2020-12-25 17:47:49 -0800 | [diff] [blame] | 470 | "//aos/mutex", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 471 | "//aos/seasocks:seasocks_logger", |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 472 | "//third_party/seasocks", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 473 | "@com_github_google_glog//:glog", |
Austin Schuh | 52e5e3a | 2021-04-24 22:30:02 -0700 | [diff] [blame] | 474 | "@com_github_rawrtc_rawrtc//:rawrtc", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 475 | ], |
| 476 | ) |
| 477 | |
| 478 | gen_embedded( |
| 479 | name = "gen_embedded", |
| 480 | srcs = glob( |
| 481 | include = ["www_defaults/**/*"], |
| 482 | exclude = ["www/**/*"], |
| 483 | ), |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 484 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | 3398d0b | 2023-02-11 22:55:22 -0800 | [diff] [blame^] | 485 | visibility = ["//visibility:public"], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 486 | ) |
| 487 | |
| 488 | cc_binary( |
| 489 | name = "web_proxy_main", |
| 490 | srcs = ["web_proxy_main.cc"], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 491 | data = [ |
Brian Silverman | 3dfbfb1 | 2020-02-17 20:35:18 -0800 | [diff] [blame] | 492 | "//aos/network/www:files", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 493 | "//aos/network/www:main_bundle.min.js", |
Brian Silverman | 3dfbfb1 | 2020-02-17 20:35:18 -0800 | [diff] [blame] | 494 | "@com_github_google_flatbuffers//:flatjs", |
| 495 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 496 | target_compatible_with = ["@platforms//os:linux"], |
Brian Silverman | 3dfbfb1 | 2020-02-17 20:35:18 -0800 | [diff] [blame] | 497 | deps = [ |
Brian Silverman | 3dfbfb1 | 2020-02-17 20:35:18 -0800 | [diff] [blame] | 498 | ":web_proxy", |
| 499 | "//aos:init", |
| 500 | "//aos/events:shm_event_loop", |
Brian Silverman | 3dfbfb1 | 2020-02-17 20:35:18 -0800 | [diff] [blame] | 501 | "@com_github_google_flatbuffers//:flatbuffers", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 502 | ], |
| 503 | ) |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 504 | |
James Kuszmaul | 71a8193 | 2020-12-15 21:08:01 -0800 | [diff] [blame] | 505 | cc_binary( |
| 506 | name = "log_web_proxy_main", |
| 507 | srcs = ["log_web_proxy_main.cc"], |
| 508 | args = [ |
James Kuszmaul | 71a8193 | 2020-12-15 21:08:01 -0800 | [diff] [blame] | 509 | "--data_dir=aos/network/www", |
| 510 | ], |
James Kuszmaul | 71a8193 | 2020-12-15 21:08:01 -0800 | [diff] [blame] | 511 | deps = [ |
James Kuszmaul | 71a8193 | 2020-12-15 21:08:01 -0800 | [diff] [blame] | 512 | ":web_proxy", |
| 513 | "//aos:init", |
| 514 | "//aos/events:simulated_event_loop", |
Austin Schuh | b06f03b | 2021-02-17 22:00:37 -0800 | [diff] [blame] | 515 | "//aos/events/logging:log_reader", |
James Kuszmaul | 71a8193 | 2020-12-15 21:08:01 -0800 | [diff] [blame] | 516 | "@com_github_google_flatbuffers//:flatbuffers", |
| 517 | ], |
| 518 | ) |
| 519 | |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 520 | cc_library( |
| 521 | name = "timestamp_filter", |
Austin Schuh | 7ee6f72 | 2020-08-24 16:19:36 -0700 | [diff] [blame] | 522 | srcs = ["timestamp_filter.cc"], |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 523 | hdrs = ["timestamp_filter.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 524 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 525 | deps = [ |
Austin Schuh | 04eccfc | 2020-08-26 21:08:27 -0700 | [diff] [blame] | 526 | "//aos:configuration", |
Austin Schuh | 6616884 | 2021-08-17 19:42:21 -0700 | [diff] [blame] | 527 | "//aos/events/logging:boot_timestamp", |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 528 | "//aos/time", |
Austin Schuh | 5c770fa | 2022-03-11 06:57:22 -0800 | [diff] [blame] | 529 | "@com_google_absl//absl/numeric:int128", |
Austin Schuh | 85357ee | 2020-08-24 16:41:42 -0700 | [diff] [blame] | 530 | "@com_google_absl//absl/strings", |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 531 | ], |
| 532 | ) |
| 533 | |
Austin Schuh | 0ca1fd3 | 2020-12-18 22:53:05 -0800 | [diff] [blame] | 534 | cc_library( |
| 535 | name = "multinode_timestamp_filter", |
| 536 | srcs = ["multinode_timestamp_filter.cc"], |
| 537 | hdrs = ["multinode_timestamp_filter.h"], |
| 538 | target_compatible_with = ["@platforms//os:linux"], |
| 539 | deps = [ |
| 540 | ":timestamp_filter", |
| 541 | "//aos:configuration", |
| 542 | "//aos/events:simulated_event_loop", |
Austin Schuh | 58646e2 | 2021-08-23 23:51:46 -0700 | [diff] [blame] | 543 | "//aos/events/logging:boot_timestamp", |
Austin Schuh | e639ea1 | 2021-01-25 13:00:22 -0800 | [diff] [blame] | 544 | "//aos/events/logging:logfile_utils", |
Austin Schuh | 0ca1fd3 | 2020-12-18 22:53:05 -0800 | [diff] [blame] | 545 | "//aos/time", |
Austin Schuh | 0ca1fd3 | 2020-12-18 22:53:05 -0800 | [diff] [blame] | 546 | "@org_tuxfamily_eigen//:eigen", |
| 547 | ], |
| 548 | ) |
| 549 | |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 550 | cc_test( |
| 551 | name = "timestamp_filter_test", |
| 552 | srcs = [ |
| 553 | "timestamp_filter_test.cc", |
| 554 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 555 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 556 | deps = [ |
| 557 | ":timestamp_filter", |
Austin Schuh | 04eccfc | 2020-08-26 21:08:27 -0700 | [diff] [blame] | 558 | "//aos:json_to_flatbuffer", |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 559 | "//aos/testing:googletest", |
| 560 | ], |
| 561 | ) |
Austin Schuh | 7466fe1 | 2020-12-29 23:01:47 -0800 | [diff] [blame] | 562 | |
Austin Schuh | a9abc03 | 2021-01-01 16:46:19 -0800 | [diff] [blame] | 563 | cc_library( |
| 564 | name = "testing_time_converter", |
| 565 | testonly = True, |
| 566 | srcs = ["testing_time_converter.cc"], |
| 567 | hdrs = ["testing_time_converter.h"], |
| 568 | deps = [ |
| 569 | ":multinode_timestamp_filter", |
| 570 | "//aos/events:simulated_event_loop", |
Austin Schuh | 58646e2 | 2021-08-23 23:51:46 -0700 | [diff] [blame] | 571 | "//aos/events/logging:boot_timestamp", |
Austin Schuh | a9abc03 | 2021-01-01 16:46:19 -0800 | [diff] [blame] | 572 | "//aos/time", |
| 573 | ], |
| 574 | ) |
| 575 | |
Austin Schuh | 0a0a827 | 2021-12-08 13:19:32 -0800 | [diff] [blame] | 576 | cc_binary( |
| 577 | name = "sctp_lib_shim.so", |
| 578 | testonly = True, |
| 579 | srcs = [ |
| 580 | "sctp_lib_shim.c", |
| 581 | ], |
| 582 | linkopts = [ |
| 583 | "-ldl", |
| 584 | ], |
| 585 | linkshared = True, |
| 586 | target_compatible_with = ["@platforms//os:linux"], |
| 587 | ) |
| 588 | |
| 589 | cc_binary( |
| 590 | name = "sctp_lib_test_binary", |
| 591 | testonly = True, |
| 592 | srcs = [ |
| 593 | "sctp_lib_test.cc", |
| 594 | ], |
| 595 | linkstatic = False, |
| 596 | target_compatible_with = ["@platforms//os:linux"], |
| 597 | deps = [ |
| 598 | ":sctp_lib", |
| 599 | "//aos:init", |
| 600 | ], |
| 601 | ) |
| 602 | |
| 603 | sh_test( |
| 604 | name = "sctp_lib_test", |
| 605 | srcs = [ |
| 606 | "sctp_lib_test.sh", |
| 607 | ], |
| 608 | args = [ |
| 609 | "$(location :sctp_lib_test_binary)", |
| 610 | "$(location :sctp_lib_shim.so)", |
| 611 | ], |
| 612 | data = [ |
| 613 | ":sctp_lib_shim.so", |
| 614 | ":sctp_lib_test_binary", |
| 615 | ], |
| 616 | target_compatible_with = ["@platforms//os:linux"], |
| 617 | deps = [ |
| 618 | "@bazel_tools//tools/bash/runfiles", |
| 619 | ], |
| 620 | ) |
| 621 | |
Austin Schuh | 7466fe1 | 2020-12-29 23:01:47 -0800 | [diff] [blame] | 622 | cc_test( |
| 623 | name = "multinode_timestamp_filter_test", |
| 624 | srcs = [ |
| 625 | "multinode_timestamp_filter_test.cc", |
| 626 | ], |
| 627 | target_compatible_with = ["@platforms//os:linux"], |
| 628 | deps = [ |
| 629 | ":multinode_timestamp_filter", |
Austin Schuh | a9abc03 | 2021-01-01 16:46:19 -0800 | [diff] [blame] | 630 | ":testing_time_converter", |
Austin Schuh | 7466fe1 | 2020-12-29 23:01:47 -0800 | [diff] [blame] | 631 | ":timestamp_filter", |
| 632 | "//aos/testing:googletest", |
Austin Schuh | 7466fe1 | 2020-12-29 23:01:47 -0800 | [diff] [blame] | 633 | ], |
| 634 | ) |
James Kuszmaul | 839c8aa | 2023-01-10 15:27:57 -0800 | [diff] [blame] | 635 | |
| 636 | cc_test( |
| 637 | name = "timestamp_channel_test", |
| 638 | srcs = ["timestamp_channel_test.cc"], |
| 639 | data = [":timestamp_channel_test_config"], |
| 640 | deps = [ |
| 641 | ":timestamp_channel", |
| 642 | "//aos:configuration", |
| 643 | "//aos/events:ping_fbs", |
| 644 | "//aos/events:shm_event_loop", |
| 645 | "//aos/events:simulated_event_loop", |
| 646 | "//aos/testing:googletest", |
| 647 | "//aos/testing:path", |
| 648 | "//aos/testing:tmpdir", |
| 649 | ], |
| 650 | ) |