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