From cce4cffd85d1ae90bb334cf8f97e88dba2571447 Mon Sep 17 00:00:00 2001 From: Matt Kulukundis Date: Sat, 19 Feb 2022 17:57:37 -0500 Subject: [PATCH 1/2] more licenses --- python/BUILD | 23 ++++++++++++++--------- upb/util/BUILD | 29 +++++++++++++++-------------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/python/BUILD b/python/BUILD index 158b79e010..a146fb14b1 100644 --- a/python/BUILD +++ b/python/BUILD @@ -36,6 +36,8 @@ load( "py_wheel", ) +license(["notice"]) + cc_binary( name = "message", srcs = [ @@ -68,16 +70,19 @@ cc_binary( # the module. linkopts = select({ "@platforms//os:linux": ["-Wl,--version-script,$(location :version_script.lds)"], - "@platforms//os:macos": ["-Wl,-exported_symbol", "-Wl,_PyInit__message"], + "@platforms//os:macos": [ + "-Wl,-exported_symbol", + "-Wl,_PyInit__message", + ], }), linkshared = True, linkstatic = True, deps = [ ":version_script.lds", + "//:descriptor_upb_proto_reflection", "//:reflection", "//:textformat", "//:upb", - "//:descriptor_upb_proto_reflection", "//upb/util:compare", "//upb/util:def_to_proto", "//upb/util:required_fields", @@ -90,11 +95,11 @@ cc_binary( srcs = [ "api_implementation.c", ], + linkshared = True, + linkstatic = True, # Enable once linker script is available. #copts = ["-fvisibility=hidden"], deps = ["@system_python//:python_headers"], - linkshared = True, - linkstatic = True, ) # Copy the extensions into the location recognized by Python. @@ -136,14 +141,14 @@ py_test( srcs = [ "minimal_test.py", ], + imports = ["."], + legacy_create_init = False, deps = [ "//python:message_ext", - "@com_google_protobuf//:python_srcs", "@com_google_protobuf//:python_common_test_protos", "@com_google_protobuf//:python_specific_test_protos", + "@com_google_protobuf//:python_srcs", ], - imports = ["."], - legacy_create_init = False, ) py_proto_library( @@ -168,13 +173,13 @@ py_wheel( name = "binary_wheel", abi = "abi3", distribution = "protobuf", - python_tag = "cp36", # TODO(https://github.com/protocolbuffers/upb/issues/502): we need to make # this a select() that is calculated from the platform we are actually # building on. platform = "manylinux2014_x86_64", - version = "4.20.0", + python_tag = "cp36", strip_path_prefixes = ["python/"], + version = "4.20.0", deps = [ ":extension_files", ":well_known_proto_pb2", diff --git a/upb/util/BUILD b/upb/util/BUILD index 07649dedcb..65b64b2350 100644 --- a/upb/util/BUILD +++ b/upb/util/BUILD @@ -1,26 +1,27 @@ - load( "//bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library", ) +license(["notice"]) + # Def to Proto cc_library( name = "def_to_proto", srcs = ["def_to_proto.c"], hdrs = ["def_to_proto.h"], - deps = ["//:reflection"], visibility = ["//visibility:public"], + deps = ["//:reflection"], ) proto_library( name = "def_to_proto_test_proto", srcs = [ - "def_to_proto_test.proto", - "def_to_proto_regular_import_test.proto", "def_to_proto_public_import_test.proto", + "def_to_proto_regular_import_test.proto", + "def_to_proto_test.proto", "def_to_proto_weak_import_test.proto", ], ) @@ -39,13 +40,13 @@ cc_test( name = "def_to_proto_test", srcs = ["def_to_proto_test.cc"], deps = [ - "@com_google_absl//absl/strings", - "@com_google_googletest//:gtest_main", - "//:descriptor_upb_proto_reflection", - "@com_google_protobuf//:protobuf", ":def_to_proto", ":def_to_proto_test_upb_proto", ":def_to_proto_test_upb_proto_reflection", + "//:descriptor_upb_proto_reflection", + "@com_google_absl//absl/strings", + "@com_google_googletest//:gtest_main", + "@com_google_protobuf//:protobuf", ], ) @@ -55,8 +56,8 @@ cc_library( name = "required_fields", srcs = ["required_fields.c"], hdrs = ["required_fields.h"], - deps = ["//:reflection"], visibility = ["//visibility:public"], + deps = ["//:reflection"], ) proto_library( @@ -78,12 +79,12 @@ cc_test( name = "required_fields_test", srcs = ["required_fields_test.cc"], deps = [ - "@com_google_absl//absl/strings", - "@com_google_googletest//:gtest_main", - "//:json", ":required_fields", ":required_fields_test_upb_proto", ":required_fields_test_upb_proto_reflection", + "//:json", + "@com_google_absl//absl/strings", + "@com_google_googletest//:gtest_main", ], ) @@ -93,16 +94,16 @@ cc_library( name = "compare", srcs = ["compare.c"], hdrs = ["compare.h"], - deps = ["//:reflection"], visibility = ["//visibility:public"], + deps = ["//:reflection"], ) cc_test( name = "compare_test", srcs = ["compare_test.cc"], deps = [ + ":compare", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", - ":compare", ], ) From bf043418053d80bf8573f7c8d57b9af4ab6f6d51 Mon Sep 17 00:00:00 2001 From: Matt Kulukundis Date: Sat, 19 Feb 2022 18:07:33 -0500 Subject: [PATCH 2/2] more licenses --- python/BUILD | 2 +- upb/util/BUILD | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/BUILD b/python/BUILD index a146fb14b1..8126f52200 100644 --- a/python/BUILD +++ b/python/BUILD @@ -36,7 +36,7 @@ load( "py_wheel", ) -license(["notice"]) +licenses(["notice"]) cc_binary( name = "message", diff --git a/upb/util/BUILD b/upb/util/BUILD index 65b64b2350..d81cb43cb8 100644 --- a/upb/util/BUILD +++ b/upb/util/BUILD @@ -4,7 +4,7 @@ load( "upb_proto_reflection_library", ) -license(["notice"]) +licenses(["notice"]) # Def to Proto