From fc4941183f54a3b9fbdd995ebbfb5ab0949cf7ef Mon Sep 17 00:00:00 2001 From: Anna R Date: Thu, 9 Jan 2020 14:16:25 -0800 Subject: [PATCH 1/4] Add :port dependencies to libraries that include it --- BUILD | 9 +++++++++ CMakeLists.txt | 5 +++++ bazel/upb_proto_library.bzl | 4 +++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/BUILD b/BUILD index 16109ac911..aa89267cf3 100644 --- a/BUILD +++ b/BUILD @@ -136,6 +136,7 @@ cc_library( visibility = ["//visibility:public"], deps = [ ":descriptor_upbproto", + ":port", ":table", ":upb", ], @@ -189,6 +190,7 @@ cc_library( }), deps = [ ":reflection", + ":port", ":table", ":upb", ], @@ -218,6 +220,7 @@ cc_library( ":descriptor_upbproto", ":handlers", ":reflection", + ":port", ":table", ":upb", ], @@ -253,6 +256,7 @@ cc_library( deps = [ ":descriptor_upbproto", ":handlers", + ":port", ":upb", ], ) @@ -331,6 +335,7 @@ cc_library( }), deps = [ ":handlers", + ":port", ":upb", ], ) @@ -346,6 +351,7 @@ cc_test( "//conditions:default": COPTS }), deps = [ + ":port", ":upb", ":upb_pb", ":upb_test", @@ -376,6 +382,7 @@ cc_test( }), deps = [ ":handlers", + ":port", ":test_decoder_upbproto", ":upb", ":upb_pb", @@ -404,6 +411,7 @@ cc_test( }), deps = [ ":handlers", + ":port", ":reflection", ":test_cpp_upbproto", ":upb", @@ -420,6 +428,7 @@ cc_test( "//conditions:default": CPPOPTS }), deps = [ + ":port", ":table", ":upb", ":upb_test", diff --git a/CMakeLists.txt b/CMakeLists.txt index 7bf3b75151..9818894fc7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,6 +87,7 @@ add_library(reflection upb/msgfactory.h) target_link_libraries(reflection descriptor_upbproto + port table upb) add_library(table INTERFACE) @@ -109,6 +110,7 @@ add_library(handlers upb/sink.h) target_link_libraries(handlers reflection + port table upb) add_library(upb_pb @@ -126,6 +128,7 @@ target_link_libraries(upb_pb descriptor_upbproto handlers reflection + port table upb) add_library(upb_json @@ -140,6 +143,7 @@ add_library(upb_cc_bindings INTERFACE) target_link_libraries(upb_cc_bindings INTERFACE descriptor_upbproto handlers + port upb) add_library(upb_test tests/testmain.cc @@ -147,6 +151,7 @@ add_library(upb_test tests/upb_test.h) target_link_libraries(upb_test handlers + port upb) diff --git a/bazel/upb_proto_library.bzl b/bazel/upb_proto_library.bzl index 21ed34b487..3cb11c81b9 100644 --- a/bazel/upb_proto_library.bzl +++ b/bazel/upb_proto_library.bzl @@ -238,7 +238,8 @@ _upb_proto_library_aspect = aspect( ), "_upb": attr.label_list(default = [ "//:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", - "//:upb" + "//:port", + "//:upb", ]), "_ext": attr.string(default = ".upb"), }), @@ -279,6 +280,7 @@ _upb_proto_reflection_library_aspect = aspect( ), "_upb": attr.label_list( default = [ + "//:port", "//:upb", "//:reflection", ], From 578dc32208ec3a914b0cbe7e46eb2d71a43b3baa Mon Sep 17 00:00:00 2001 From: Anna R Date: Thu, 9 Jan 2020 14:19:39 -0800 Subject: [PATCH 2/4] Set port visibility to public. --- BUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/BUILD b/BUILD index aa89267cf3..1b7f2a77a1 100644 --- a/BUILD +++ b/BUILD @@ -63,6 +63,7 @@ cc_library( srcs = [ "upb/port.c", ], + visibility = ["//visibility:public"], ) cc_library( From 3797ad2217740d82e9fb967f5f255f40cc16c351 Mon Sep 17 00:00:00 2001 From: Anna R Date: Thu, 9 Jan 2020 14:46:18 -0800 Subject: [PATCH 3/4] port should not be public --- BUILD | 2 -- CMakeLists.txt | 1 - bazel/upb_proto_library.bzl | 3 +-- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/BUILD b/BUILD index 1b7f2a77a1..c6e4907b55 100644 --- a/BUILD +++ b/BUILD @@ -63,7 +63,6 @@ cc_library( srcs = [ "upb/port.c", ], - visibility = ["//visibility:public"], ) cc_library( @@ -109,7 +108,6 @@ cc_library( }), visibility = ["//visibility:public"], deps = [ - ":port", ":upb", ], ) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9818894fc7..96b265dd3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,7 +78,6 @@ target_link_libraries(upb port) add_library(generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE) target_link_libraries(generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE - port upb) add_library(reflection upb/def.c diff --git a/bazel/upb_proto_library.bzl b/bazel/upb_proto_library.bzl index 3cb11c81b9..83610f467c 100644 --- a/bazel/upb_proto_library.bzl +++ b/bazel/upb_proto_library.bzl @@ -238,7 +238,6 @@ _upb_proto_library_aspect = aspect( ), "_upb": attr.label_list(default = [ "//:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", - "//:port", "//:upb", ]), "_ext": attr.string(default = ".upb"), @@ -280,7 +279,7 @@ _upb_proto_reflection_library_aspect = aspect( ), "_upb": attr.label_list( default = [ - "//:port", + "//third_party/upb:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", "//:upb", "//:reflection", ], From a27429f2652763ef957b50f30eb5a34ddfc38e88 Mon Sep 17 00:00:00 2001 From: Anna R Date: Thu, 9 Jan 2020 14:50:03 -0800 Subject: [PATCH 4/4] Add port_def.inc and port_undef.inc to generated code hdrs --- BUILD | 2 ++ bazel/upb_proto_library.bzl | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/BUILD b/BUILD index c6e4907b55..0166b14c98 100644 --- a/BUILD +++ b/BUILD @@ -101,6 +101,8 @@ cc_library( hdrs = [ "upb/generated_util.h", "upb/msg.h", + "upb/port_def.inc", + "upb/port_undef.inc", ], copts = select({ ":windows": [], diff --git a/bazel/upb_proto_library.bzl b/bazel/upb_proto_library.bzl index 83610f467c..bea611776c 100644 --- a/bazel/upb_proto_library.bzl +++ b/bazel/upb_proto_library.bzl @@ -279,7 +279,7 @@ _upb_proto_reflection_library_aspect = aspect( ), "_upb": attr.label_list( default = [ - "//third_party/upb:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", + "//:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", "//:upb", "//:reflection", ],