Index: third_party/protobuf/BUILD |
diff --git a/third_party/protobuf/BUILD b/third_party/protobuf/BUILD |
index c9f403210e9115977b4d38a3784cf614c3736c82..8b1046b90d5c9014f594943c0ed36866c4db6afe 100644 |
--- a/third_party/protobuf/BUILD |
+++ b/third_party/protobuf/BUILD |
@@ -2,8 +2,6 @@ |
licenses(["notice"]) |
-exports_files(["LICENSE"]) |
- |
################################################################################ |
# Protobuf Runtime Library |
################################################################################ |
@@ -14,7 +12,7 @@ COPTS = [ |
"-Wwrite-strings", |
"-Woverloaded-virtual", |
"-Wno-sign-compare", |
- "-Wno-unused-function", |
+ "-Wno-error=unused-function", |
] |
config_setting( |
@@ -34,7 +32,6 @@ load( |
"protobuf", |
"cc_proto_library", |
"py_proto_library", |
- "internal_copied_filegroup", |
"internal_gen_well_known_protos_java", |
"internal_protobuf_py_tests", |
) |
@@ -304,7 +301,6 @@ cc_library( |
"src/google/protobuf/compiler/javanano/javanano_message_field.cc", |
"src/google/protobuf/compiler/javanano/javanano_primitive_field.cc", |
"src/google/protobuf/compiler/js/js_generator.cc", |
- "src/google/protobuf/compiler/js/well_known_types_embed.cc", |
"src/google/protobuf/compiler/objectivec/objectivec_enum.cc", |
"src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc", |
"src/google/protobuf/compiler/objectivec/objectivec_extension.cc", |
@@ -317,7 +313,6 @@ cc_library( |
"src/google/protobuf/compiler/objectivec/objectivec_message_field.cc", |
"src/google/protobuf/compiler/objectivec/objectivec_oneof.cc", |
"src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc", |
- "src/google/protobuf/compiler/php/php_generator.cc", |
"src/google/protobuf/compiler/plugin.cc", |
"src/google/protobuf/compiler/plugin.pb.cc", |
"src/google/protobuf/compiler/python/python_generator.cc", |
@@ -392,10 +387,8 @@ RELATIVE_TEST_PROTOS = [ |
"google/protobuf/util/internal/testdata/field_mask.proto", |
"google/protobuf/util/internal/testdata/maps.proto", |
"google/protobuf/util/internal/testdata/oneofs.proto", |
- "google/protobuf/util/internal/testdata/proto3.proto", |
"google/protobuf/util/internal/testdata/struct.proto", |
"google/protobuf/util/internal/testdata/timestamp_duration.proto", |
- "google/protobuf/util/internal/testdata/wrappers.proto", |
"google/protobuf/util/json_format_proto3.proto", |
"google/protobuf/util/message_differencer_unittest.proto", |
] |
@@ -567,8 +560,6 @@ py_library( |
"python/google/protobuf/**/*.py", |
], |
exclude = [ |
- "python/google/protobuf/__init__.py", |
- "python/google/protobuf/**/__init__.py", |
"python/google/protobuf/internal/*_test.py", |
"python/google/protobuf/internal/test_util.py", |
], |
@@ -578,7 +569,7 @@ py_library( |
) |
cc_binary( |
- name = "python/google/protobuf/internal/_api_implementation.so", |
+ name = "internal/_api_implementation.so", |
srcs = ["python/google/protobuf/internal/api_implementation.cc"], |
copts = COPTS + [ |
"-DPYTHON_PROTO2_CPP_IMPL_V2", |
@@ -592,7 +583,7 @@ cc_binary( |
) |
cc_binary( |
- name = "python/google/protobuf/pyext/_message.so", |
+ name = "pyext/_message.so", |
srcs = glob([ |
"python/google/protobuf/pyext/*.cc", |
"python/google/protobuf/pyext/*.h", |
@@ -631,31 +622,15 @@ config_setting( |
}, |
) |
-# Copy the builtin proto files from src/google/protobuf to |
-# python/google/protobuf. This way, the generated Python sources will be in the |
-# same directory as the Python runtime sources. This is necessary for the |
-# modules to be imported correctly since they are all part of the same Python |
-# package. |
-internal_copied_filegroup( |
- name = "protos_python", |
- srcs = WELL_KNOWN_PROTOS, |
- strip_prefix = "src", |
- dest = "python", |
-) |
- |
-# TODO(dzc): Remove this once py_proto_library can have labels in srcs, in |
-# which case we can simply add :protos_python in srcs. |
-COPIED_WELL_KNOWN_PROTOS = ["python/" + s for s in RELATIVE_WELL_KNOWN_PROTOS] |
- |
py_proto_library( |
name = "protobuf_python", |
- srcs = COPIED_WELL_KNOWN_PROTOS, |
- include = "python", |
+ srcs = WELL_KNOWN_PROTOS, |
+ include = "src", |
data = select({ |
"//conditions:default": [], |
":use_fast_cpp_protos": [ |
- ":python/google/protobuf/internal/_api_implementation.so", |
- ":python/google/protobuf/pyext/_message.so", |
+ ":internal/_api_implementation.so", |
+ ":pyext/_message.so", |
], |
}), |
default_runtime = "", |
@@ -668,27 +643,10 @@ py_proto_library( |
visibility = ["//visibility:public"], |
) |
-# Copy the test proto files from src/google/protobuf to |
-# python/google/protobuf. This way, the generated Python sources will be in the |
-# same directory as the Python runtime sources. This is necessary for the |
-# modules to be imported correctly by the tests since they are all part of the |
-# same Python package. |
-internal_copied_filegroup( |
- name = "protos_python_test", |
- srcs = LITE_TEST_PROTOS + TEST_PROTOS, |
- strip_prefix = "src", |
- dest = "python", |
-) |
- |
-# TODO(dzc): Remove this once py_proto_library can have labels in srcs, in |
-# which case we can simply add :protos_python_test in srcs. |
-COPIED_LITE_TEST_PROTOS = ["python/" + s for s in RELATIVE_LITE_TEST_PROTOS] |
-COPIED_TEST_PROTOS = ["python/" + s for s in RELATIVE_TEST_PROTOS] |
- |
py_proto_library( |
name = "python_common_test_protos", |
- srcs = COPIED_LITE_TEST_PROTOS + COPIED_TEST_PROTOS, |
- include = "python", |
+ srcs = LITE_TEST_PROTOS + TEST_PROTOS, |
+ include = "src", |
default_runtime = "", |
protoc = ":protoc", |
srcs_version = "PY2AND3", |
@@ -714,7 +672,6 @@ py_library( |
[ |
"python/google/protobuf/internal/*_test.py", |
"python/google/protobuf/internal/test_util.py", |
- "python/google/protobuf/internal/import_test_package/__init__.py", |
], |
), |
imports = ["python"], |
@@ -750,10 +707,3 @@ internal_protobuf_py_tests( |
], |
deps = [":python_tests"], |
) |
- |
-proto_lang_toolchain( |
- name = "cc_toolchain", |
- runtime = ":protobuf", |
- command_line = "--cpp_out=$(OUT)", |
- visibility = ["//visibility:public"], |
-) |