Joshua Haberman | 823eb09 | 2021-04-05 12:26:41 -0700 | [diff] [blame] | 1 | # Copyright (c) 2009-2021, Google LLC |
Joshua Haberman | e59d2c8 | 2021-04-05 10:47:53 -0700 | [diff] [blame] | 2 | # All rights reserved. |
| 3 | # |
| 4 | # Redistribution and use in source and binary forms, with or without |
| 5 | # modification, are permitted provided that the following conditions are met: |
| 6 | # * Redistributions of source code must retain the above copyright |
| 7 | # notice, this list of conditions and the following disclaimer. |
| 8 | # * Redistributions in binary form must reproduce the above copyright |
| 9 | # notice, this list of conditions and the following disclaimer in the |
| 10 | # documentation and/or other materials provided with the distribution. |
| 11 | # * Neither the name of Google LLC nor the |
| 12 | # names of its contributors may be used to endorse or promote products |
| 13 | # derived from this software without specific prior written permission. |
| 14 | # |
| 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 16 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 17 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 18 | # DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY |
| 19 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 20 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 21 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 22 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 23 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 24 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 | |
Josh Haberman | 2655ed9 | 2018-11-03 13:04:10 -0700 | [diff] [blame] | 26 | load( |
Joshua Haberman | 5611ff2 | 2019-05-16 11:35:00 -0700 | [diff] [blame] | 27 | "//bazel:build_defs.bzl", |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 28 | "UPB_DEFAULT_COPTS", |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 29 | "UPB_DEFAULT_CPPOPTS", |
| 30 | "make_shell_script", |
Joshua Haberman | 06b90f9 | 2019-05-14 15:58:58 -0700 | [diff] [blame] | 31 | ) |
Joshua Haberman | 06b90f9 | 2019-05-14 15:58:58 -0700 | [diff] [blame] | 32 | load( |
Joshua Haberman | 5611ff2 | 2019-05-16 11:35:00 -0700 | [diff] [blame] | 33 | "//bazel:upb_proto_library.bzl", |
Joshua Haberman | a345af9 | 2020-10-18 13:39:13 -0700 | [diff] [blame] | 34 | "upb_fasttable_enabled", |
Josh Haberman | a7ebe54 | 2018-11-03 18:18:47 -0700 | [diff] [blame] | 35 | "upb_proto_library", |
Joshua Haberman | a274ad7 | 2020-10-28 13:06:30 -0700 | [diff] [blame] | 36 | "upb_proto_library_copts", |
Joshua Haberman | e8f9eac | 2020-10-28 22:50:03 -0700 | [diff] [blame] | 37 | "upb_proto_reflection_library", |
Josh Haberman | 2655ed9 | 2018-11-03 13:04:10 -0700 | [diff] [blame] | 38 | ) |
Joshua Haberman | 0dc2394 | 2020-06-05 09:17:33 -0700 | [diff] [blame] | 39 | |
Protobuf Team | b8edc71 | 2022-03-16 08:24:52 -0700 | [diff] [blame] | 40 | # begin:github_only |
| 41 | load( |
| 42 | "//bazel:build_defs.bzl", |
| 43 | "upb_amalgamation", |
| 44 | ) |
| 45 | # end:github_only |
| 46 | |
Joshua Haberman | 83c0edb | 2021-02-28 16:56:49 -0800 | [diff] [blame] | 47 | licenses(["notice"]) |
Joshua Haberman | 7f9f722 | 2019-01-23 17:10:22 -0800 | [diff] [blame] | 48 | |
Joshua Haberman | a5243ff | 2022-03-30 14:20:07 -0700 | [diff] [blame] | 49 | exports_files(["LICENSE"]) |
| 50 | |
| 51 | exports_files( |
| 52 | [ |
| 53 | "BUILD", |
| 54 | "WORKSPACE", |
| 55 | ], |
| 56 | visibility = ["//cmake:__pkg__"], |
| 57 | ) |
Joshua Haberman | 7f9f722 | 2019-01-23 17:10:22 -0800 | [diff] [blame] | 58 | |
Joshua Haberman | 00f96cb | 2019-03-27 12:13:59 -0700 | [diff] [blame] | 59 | config_setting( |
Nicolas "Pixel" Noble | ce3ba4d | 2019-07-18 01:12:00 +0200 | [diff] [blame] | 60 | name = "windows", |
Protobuf Team | e5f2601 | 2022-06-01 14:40:00 -0700 | [diff] [blame] | 61 | constraint_values = ["@platforms//os:windows"], |
Eli Schleifer | 231daa3 | 2021-12-20 16:01:23 -0800 | [diff] [blame] | 62 | visibility = ["//visibility:public"], |
Nicolas "Pixel" Noble | ce3ba4d | 2019-07-18 01:12:00 +0200 | [diff] [blame] | 63 | ) |
| 64 | |
Joshua Haberman | a345af9 | 2020-10-18 13:39:13 -0700 | [diff] [blame] | 65 | upb_fasttable_enabled( |
| 66 | name = "fasttable_enabled", |
Joshua Haberman | b928696 | 2020-10-26 21:23:16 -0700 | [diff] [blame] | 67 | build_setting_default = False, |
Joshua Haberman | a345af9 | 2020-10-18 13:39:13 -0700 | [diff] [blame] | 68 | visibility = ["//visibility:public"], |
| 69 | ) |
| 70 | |
Joshua Haberman | e8f9eac | 2020-10-28 22:50:03 -0700 | [diff] [blame] | 71 | config_setting( |
| 72 | name = "fasttable_enabled_setting", |
| 73 | flag_values = {"//:fasttable_enabled": "true"}, |
| 74 | ) |
| 75 | |
Joshua Haberman | a274ad7 | 2020-10-28 13:06:30 -0700 | [diff] [blame] | 76 | upb_proto_library_copts( |
| 77 | name = "upb_proto_library_copts__for_generated_code_only_do_not_use", |
| 78 | copts = UPB_DEFAULT_COPTS, |
| 79 | visibility = ["//visibility:public"], |
| 80 | ) |
| 81 | |
Joshua Haberman | 6df5517 | 2022-05-24 11:41:56 -0700 | [diff] [blame] | 82 | package_group( |
| 83 | name = "friends", |
| 84 | packages = [], |
| 85 | ) |
| 86 | |
Joshua Haberman | 928ef7f | 2019-03-27 12:52:33 -0700 | [diff] [blame] | 87 | # Public C/C++ libraries ####################################################### |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 88 | |
| 89 | cc_library( |
Anna R | de1bc11 | 2020-01-07 15:45:19 -0800 | [diff] [blame] | 90 | name = "port", |
Joshua Haberman | a60e9a3 | 2022-05-13 17:32:17 -0700 | [diff] [blame] | 91 | hdrs = [ |
| 92 | "upb/internal/vsnprintf_compat.h", |
| 93 | ], |
Joshua Haberman | 558315a | 2020-10-28 17:13:13 -0700 | [diff] [blame] | 94 | copts = UPB_DEFAULT_COPTS, |
Anna R | de1bc11 | 2020-01-07 15:45:19 -0800 | [diff] [blame] | 95 | textual_hdrs = [ |
| 96 | "upb/port_def.inc", |
| 97 | "upb/port_undef.inc", |
| 98 | ], |
Matt Kulukundis | c49e6df | 2022-02-21 20:12:58 -0500 | [diff] [blame] | 99 | visibility = ["//:__subpackages__"], |
Anna R | de1bc11 | 2020-01-07 15:45:19 -0800 | [diff] [blame] | 100 | ) |
| 101 | |
| 102 | cc_library( |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 103 | name = "upb", |
| 104 | srcs = [ |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 105 | "upb/arena.c", |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 106 | "upb/decode.c", |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 107 | "upb/encode.c", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 108 | "upb/internal/decode.h", |
| 109 | "upb/internal/table.h", |
| 110 | "upb/internal/upb.h", |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 111 | "upb/msg.c", |
Joshua Haberman | 3881393 | 2021-04-05 16:00:25 -0700 | [diff] [blame] | 112 | "upb/msg_internal.h", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 113 | "upb/status.c", |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 114 | "upb/table.c", |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 115 | "upb/upb.c", |
| 116 | ], |
| 117 | hdrs = [ |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 118 | "upb/arena.h", |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 119 | "upb/decode.h", |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 120 | "upb/encode.h", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 121 | "upb/extension_registry.h", |
Joshua Haberman | 1674f28 | 2021-04-04 18:43:24 -0700 | [diff] [blame] | 122 | "upb/msg.h", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 123 | "upb/status.h", |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 124 | "upb/upb.h", |
Joshua Haberman | 2559e78 | 2020-04-09 14:36:24 -0700 | [diff] [blame] | 125 | "upb/upb.hpp", |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 126 | ], |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 127 | copts = UPB_DEFAULT_COPTS, |
Joshua Haberman | ba29af3 | 2019-06-01 19:27:49 -0700 | [diff] [blame] | 128 | visibility = ["//visibility:public"], |
Joshua Haberman | efd576b | 2020-10-26 21:37:17 -0700 | [diff] [blame] | 129 | deps = [ |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 130 | ":extension_registry", |
Joshua Haberman | efd576b | 2020-10-26 21:37:17 -0700 | [diff] [blame] | 131 | ":fastdecode", |
| 132 | ":port", |
Joshua Haberman | 4307f5d | 2021-10-11 23:02:32 -0700 | [diff] [blame] | 133 | "//third_party/utf8_range", |
Joshua Haberman | efd576b | 2020-10-26 21:37:17 -0700 | [diff] [blame] | 134 | ], |
Joshua Haberman | cb234e6 | 2020-10-17 17:48:32 -0700 | [diff] [blame] | 135 | ) |
| 136 | |
| 137 | cc_library( |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 138 | name = "extension_registry", |
| 139 | srcs = [ |
| 140 | "upb/extension_registry.c", |
| 141 | "upb/msg.h", |
| 142 | "upb/msg_internal.h", |
| 143 | "upb/upb.h", |
| 144 | ], |
| 145 | hdrs = [ |
| 146 | "upb/extension_registry.h", |
| 147 | ], |
| 148 | copts = UPB_DEFAULT_COPTS, |
| 149 | visibility = ["//visibility:public"], |
| 150 | deps = [ |
| 151 | ":port", |
| 152 | ":table", |
| 153 | ], |
| 154 | ) |
| 155 | |
| 156 | cc_library( |
Protobuf Team Bot | bb38fc9 | 2022-06-10 14:32:58 -0700 | [diff] [blame] | 157 | name = "mini_descriptor", |
| 158 | srcs = [ |
| 159 | "upb/mini_descriptor.c", |
| 160 | ], |
| 161 | hdrs = [ |
| 162 | "upb/mini_descriptor.h", |
| 163 | ], |
| 164 | copts = UPB_DEFAULT_COPTS, |
| 165 | visibility = ["//visibility:public"], |
| 166 | deps = [ |
| 167 | ":descriptor_upb_proto", |
| 168 | ":mini_table", |
| 169 | ":port", |
| 170 | ":reflection", |
| 171 | ":table", |
| 172 | ":upb", |
| 173 | ], |
| 174 | ) |
| 175 | |
| 176 | cc_library( |
Joshua Haberman | 970c645 | 2022-03-08 17:44:06 -0800 | [diff] [blame] | 177 | name = "mini_table_internal", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 178 | hdrs = [ |
| 179 | "upb/msg_internal.h", |
| 180 | ], |
Joshua Haberman | 970c645 | 2022-03-08 17:44:06 -0800 | [diff] [blame] | 181 | deps = [ |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 182 | ":extension_registry", |
Joshua Haberman | 970c645 | 2022-03-08 17:44:06 -0800 | [diff] [blame] | 183 | ":port", |
| 184 | ":table", |
| 185 | ":upb", |
| 186 | ], |
| 187 | ) |
| 188 | |
| 189 | cc_library( |
Joshua Haberman | 8ede0d5 | 2022-03-05 18:33:27 -0800 | [diff] [blame] | 190 | name = "mini_table", |
Protobuf Team | e5468b4 | 2022-04-19 14:09:14 -0700 | [diff] [blame] | 191 | srcs = [ |
| 192 | "upb/mini_table.c", |
| 193 | ], |
Joshua Haberman | 8ede0d5 | 2022-03-05 18:33:27 -0800 | [diff] [blame] | 194 | hdrs = [ |
| 195 | "upb/mini_table.h", |
| 196 | "upb/mini_table.hpp", |
| 197 | ], |
| 198 | copts = UPB_DEFAULT_COPTS, |
| 199 | visibility = ["//visibility:public"], |
Joshua Haberman | 970c645 | 2022-03-08 17:44:06 -0800 | [diff] [blame] | 200 | deps = [ |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 201 | ":extension_registry", |
Joshua Haberman | 970c645 | 2022-03-08 17:44:06 -0800 | [diff] [blame] | 202 | ":mini_table_internal", |
| 203 | ":port", |
| 204 | ":upb", |
| 205 | ], |
Joshua Haberman | 8ede0d5 | 2022-03-05 18:33:27 -0800 | [diff] [blame] | 206 | ) |
| 207 | |
Protobuf Team | e5468b4 | 2022-04-19 14:09:14 -0700 | [diff] [blame] | 208 | cc_library( |
| 209 | name = "mini_table_accessors", |
| 210 | srcs = [ |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 211 | "upb/internal/mini_table_accessors.h", |
Protobuf Team | e5468b4 | 2022-04-19 14:09:14 -0700 | [diff] [blame] | 212 | "upb/mini_table_accessors.c", |
Protobuf Team | e5468b4 | 2022-04-19 14:09:14 -0700 | [diff] [blame] | 213 | ], |
| 214 | hdrs = [ |
| 215 | "upb/mini_table_accessors.h", |
| 216 | ], |
| 217 | copts = UPB_DEFAULT_COPTS, |
Joshua Haberman | 6df5517 | 2022-05-24 11:41:56 -0700 | [diff] [blame] | 218 | visibility = ["//visibility:public"], |
Protobuf Team | e5468b4 | 2022-04-19 14:09:14 -0700 | [diff] [blame] | 219 | deps = [ |
Protobuf Team | c7620a4 | 2022-04-29 13:21:20 -0700 | [diff] [blame] | 220 | ":collections", |
Protobuf Team | e5468b4 | 2022-04-19 14:09:14 -0700 | [diff] [blame] | 221 | ":mini_table", |
| 222 | ":mini_table_internal", |
| 223 | ":port", |
| 224 | ":upb", |
| 225 | ], |
| 226 | ) |
| 227 | |
Joshua Haberman | 8ede0d5 | 2022-03-05 18:33:27 -0800 | [diff] [blame] | 228 | cc_test( |
| 229 | name = "mini_table_test", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 230 | srcs = [ |
| 231 | "upb/internal/table.h", |
| 232 | "upb/mini_table_test.cc", |
| 233 | ], |
Joshua Haberman | 8ede0d5 | 2022-03-05 18:33:27 -0800 | [diff] [blame] | 234 | deps = [ |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 235 | ":extension_registry", |
Joshua Haberman | 8ede0d5 | 2022-03-05 18:33:27 -0800 | [diff] [blame] | 236 | ":mini_table", |
Joshua Haberman | 970c645 | 2022-03-08 17:44:06 -0800 | [diff] [blame] | 237 | ":mini_table_internal", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 238 | ":port", |
Joshua Haberman | 970c645 | 2022-03-08 17:44:06 -0800 | [diff] [blame] | 239 | ":upb", |
Joshua Haberman | 8ede0d5 | 2022-03-05 18:33:27 -0800 | [diff] [blame] | 240 | "@com_google_absl//absl/container:flat_hash_set", |
Joshua Haberman | 970c645 | 2022-03-08 17:44:06 -0800 | [diff] [blame] | 241 | "@com_google_googletest//:gtest_main", |
Joshua Haberman | 8d148f0 | 2022-03-13 18:45:50 -0700 | [diff] [blame] | 242 | "@com_google_protobuf//:protobuf", |
Joshua Haberman | 8ede0d5 | 2022-03-05 18:33:27 -0800 | [diff] [blame] | 243 | ], |
| 244 | ) |
| 245 | |
Protobuf Team | e5468b4 | 2022-04-19 14:09:14 -0700 | [diff] [blame] | 246 | cc_test( |
| 247 | name = "mini_table_accessors_test", |
| 248 | srcs = ["upb/mini_table_accessors_test.cc"], |
| 249 | deps = [ |
Protobuf Team | c7620a4 | 2022-04-29 13:21:20 -0700 | [diff] [blame] | 250 | ":collections", |
Protobuf Team | e5468b4 | 2022-04-19 14:09:14 -0700 | [diff] [blame] | 251 | ":mini_table", |
| 252 | ":mini_table_accessors", |
| 253 | ":mini_table_internal", |
| 254 | ":test_messages_proto2_proto_upb", |
| 255 | ":test_messages_proto3_proto_upb", |
Protobuf Team | 459059e | 2022-05-09 14:13:02 -0700 | [diff] [blame] | 256 | ":test_upb_proto", |
Protobuf Team | e5468b4 | 2022-04-19 14:09:14 -0700 | [diff] [blame] | 257 | ":upb", |
| 258 | "@com_google_absl//absl/container:flat_hash_set", |
| 259 | "@com_google_googletest//:gtest_main", |
| 260 | "@com_google_protobuf//:protobuf", |
| 261 | ], |
| 262 | ) |
| 263 | |
Joshua Haberman | 8ede0d5 | 2022-03-05 18:33:27 -0800 | [diff] [blame] | 264 | cc_library( |
Joshua Haberman | cb234e6 | 2020-10-17 17:48:32 -0700 | [diff] [blame] | 265 | name = "fastdecode", |
| 266 | srcs = [ |
Joshua Haberman | 3d437bb | 2021-10-13 09:53:36 -0700 | [diff] [blame] | 267 | "upb/decode.h", |
Joshua Haberman | cb234e6 | 2020-10-17 17:48:32 -0700 | [diff] [blame] | 268 | "upb/decode_fast.c", |
| 269 | "upb/decode_fast.h", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 270 | "upb/internal/decode.h", |
| 271 | "upb/internal/upb.h", |
Joshua Haberman | cb234e6 | 2020-10-17 17:48:32 -0700 | [diff] [blame] | 272 | "upb/msg.h", |
Joshua Haberman | 3881393 | 2021-04-05 16:00:25 -0700 | [diff] [blame] | 273 | "upb/msg_internal.h", |
Joshua Haberman | cb234e6 | 2020-10-17 17:48:32 -0700 | [diff] [blame] | 274 | ], |
Joshua Haberman | e86541a | 2020-10-28 17:53:09 -0700 | [diff] [blame] | 275 | copts = UPB_DEFAULT_COPTS, |
Joshua Haberman | efd576b | 2020-10-26 21:37:17 -0700 | [diff] [blame] | 276 | deps = [ |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 277 | ":extension_registry", |
Joshua Haberman | efd576b | 2020-10-26 21:37:17 -0700 | [diff] [blame] | 278 | ":port", |
| 279 | ":table", |
Joshua Haberman | 4307f5d | 2021-10-11 23:02:32 -0700 | [diff] [blame] | 280 | "//third_party/utf8_range", |
Joshua Haberman | efd576b | 2020-10-26 21:37:17 -0700 | [diff] [blame] | 281 | ], |
Joshua Haberman | ba29af3 | 2019-06-01 19:27:49 -0700 | [diff] [blame] | 282 | ) |
| 283 | |
| 284 | # Common support routines used by generated code. This library has no |
| 285 | # implementation, but depends on :upb and exposes a few more hdrs. |
| 286 | # |
| 287 | # This is public only because we have no way of visibility-limiting it to |
| 288 | # upb_proto_library() only. This interface is not stable and by using it you |
| 289 | # give up any backward compatibility guarantees. |
| 290 | cc_library( |
| 291 | name = "generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", |
Joshua Haberman | ba29af3 | 2019-06-01 19:27:49 -0700 | [diff] [blame] | 292 | hdrs = [ |
Joshua Haberman | 8c530f9 | 2022-02-22 14:50:55 -0800 | [diff] [blame] | 293 | "upb/decode.h", |
Joshua Haberman | aec762e | 2020-10-11 23:14:50 -0700 | [diff] [blame] | 294 | "upb/decode_fast.h", |
Joshua Haberman | 8c530f9 | 2022-02-22 14:50:55 -0800 | [diff] [blame] | 295 | "upb/encode.h", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 296 | "upb/extension_registry.h", |
Joshua Haberman | ba29af3 | 2019-06-01 19:27:49 -0700 | [diff] [blame] | 297 | "upb/msg.h", |
Joshua Haberman | 42bdfcb | 2021-04-06 09:25:28 -0700 | [diff] [blame] | 298 | "upb/msg_internal.h", |
Anna R | a27429f | 2020-01-09 14:50:03 -0800 | [diff] [blame] | 299 | "upb/port_def.inc", |
| 300 | "upb/port_undef.inc", |
Joshua Haberman | ba29af3 | 2019-06-01 19:27:49 -0700 | [diff] [blame] | 301 | ], |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 302 | copts = UPB_DEFAULT_COPTS, |
Vishal Powar | 7031f77 | 2018-11-28 15:32:16 -0800 | [diff] [blame] | 303 | visibility = ["//visibility:public"], |
Anna R | de1bc11 | 2020-01-07 15:45:19 -0800 | [diff] [blame] | 304 | deps = [ |
Joshua Haberman | 4b8c04e | 2020-02-18 16:50:25 -0800 | [diff] [blame] | 305 | ":table", |
Anna R | de1bc11 | 2020-01-07 15:45:19 -0800 | [diff] [blame] | 306 | ":upb", |
| 307 | ], |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 308 | ) |
| 309 | |
Joshua Haberman | 8c530f9 | 2022-02-22 14:50:55 -0800 | [diff] [blame] | 310 | cc_library( |
| 311 | name = "generated_reflection_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", |
| 312 | hdrs = [ |
| 313 | "upb/def.h", |
| 314 | "upb/port_def.inc", |
| 315 | "upb/port_undef.inc", |
| 316 | ], |
| 317 | copts = UPB_DEFAULT_COPTS, |
| 318 | visibility = ["//visibility:public"], |
| 319 | deps = [ |
| 320 | ":descriptor_upb_proto", |
| 321 | ":reflection", |
| 322 | ":table", |
| 323 | ], |
| 324 | ) |
| 325 | |
Josh Haberman | cd9e1e6 | 2019-04-17 15:23:00 -0700 | [diff] [blame] | 326 | upb_proto_library( |
Joshua Haberman | 543a0ce | 2020-05-26 22:30:50 -0700 | [diff] [blame] | 327 | name = "descriptor_upb_proto", |
| 328 | visibility = ["//visibility:public"], |
| 329 | deps = ["@com_google_protobuf//:descriptor_proto"], |
| 330 | ) |
| 331 | |
| 332 | upb_proto_reflection_library( |
| 333 | name = "descriptor_upb_proto_reflection", |
Joshua Haberman | c58541e | 2019-05-15 09:49:29 -0700 | [diff] [blame] | 334 | visibility = ["//visibility:public"], |
Google-Autofuzz | 8f19667 | 2019-06-25 20:14:14 -0400 | [diff] [blame] | 335 | deps = ["@com_google_protobuf//:descriptor_proto"], |
Josh Haberman | cd9e1e6 | 2019-04-17 15:23:00 -0700 | [diff] [blame] | 336 | ) |
| 337 | |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 338 | cc_library( |
Protobuf Team | 823ed18 | 2022-04-28 16:07:14 -0700 | [diff] [blame] | 339 | name = "collections", |
| 340 | srcs = [ |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 341 | "upb/array.c", |
| 342 | "upb/map.c", |
Protobuf Team | 823ed18 | 2022-04-28 16:07:14 -0700 | [diff] [blame] | 343 | ], |
| 344 | hdrs = [ |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 345 | "upb/array.h", |
Protobuf Team | 823ed18 | 2022-04-28 16:07:14 -0700 | [diff] [blame] | 346 | "upb/collections.h", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 347 | "upb/map.h", |
| 348 | "upb/message_value.h", |
Protobuf Team | 823ed18 | 2022-04-28 16:07:14 -0700 | [diff] [blame] | 349 | ], |
| 350 | copts = UPB_DEFAULT_COPTS, |
| 351 | visibility = ["//visibility:public"], |
| 352 | deps = [ |
| 353 | ":descriptor_upb_proto", |
| 354 | ":mini_table", |
| 355 | ":port", |
| 356 | ":table", |
| 357 | ":upb", |
| 358 | ], |
| 359 | ) |
| 360 | |
| 361 | cc_library( |
Joshua Haberman | 928ef7f | 2019-03-27 12:52:33 -0700 | [diff] [blame] | 362 | name = "reflection", |
| 363 | srcs = [ |
| 364 | "upb/def.c", |
Joshua Haberman | 58010a3 | 2020-02-18 16:53:21 -0800 | [diff] [blame] | 365 | "upb/msg.h", |
Joshua Haberman | 9a360ad | 2019-11-12 08:08:46 -0800 | [diff] [blame] | 366 | "upb/reflection.c", |
Joshua Haberman | 928ef7f | 2019-03-27 12:52:33 -0700 | [diff] [blame] | 367 | ], |
| 368 | hdrs = [ |
| 369 | "upb/def.h", |
Joshua Haberman | 2559e78 | 2020-04-09 14:36:24 -0700 | [diff] [blame] | 370 | "upb/def.hpp", |
Joshua Haberman | 9a360ad | 2019-11-12 08:08:46 -0800 | [diff] [blame] | 371 | "upb/reflection.h", |
Joshua Haberman | 5e550e8 | 2021-01-09 15:45:44 -0800 | [diff] [blame] | 372 | "upb/reflection.hpp", |
Joshua Haberman | 928ef7f | 2019-03-27 12:52:33 -0700 | [diff] [blame] | 373 | ], |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 374 | copts = UPB_DEFAULT_COPTS, |
Joshua Haberman | 928ef7f | 2019-03-27 12:52:33 -0700 | [diff] [blame] | 375 | visibility = ["//visibility:public"], |
Josh Haberman | cd9e1e6 | 2019-04-17 15:23:00 -0700 | [diff] [blame] | 376 | deps = [ |
Protobuf Team | 823ed18 | 2022-04-28 16:07:14 -0700 | [diff] [blame] | 377 | ":collections", |
Joshua Haberman | 543a0ce | 2020-05-26 22:30:50 -0700 | [diff] [blame] | 378 | ":descriptor_upb_proto", |
Joshua Haberman | fa8b605 | 2022-04-19 13:15:55 -0700 | [diff] [blame] | 379 | ":mini_table", |
Anna R | fc49411 | 2020-01-09 14:16:25 -0800 | [diff] [blame] | 380 | ":port", |
Joshua Haberman | 9b07311 | 2019-05-14 11:12:13 -0700 | [diff] [blame] | 381 | ":table", |
Joshua Haberman | 9a66356 | 2019-05-13 16:13:39 -0700 | [diff] [blame] | 382 | ":upb", |
Josh Haberman | cd9e1e6 | 2019-04-17 15:23:00 -0700 | [diff] [blame] | 383 | ], |
Joshua Haberman | 928ef7f | 2019-03-27 12:52:33 -0700 | [diff] [blame] | 384 | ) |
| 385 | |
Joshua Haberman | ce1a399 | 2020-02-04 06:22:09 -0800 | [diff] [blame] | 386 | cc_library( |
| 387 | name = "textformat", |
| 388 | srcs = [ |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 389 | "upb/internal/upb.h", |
Joshua Haberman | 02c89a8 | 2020-02-10 14:56:27 -0800 | [diff] [blame] | 390 | "upb/text_encode.c", |
Joshua Haberman | ce1a399 | 2020-02-04 06:22:09 -0800 | [diff] [blame] | 391 | ], |
| 392 | hdrs = [ |
Joshua Haberman | 02c89a8 | 2020-02-10 14:56:27 -0800 | [diff] [blame] | 393 | "upb/text_encode.h", |
Joshua Haberman | ce1a399 | 2020-02-04 06:22:09 -0800 | [diff] [blame] | 394 | ], |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 395 | copts = UPB_DEFAULT_COPTS, |
Joshua Haberman | ce1a399 | 2020-02-04 06:22:09 -0800 | [diff] [blame] | 396 | visibility = ["//visibility:public"], |
| 397 | deps = [ |
Joshua Haberman | 4b8c04e | 2020-02-18 16:50:25 -0800 | [diff] [blame] | 398 | ":port", |
Joshua Haberman | ce1a399 | 2020-02-04 06:22:09 -0800 | [diff] [blame] | 399 | ":reflection", |
Matt Kulukundis | edd1dd3 | 2022-02-20 17:44:27 -0500 | [diff] [blame] | 400 | ":table", |
Joshua Haberman | ce1a399 | 2020-02-04 06:22:09 -0800 | [diff] [blame] | 401 | ], |
| 402 | ) |
| 403 | |
Joshua Haberman | 6e9db7d | 2020-02-15 19:31:51 -0800 | [diff] [blame] | 404 | cc_library( |
| 405 | name = "json", |
| 406 | srcs = [ |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 407 | "upb/internal/upb.h", |
Joshua Haberman | d49c1db | 2020-02-23 19:49:39 -0800 | [diff] [blame] | 408 | "upb/json_decode.c", |
Joshua Haberman | 6e9db7d | 2020-02-15 19:31:51 -0800 | [diff] [blame] | 409 | "upb/json_encode.c", |
| 410 | ], |
| 411 | hdrs = [ |
Joshua Haberman | d49c1db | 2020-02-23 19:49:39 -0800 | [diff] [blame] | 412 | "upb/json_decode.h", |
Joshua Haberman | 6e9db7d | 2020-02-15 19:31:51 -0800 | [diff] [blame] | 413 | "upb/json_encode.h", |
| 414 | ], |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 415 | copts = UPB_DEFAULT_COPTS, |
Lidi Zheng | f72c26c | 2020-12-10 16:23:08 -0800 | [diff] [blame] | 416 | visibility = ["//visibility:public"], |
Joshua Haberman | 6e9db7d | 2020-02-15 19:31:51 -0800 | [diff] [blame] | 417 | deps = [ |
Joshua Haberman | 4b8c04e | 2020-02-18 16:50:25 -0800 | [diff] [blame] | 418 | ":port", |
Joshua Haberman | 6e9db7d | 2020-02-15 19:31:51 -0800 | [diff] [blame] | 419 | ":reflection", |
Joshua Haberman | 4b8c04e | 2020-02-18 16:50:25 -0800 | [diff] [blame] | 420 | ":upb", |
Joshua Haberman | 6e9db7d | 2020-02-15 19:31:51 -0800 | [diff] [blame] | 421 | ], |
| 422 | ) |
| 423 | |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 424 | # Tests ######################################################################## |
| 425 | |
| 426 | cc_test( |
| 427 | name = "test_generated_code", |
| 428 | srcs = ["upb/test_generated_code.cc"], |
| 429 | deps = [ |
| 430 | ":empty_upbdefs_proto", |
Joshua Haberman | 1cf8214 | 2022-05-12 13:57:50 -0700 | [diff] [blame] | 431 | ":port", |
Protobuf Team | bef5368 | 2022-04-04 11:18:39 -0700 | [diff] [blame] | 432 | ":test_messages_proto2_proto_upb", |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 433 | ":test_messages_proto3_proto_upb", |
| 434 | ":test_upb_proto", |
Matt Kulukundis | edd1dd3 | 2022-02-20 17:44:27 -0500 | [diff] [blame] | 435 | ":upb", |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 436 | "@com_google_googletest//:gtest_main", |
| 437 | ], |
| 438 | ) |
| 439 | |
| 440 | proto_library( |
| 441 | name = "test_proto", |
| 442 | testonly = 1, |
| 443 | srcs = ["upb/test.proto"], |
| 444 | ) |
| 445 | |
| 446 | upb_proto_library( |
| 447 | name = "test_upb_proto", |
| 448 | testonly = 1, |
| 449 | deps = [":test_proto"], |
| 450 | ) |
| 451 | |
| 452 | proto_library( |
| 453 | name = "empty_proto", |
| 454 | srcs = ["upb/empty.proto"], |
| 455 | ) |
| 456 | |
| 457 | upb_proto_reflection_library( |
| 458 | name = "empty_upbdefs_proto", |
| 459 | testonly = 1, |
| 460 | deps = [":empty_proto"], |
| 461 | ) |
| 462 | |
| 463 | upb_proto_library( |
Protobuf Team | bef5368 | 2022-04-04 11:18:39 -0700 | [diff] [blame] | 464 | name = "test_messages_proto2_proto_upb", |
| 465 | testonly = 1, |
| 466 | deps = ["@com_google_protobuf//:test_messages_proto2_proto"], |
| 467 | ) |
| 468 | |
| 469 | upb_proto_library( |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 470 | name = "test_messages_proto3_proto_upb", |
| 471 | testonly = 1, |
| 472 | deps = ["@com_google_protobuf//:test_messages_proto3_proto"], |
| 473 | ) |
Matt Kulukundis | 61b0905 | 2022-02-19 19:35:58 -0500 | [diff] [blame] | 474 | |
Protobuf Team Bot | 6e1aa9f | 2022-06-08 11:17:20 -0700 | [diff] [blame] | 475 | proto_library( |
| 476 | name = "json_test_proto", |
| 477 | testonly = 1, |
| 478 | srcs = ["upb/json_test.proto"], |
| 479 | deps = ["@com_google_protobuf//:struct_proto"], |
| 480 | ) |
| 481 | |
| 482 | upb_proto_library( |
| 483 | name = "json_test_upb_proto", |
| 484 | testonly = 1, |
| 485 | deps = [":json_test_proto"], |
| 486 | ) |
| 487 | |
| 488 | upb_proto_reflection_library( |
| 489 | name = "json_test_upb_proto_reflection", |
| 490 | testonly = 1, |
| 491 | deps = [":json_test_proto"], |
| 492 | ) |
| 493 | |
| 494 | cc_test( |
| 495 | name = "json_test", |
| 496 | srcs = ["upb/json_test.cc"], |
| 497 | deps = [ |
| 498 | ":json", |
| 499 | ":json_test_upb_proto", |
| 500 | ":json_test_upb_proto_reflection", |
| 501 | ":reflection", |
| 502 | ":struct_upb_proto", |
| 503 | ":upb", |
| 504 | "@com_google_googletest//:gtest_main", |
| 505 | ], |
| 506 | ) |
| 507 | |
Joshua Haberman | ce012b7 | 2021-10-01 16:34:42 -0700 | [diff] [blame] | 508 | cc_test( |
| 509 | name = "msg_test", |
| 510 | srcs = ["upb/msg_test.cc"], |
| 511 | deps = [ |
Joshua Haberman | ce012b7 | 2021-10-01 16:34:42 -0700 | [diff] [blame] | 512 | ":json", |
Matt Kulukundis | a3bd5f8 | 2022-02-21 23:47:27 -0500 | [diff] [blame] | 513 | ":msg_test_upb_proto", |
Matt Kulukundis | 61b0905 | 2022-02-19 19:35:58 -0500 | [diff] [blame] | 514 | ":msg_test_upb_proto_reflection", |
Matt Kulukundis | a3bd5f8 | 2022-02-21 23:47:27 -0500 | [diff] [blame] | 515 | ":reflection", |
Matt Kulukundis | 42c121e | 2022-02-21 23:58:17 -0500 | [diff] [blame] | 516 | ":test_messages_proto3_proto_upb", |
Matt Kulukundis | a3bd5f8 | 2022-02-21 23:47:27 -0500 | [diff] [blame] | 517 | ":upb", |
Matt Kulukundis | 61b0905 | 2022-02-19 19:35:58 -0500 | [diff] [blame] | 518 | "@com_google_googletest//:gtest_main", |
Joshua Haberman | ce012b7 | 2021-10-01 16:34:42 -0700 | [diff] [blame] | 519 | ], |
| 520 | ) |
| 521 | |
| 522 | proto_library( |
| 523 | name = "msg_test_proto", |
Matt Kulukundis | 61b0905 | 2022-02-19 19:35:58 -0500 | [diff] [blame] | 524 | testonly = 1, |
Joshua Haberman | ce012b7 | 2021-10-01 16:34:42 -0700 | [diff] [blame] | 525 | srcs = ["upb/msg_test.proto"], |
| 526 | deps = ["@com_google_protobuf//:test_messages_proto3_proto"], |
| 527 | ) |
| 528 | |
Matt Kulukundis | a3bd5f8 | 2022-02-21 23:47:27 -0500 | [diff] [blame] | 529 | upb_proto_library( |
| 530 | name = "msg_test_upb_proto", |
| 531 | testonly = 1, |
| 532 | deps = [":msg_test_proto"], |
| 533 | ) |
| 534 | |
Joshua Haberman | ce012b7 | 2021-10-01 16:34:42 -0700 | [diff] [blame] | 535 | upb_proto_reflection_library( |
| 536 | name = "msg_test_upb_proto_reflection", |
Matt Kulukundis | 61b0905 | 2022-02-19 19:35:58 -0500 | [diff] [blame] | 537 | testonly = 1, |
Joshua Haberman | ce012b7 | 2021-10-01 16:34:42 -0700 | [diff] [blame] | 538 | deps = [":msg_test_proto"], |
| 539 | ) |
| 540 | |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 541 | proto_library( |
| 542 | name = "test_cpp_proto", |
| 543 | srcs = ["upb/test_cpp.proto"], |
Matt Kulukundis | 61b0905 | 2022-02-19 19:35:58 -0500 | [diff] [blame] | 544 | deps = ["@com_google_protobuf//:timestamp_proto"], |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 545 | ) |
| 546 | |
| 547 | upb_proto_library( |
| 548 | name = "test_cpp_upb_proto", |
| 549 | deps = ["test_cpp_proto"], |
| 550 | ) |
| 551 | |
| 552 | upb_proto_reflection_library( |
| 553 | name = "test_cpp_upb_proto_reflection", |
| 554 | deps = ["test_cpp_proto"], |
| 555 | ) |
| 556 | |
Matt Kulukundis | 92d71a4 | 2022-02-20 15:20:48 -0500 | [diff] [blame] | 557 | upb_proto_library( |
Protobuf Team Bot | 6e1aa9f | 2022-06-08 11:17:20 -0700 | [diff] [blame] | 558 | name = "struct_upb_proto", |
| 559 | deps = ["@com_google_protobuf//:struct_proto"], |
| 560 | ) |
| 561 | |
| 562 | upb_proto_library( |
Matt Kulukundis | 92d71a4 | 2022-02-20 15:20:48 -0500 | [diff] [blame] | 563 | name = "timestamp_upb_proto", |
| 564 | deps = ["@com_google_protobuf//:timestamp_proto"], |
| 565 | ) |
| 566 | |
| 567 | upb_proto_reflection_library( |
| 568 | name = "timestamp_upb_proto_reflection", |
| 569 | deps = ["@com_google_protobuf//:timestamp_proto"], |
| 570 | ) |
| 571 | |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 572 | cc_test( |
| 573 | name = "test_cpp", |
| 574 | srcs = ["upb/test_cpp.cc"], |
| 575 | copts = UPB_DEFAULT_CPPOPTS, |
| 576 | deps = [ |
| 577 | ":test_cpp_upb_proto", |
| 578 | ":test_cpp_upb_proto_reflection", |
Matt Kulukundis | 92d71a4 | 2022-02-20 15:20:48 -0500 | [diff] [blame] | 579 | ":timestamp_upb_proto", |
| 580 | ":timestamp_upb_proto_reflection", |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 581 | "//:json", |
| 582 | "//:port", |
| 583 | "//:reflection", |
| 584 | "//:upb", |
| 585 | "@com_google_googletest//:gtest_main", |
| 586 | ], |
| 587 | ) |
| 588 | |
| 589 | cc_test( |
| 590 | name = "test_table", |
| 591 | srcs = ["upb/test_table.cc"], |
| 592 | copts = UPB_DEFAULT_CPPOPTS, |
| 593 | deps = [ |
| 594 | "//:port", |
| 595 | "//:table", |
| 596 | "//:upb", |
| 597 | "@com_google_googletest//:gtest_main", |
| 598 | ], |
| 599 | ) |
| 600 | |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 601 | upb_proto_library( |
| 602 | name = "conformance_proto_upb", |
| 603 | testonly = 1, |
Joshua Haberman | 32f45b5 | 2022-05-09 22:00:33 -0700 | [diff] [blame] | 604 | deps = ["@com_google_protobuf//conformance:conformance_proto"], |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 605 | ) |
| 606 | |
| 607 | upb_proto_reflection_library( |
| 608 | name = "conformance_proto_upbdefs", |
| 609 | testonly = 1, |
Joshua Haberman | 32f45b5 | 2022-05-09 22:00:33 -0700 | [diff] [blame] | 610 | deps = ["@com_google_protobuf//conformance:conformance_proto"], |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 611 | ) |
| 612 | |
| 613 | upb_proto_reflection_library( |
| 614 | name = "test_messages_proto2_upbdefs", |
| 615 | testonly = 1, |
| 616 | deps = ["@com_google_protobuf//:test_messages_proto2_proto"], |
| 617 | ) |
| 618 | |
| 619 | upb_proto_reflection_library( |
| 620 | name = "test_messages_proto3_upbdefs", |
| 621 | testonly = 1, |
| 622 | deps = ["@com_google_protobuf//:test_messages_proto3_proto"], |
| 623 | ) |
| 624 | |
| 625 | cc_binary( |
| 626 | name = "conformance_upb", |
| 627 | testonly = 1, |
| 628 | srcs = ["upb/conformance_upb.c"], |
| 629 | copts = UPB_DEFAULT_COPTS, |
| 630 | data = ["upb/conformance_upb_failures.txt"], |
| 631 | deps = [ |
| 632 | ":conformance_proto_upb", |
| 633 | ":conformance_proto_upbdefs", |
| 634 | ":test_messages_proto2_upbdefs", |
| 635 | ":test_messages_proto3_upbdefs", |
| 636 | "//:json", |
| 637 | "//:port", |
| 638 | "//:reflection", |
| 639 | "//:textformat", |
| 640 | "//:upb", |
| 641 | ], |
| 642 | ) |
| 643 | |
| 644 | make_shell_script( |
| 645 | name = "gen_test_conformance_upb", |
| 646 | out = "test_conformance_upb.sh", |
Joshua Haberman | 32f45b5 | 2022-05-09 22:00:33 -0700 | [diff] [blame] | 647 | contents = "external/com_google_protobuf/conformance/conformance_test_runner " + |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 648 | " --enforce_recommended " + |
| 649 | " --failure_list ./upb/conformance_upb_failures.txt" + |
| 650 | " ./conformance_upb", |
| 651 | ) |
| 652 | |
| 653 | sh_test( |
| 654 | name = "test_conformance_upb", |
| 655 | srcs = ["test_conformance_upb.sh"], |
| 656 | data = [ |
| 657 | "upb/conformance_upb_failures.txt", |
| 658 | ":conformance_upb", |
Joshua Haberman | 32f45b5 | 2022-05-09 22:00:33 -0700 | [diff] [blame] | 659 | "@com_google_protobuf//conformance:conformance_test_runner", |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 660 | ], |
| 661 | deps = ["@bazel_tools//tools/bash/runfiles"], |
| 662 | ) |
| 663 | |
Joshua Haberman | 50c1298 | 2022-03-08 15:52:37 -0800 | [diff] [blame] | 664 | cc_binary( |
| 665 | name = "conformance_upb_dynamic_minitable", |
| 666 | testonly = 1, |
| 667 | srcs = ["upb/conformance_upb.c"], |
| 668 | copts = UPB_DEFAULT_COPTS + [ |
Joshua Haberman | 970c645 | 2022-03-08 17:44:06 -0800 | [diff] [blame] | 669 | "-DREBUILD_MINITABLES", |
Joshua Haberman | 50c1298 | 2022-03-08 15:52:37 -0800 | [diff] [blame] | 670 | ], |
| 671 | data = ["upb/conformance_upb_failures.txt"], |
| 672 | deps = [ |
| 673 | ":conformance_proto_upb", |
| 674 | ":conformance_proto_upbdefs", |
| 675 | ":test_messages_proto2_upbdefs", |
| 676 | ":test_messages_proto3_upbdefs", |
| 677 | "//:json", |
| 678 | "//:port", |
| 679 | "//:reflection", |
| 680 | "//:textformat", |
| 681 | "//:upb", |
| 682 | ], |
| 683 | ) |
| 684 | |
| 685 | make_shell_script( |
| 686 | name = "gen_test_conformance_upb_dynamic_minitable", |
| 687 | out = "test_conformance_upb_dynamic_minitable.sh", |
Joshua Haberman | 32f45b5 | 2022-05-09 22:00:33 -0700 | [diff] [blame] | 688 | contents = "external/com_google_protobuf/conformance/conformance_test_runner " + |
Joshua Haberman | 50c1298 | 2022-03-08 15:52:37 -0800 | [diff] [blame] | 689 | " --enforce_recommended " + |
| 690 | " --failure_list ./upb/conformance_upb_failures.txt" + |
| 691 | " ./conformance_upb_dynamic_minitable", |
| 692 | ) |
| 693 | |
| 694 | sh_test( |
| 695 | name = "test_conformance_upb_dynamic_minitable", |
| 696 | srcs = ["test_conformance_upb_dynamic_minitable.sh"], |
| 697 | data = [ |
| 698 | "upb/conformance_upb_failures.txt", |
| 699 | ":conformance_upb_dynamic_minitable", |
Joshua Haberman | 32f45b5 | 2022-05-09 22:00:33 -0700 | [diff] [blame] | 700 | "@com_google_protobuf//conformance:conformance_test_runner", |
Joshua Haberman | 50c1298 | 2022-03-08 15:52:37 -0800 | [diff] [blame] | 701 | ], |
| 702 | deps = ["@bazel_tools//tools/bash/runfiles"], |
| 703 | ) |
| 704 | |
Joshua Haberman | 928ef7f | 2019-03-27 12:52:33 -0700 | [diff] [blame] | 705 | # Internal C/C++ libraries ##################################################### |
| 706 | |
| 707 | cc_library( |
| 708 | name = "table", |
Joshua Haberman | cb234e6 | 2020-10-17 17:48:32 -0700 | [diff] [blame] | 709 | hdrs = [ |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 710 | "upb/arena.h", |
| 711 | "upb/internal/table.h", |
| 712 | "upb/status.h", |
Joshua Haberman | 3881393 | 2021-04-05 16:00:25 -0700 | [diff] [blame] | 713 | "upb/table_internal.h", |
Joshua Haberman | efd576b | 2020-10-26 21:37:17 -0700 | [diff] [blame] | 714 | "upb/upb.h", |
Joshua Haberman | cb234e6 | 2020-10-17 17:48:32 -0700 | [diff] [blame] | 715 | ], |
Joshua Haberman | dfc07a8 | 2022-02-26 21:51:59 -0800 | [diff] [blame] | 716 | visibility = [ |
| 717 | "//python:__pkg__", |
| 718 | "//tests:__pkg__", |
| 719 | ], |
Anna R | de1bc11 | 2020-01-07 15:45:19 -0800 | [diff] [blame] | 720 | deps = [ |
| 721 | ":port", |
Anna R | de1bc11 | 2020-01-07 15:45:19 -0800 | [diff] [blame] | 722 | ], |
Joshua Haberman | 928ef7f | 2019-03-27 12:52:33 -0700 | [diff] [blame] | 723 | ) |
| 724 | |
Joshua Haberman | 77371f0 | 2019-01-23 16:26:13 -0800 | [diff] [blame] | 725 | # Amalgamation ################################################################# |
| 726 | |
Protobuf Team | b8edc71 | 2022-03-16 08:24:52 -0700 | [diff] [blame] | 727 | # begin:github_only |
Joshua Haberman | 83c0edb | 2021-02-28 16:56:49 -0800 | [diff] [blame] | 728 | |
Joshua Haberman | 77371f0 | 2019-01-23 16:26:13 -0800 | [diff] [blame] | 729 | upb_amalgamation( |
| 730 | name = "gen_amalgamation", |
| 731 | outs = [ |
| 732 | "upb.c", |
| 733 | "upb.h", |
| 734 | ], |
Joshua Haberman | 77371f0 | 2019-01-23 16:26:13 -0800 | [diff] [blame] | 735 | libs = [ |
Protobuf Team | 823ed18 | 2022-04-28 16:07:14 -0700 | [diff] [blame] | 736 | ":collections", |
Joshua Haberman | 543a0ce | 2020-05-26 22:30:50 -0700 | [diff] [blame] | 737 | ":descriptor_upb_proto", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 738 | ":extension_registry", |
Joshua Haberman | fa8b605 | 2022-04-19 13:15:55 -0700 | [diff] [blame] | 739 | ":fastdecode", |
| 740 | ":mini_table", |
Anna R | de1bc11 | 2020-01-07 15:45:19 -0800 | [diff] [blame] | 741 | ":port", |
Joshua Haberman | fa8b605 | 2022-04-19 13:15:55 -0700 | [diff] [blame] | 742 | ":reflection", |
| 743 | ":upb", |
Joshua Haberman | 77371f0 | 2019-01-23 16:26:13 -0800 | [diff] [blame] | 744 | ], |
| 745 | ) |
| 746 | |
| 747 | cc_library( |
| 748 | name = "amalgamation", |
| 749 | srcs = ["upb.c"], |
| 750 | hdrs = ["upb.h"], |
Joshua Haberman | e86541a | 2020-10-28 17:53:09 -0700 | [diff] [blame] | 751 | copts = UPB_DEFAULT_COPTS, |
Joshua Haberman | 4307f5d | 2021-10-11 23:02:32 -0700 | [diff] [blame] | 752 | deps = ["//third_party/utf8_range"], |
Joshua Haberman | 77371f0 | 2019-01-23 16:26:13 -0800 | [diff] [blame] | 753 | ) |
| 754 | |
Joshua Haberman | 16facab | 2020-05-08 16:40:24 -0700 | [diff] [blame] | 755 | upb_amalgamation( |
Joshua Haberman | 543a0ce | 2020-05-26 22:30:50 -0700 | [diff] [blame] | 756 | name = "gen_php_amalgamation", |
Joshua Haberman | 16facab | 2020-05-08 16:40:24 -0700 | [diff] [blame] | 757 | outs = [ |
Joshua Haberman | 543a0ce | 2020-05-26 22:30:50 -0700 | [diff] [blame] | 758 | "php-upb.c", |
| 759 | "php-upb.h", |
Joshua Haberman | 16facab | 2020-05-08 16:40:24 -0700 | [diff] [blame] | 760 | ], |
Joshua Haberman | 16facab | 2020-05-08 16:40:24 -0700 | [diff] [blame] | 761 | libs = [ |
Protobuf Team | 823ed18 | 2022-04-28 16:07:14 -0700 | [diff] [blame] | 762 | ":collections", |
Joshua Haberman | 543a0ce | 2020-05-26 22:30:50 -0700 | [diff] [blame] | 763 | ":descriptor_upb_proto", |
| 764 | ":descriptor_upb_proto_reflection", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 765 | ":extension_registry", |
Joshua Haberman | fa8b605 | 2022-04-19 13:15:55 -0700 | [diff] [blame] | 766 | ":fastdecode", |
Joshua Haberman | 16facab | 2020-05-08 16:40:24 -0700 | [diff] [blame] | 767 | ":json", |
Joshua Haberman | fa8b605 | 2022-04-19 13:15:55 -0700 | [diff] [blame] | 768 | ":mini_table", |
| 769 | ":port", |
| 770 | ":reflection", |
| 771 | ":upb", |
Joshua Haberman | 16facab | 2020-05-08 16:40:24 -0700 | [diff] [blame] | 772 | ], |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 773 | prefix = "php-", |
Joshua Haberman | 16facab | 2020-05-08 16:40:24 -0700 | [diff] [blame] | 774 | ) |
| 775 | |
| 776 | cc_library( |
Joshua Haberman | 543a0ce | 2020-05-26 22:30:50 -0700 | [diff] [blame] | 777 | name = "php_amalgamation", |
| 778 | srcs = ["php-upb.c"], |
| 779 | hdrs = ["php-upb.h"], |
Joshua Haberman | e86541a | 2020-10-28 17:53:09 -0700 | [diff] [blame] | 780 | copts = UPB_DEFAULT_COPTS, |
Joshua Haberman | 4307f5d | 2021-10-11 23:02:32 -0700 | [diff] [blame] | 781 | deps = ["//third_party/utf8_range"], |
Joshua Haberman | 16facab | 2020-05-08 16:40:24 -0700 | [diff] [blame] | 782 | ) |
| 783 | |
Joshua Haberman | efefbff | 2020-08-03 10:12:31 -0700 | [diff] [blame] | 784 | upb_amalgamation( |
| 785 | name = "gen_ruby_amalgamation", |
Joshua Haberman | efefbff | 2020-08-03 10:12:31 -0700 | [diff] [blame] | 786 | outs = [ |
| 787 | "ruby-upb.c", |
| 788 | "ruby-upb.h", |
| 789 | ], |
Joshua Haberman | efefbff | 2020-08-03 10:12:31 -0700 | [diff] [blame] | 790 | libs = [ |
Protobuf Team | 823ed18 | 2022-04-28 16:07:14 -0700 | [diff] [blame] | 791 | ":collections", |
Joshua Haberman | efefbff | 2020-08-03 10:12:31 -0700 | [diff] [blame] | 792 | ":descriptor_upb_proto", |
Protobuf Team Bot | e4635f2 | 2022-06-21 10:43:08 -0700 | [diff] [blame^] | 793 | ":extension_registry", |
Joshua Haberman | fa8b605 | 2022-04-19 13:15:55 -0700 | [diff] [blame] | 794 | ":fastdecode", |
Joshua Haberman | efefbff | 2020-08-03 10:12:31 -0700 | [diff] [blame] | 795 | ":json", |
Joshua Haberman | fa8b605 | 2022-04-19 13:15:55 -0700 | [diff] [blame] | 796 | ":mini_table", |
| 797 | ":port", |
| 798 | ":reflection", |
| 799 | ":upb", |
Joshua Haberman | efefbff | 2020-08-03 10:12:31 -0700 | [diff] [blame] | 800 | ], |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 801 | prefix = "ruby-", |
Joshua Haberman | efefbff | 2020-08-03 10:12:31 -0700 | [diff] [blame] | 802 | ) |
| 803 | |
| 804 | cc_library( |
| 805 | name = "ruby_amalgamation", |
| 806 | srcs = ["ruby-upb.c"], |
| 807 | hdrs = ["ruby-upb.h"], |
Joshua Haberman | e86541a | 2020-10-28 17:53:09 -0700 | [diff] [blame] | 808 | copts = UPB_DEFAULT_COPTS, |
Joshua Haberman | 4307f5d | 2021-10-11 23:02:32 -0700 | [diff] [blame] | 809 | deps = ["//third_party/utf8_range"], |
Joshua Haberman | efefbff | 2020-08-03 10:12:31 -0700 | [diff] [blame] | 810 | ) |
| 811 | |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 812 | exports_files( |
| 813 | [ |
Joshua Haberman | bfc86d3 | 2019-12-04 16:56:40 -0800 | [diff] [blame] | 814 | "third_party/lunit/console.lua", |
| 815 | "third_party/lunit/lunit.lua", |
| 816 | ], |
Joshua Haberman | 11b6df0 | 2022-02-15 19:55:44 -0800 | [diff] [blame] | 817 | visibility = ["//upb/bindings/lua:__pkg__"], |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 818 | ) |
| 819 | |
Joshua Haberman | 985145c | 2019-04-24 17:36:17 +0000 | [diff] [blame] | 820 | filegroup( |
| 821 | name = "cmake_files", |
| 822 | srcs = glob([ |
Joshua Haberman | 985145c | 2019-04-24 17:36:17 +0000 | [diff] [blame] | 823 | "upbc/**/*", |
| 824 | "upb/**/*", |
Joshua Haberman | 4f901b6 | 2020-10-14 16:32:43 -0700 | [diff] [blame] | 825 | "third_party/**/*", |
Joshua Haberman | 9a66356 | 2019-05-13 16:13:39 -0700 | [diff] [blame] | 826 | ]), |
Joshua Haberman | e3f41de | 2020-10-17 13:15:58 -0700 | [diff] [blame] | 827 | visibility = ["//cmake:__pkg__"], |
Josh Haberman | 01ed4ce | 2018-11-02 12:49:15 -0700 | [diff] [blame] | 828 | ) |
Joshua Haberman | 83c0edb | 2021-02-28 16:56:49 -0800 | [diff] [blame] | 829 | |
Protobuf Team | b8edc71 | 2022-03-16 08:24:52 -0700 | [diff] [blame] | 830 | # end:github_only |
Joshua Haberman | 4ffeaa6 | 2022-06-01 12:25:11 -0700 | [diff] [blame] | 831 | |
| 832 | # begin:google_only |
| 833 | # |
| 834 | # py_binary( |
| 835 | # name = "update_check_runs", |
| 836 | # srcs = ["update_check_runs.py"], |
| 837 | # main = "update_check_runs.py", |
| 838 | # deps = [ |
| 839 | # "//third_party/py/absl:app", |
| 840 | # ], |
| 841 | # ) |
| 842 | # |
| 843 | # end:google_only |