diff options
Diffstat (limited to 'third_party/protobuf')
-rw-r--r-- | third_party/protobuf/3.0.0/BUILD | 312 | ||||
-rw-r--r-- | third_party/protobuf/BUILD | 288 | ||||
-rw-r--r-- | third_party/protobuf/README.md | 52 | ||||
-rw-r--r-- | third_party/protobuf/proto_alias.bzl | 18 |
4 files changed, 299 insertions, 371 deletions
diff --git a/third_party/protobuf/3.0.0/BUILD b/third_party/protobuf/3.0.0/BUILD deleted file mode 100644 index f5c37596d8..0000000000 --- a/third_party/protobuf/3.0.0/BUILD +++ /dev/null @@ -1,312 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -licenses(["notice"]) - -load("//third_party/protobuf:protobuf.bzl", "py_proto_library") - -filegroup( - name = "srcs", - srcs = glob( - [ - "**", - "protobuf.bzl", - "python/google/protobuf/**/*.py", - "src/google/protobuf/**/*.proto", - ], - ), - visibility = ["//third_party/protobuf:__pkg__"], -) - -filegroup( - name = "protoc", - srcs = select({ - # protoc-windows-x86_64.exe can't deal with long path(length > 260), - # so use protoc-mingw.exe instead. - "//third_party:windows_mingw": ["protoc-3.0.0-mingw.exe"], - "//third_party:windows_msys64_mingw64": ["protoc-3.0.0-mingw.exe"], - "//third_party:windows_msys64": ["protoc-3.0.0-mingw.exe"], - "//third_party:windows_clang": ["protoc-3.0.0-mingw.exe"], - "//third_party:darwin": ["protoc-3.0.0-osx-x86_32.exe"], - "//third_party:k8": ["protoc-3.0.0-linux-x86_64.exe"], - "//third_party:piii": ["protoc-3.0.0-linux-x86_32.exe"], - "//third_party:freebsd": ["protoc-3.0.0-linux-x86_32.exe"], - }), -) - -java_import( - name = "protobuf", - jars = ["protobuf-java-3.0.0.jar"], -) - -# For bootstrapping JavaBuilder -filegroup( - name = "protobuf-jars", - srcs = ["protobuf-java-3.0.0.jar"], -) - -################################################################################ -# The following rules are based on the build rules in protobuf's BUILD files. -################################################################################ - -py_library( - name = "python_srcs", - srcs = glob( - [ - "python/google/protobuf/*.py", - "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", - ], - ), - imports = ["python"], - srcs_version = "PY2AND3", -) - -py_proto_library( - name = "protobuf_python", - srcs = [ - "src/google/protobuf/any.proto", - "src/google/protobuf/api.proto", - "src/google/protobuf/compiler/plugin.proto", - "src/google/protobuf/descriptor.proto", - "src/google/protobuf/duration.proto", - "src/google/protobuf/empty.proto", - "src/google/protobuf/field_mask.proto", - "src/google/protobuf/source_context.proto", - "src/google/protobuf/struct.proto", - "src/google/protobuf/timestamp.proto", - "src/google/protobuf/type.proto", - "src/google/protobuf/wrappers.proto", - ], - include = "src", - default_runtime = "", - protoc = ":protoc", - py_libs = [ - ":protobuf_python_srcs", - "//third_party/py/six", - ], - srcs_version = "PY2AND3", -) - -COPTS = [ - "-DHAVE_PTHREAD", - "-Wall", - "-Wwrite-strings", - "-Woverloaded-virtual", - "-Wno-sign-compare", - "-Wno-error=unused-function", - "-Wno-error=unused-variable", -] - -LINK_OPTS = ["-lpthread"] - -cc_library( - name = "protobuf_lite", - srcs = [ - # AUTOGEN(protobuf_lite_srcs) - "src/google/protobuf/arena.cc", - "src/google/protobuf/arenastring.cc", - "src/google/protobuf/extension_set.cc", - "src/google/protobuf/generated_message_util.cc", - "src/google/protobuf/io/coded_stream.cc", - "src/google/protobuf/io/zero_copy_stream.cc", - "src/google/protobuf/io/zero_copy_stream_impl_lite.cc", - "src/google/protobuf/message_lite.cc", - "src/google/protobuf/repeated_field.cc", - "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc", - "src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc", - "src/google/protobuf/stubs/bytestream.cc", - "src/google/protobuf/stubs/common.cc", - "src/google/protobuf/stubs/int128.cc", - "src/google/protobuf/stubs/once.cc", - "src/google/protobuf/stubs/status.cc", - "src/google/protobuf/stubs/statusor.cc", - "src/google/protobuf/stubs/stringpiece.cc", - "src/google/protobuf/stubs/stringprintf.cc", - "src/google/protobuf/stubs/structurally_valid.cc", - "src/google/protobuf/stubs/strutil.cc", - "src/google/protobuf/stubs/time.cc", - "src/google/protobuf/wire_format_lite.cc", - ], - hdrs = glob(["src/google/protobuf/**/*.h"]), - copts = COPTS, - includes = ["src/"], - linkopts = LINK_OPTS, - visibility = ["//visibility:public"], -) - -# This is named just "protobuf" in protobuf's BUILD file, but it is renamed here -# to "protobuf_clib" to avoid conflicting with the java_import named "protobuf" -# above. -cc_library( - name = "protobuf_clib", - srcs = [ - # AUTOGEN(protobuf_srcs) - "src/google/protobuf/any.cc", - "src/google/protobuf/any.pb.cc", - "src/google/protobuf/api.pb.cc", - "src/google/protobuf/compiler/importer.cc", - "src/google/protobuf/compiler/parser.cc", - "src/google/protobuf/descriptor.cc", - "src/google/protobuf/descriptor.pb.cc", - "src/google/protobuf/descriptor_database.cc", - "src/google/protobuf/duration.pb.cc", - "src/google/protobuf/dynamic_message.cc", - "src/google/protobuf/empty.pb.cc", - "src/google/protobuf/extension_set_heavy.cc", - "src/google/protobuf/field_mask.pb.cc", - "src/google/protobuf/generated_message_reflection.cc", - "src/google/protobuf/io/gzip_stream.cc", - "src/google/protobuf/io/printer.cc", - "src/google/protobuf/io/strtod.cc", - "src/google/protobuf/io/tokenizer.cc", - "src/google/protobuf/io/zero_copy_stream_impl.cc", - "src/google/protobuf/map_field.cc", - "src/google/protobuf/message.cc", - "src/google/protobuf/reflection_ops.cc", - "src/google/protobuf/service.cc", - "src/google/protobuf/source_context.pb.cc", - "src/google/protobuf/struct.pb.cc", - "src/google/protobuf/stubs/mathlimits.cc", - "src/google/protobuf/stubs/substitute.cc", - "src/google/protobuf/text_format.cc", - "src/google/protobuf/timestamp.pb.cc", - "src/google/protobuf/type.pb.cc", - "src/google/protobuf/unknown_field_set.cc", - "src/google/protobuf/util/field_comparator.cc", - "src/google/protobuf/util/field_mask_util.cc", - "src/google/protobuf/util/internal/datapiece.cc", - "src/google/protobuf/util/internal/default_value_objectwriter.cc", - "src/google/protobuf/util/internal/error_listener.cc", - "src/google/protobuf/util/internal/field_mask_utility.cc", - "src/google/protobuf/util/internal/json_escaping.cc", - "src/google/protobuf/util/internal/json_objectwriter.cc", - "src/google/protobuf/util/internal/json_stream_parser.cc", - "src/google/protobuf/util/internal/object_writer.cc", - "src/google/protobuf/util/internal/proto_writer.cc", - "src/google/protobuf/util/internal/protostream_objectsource.cc", - "src/google/protobuf/util/internal/protostream_objectwriter.cc", - "src/google/protobuf/util/internal/type_info.cc", - "src/google/protobuf/util/internal/type_info_test_helper.cc", - "src/google/protobuf/util/internal/utility.cc", - "src/google/protobuf/util/json_util.cc", - "src/google/protobuf/util/message_differencer.cc", - "src/google/protobuf/util/time_util.cc", - "src/google/protobuf/util/type_resolver_util.cc", - "src/google/protobuf/wire_format.cc", - "src/google/protobuf/wrappers.pb.cc", - ], - hdrs = glob(["src/**/*.h"]), - copts = COPTS, - includes = ["src/"], - linkopts = LINK_OPTS, - visibility = ["//visibility:public"], - deps = [":protobuf_lite"], -) - -cc_library( - name = "protoc_lib", - srcs = [ - # AUTOGEN(protoc_lib_srcs) - "src/google/protobuf/compiler/code_generator.cc", - "src/google/protobuf/compiler/command_line_interface.cc", - "src/google/protobuf/compiler/cpp/cpp_enum.cc", - "src/google/protobuf/compiler/cpp/cpp_enum_field.cc", - "src/google/protobuf/compiler/cpp/cpp_extension.cc", - "src/google/protobuf/compiler/cpp/cpp_field.cc", - "src/google/protobuf/compiler/cpp/cpp_file.cc", - "src/google/protobuf/compiler/cpp/cpp_generator.cc", - "src/google/protobuf/compiler/cpp/cpp_helpers.cc", - "src/google/protobuf/compiler/cpp/cpp_map_field.cc", - "src/google/protobuf/compiler/cpp/cpp_message.cc", - "src/google/protobuf/compiler/cpp/cpp_message_field.cc", - "src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", - "src/google/protobuf/compiler/cpp/cpp_service.cc", - "src/google/protobuf/compiler/cpp/cpp_string_field.cc", - "src/google/protobuf/compiler/csharp/csharp_doc_comment.cc", - "src/google/protobuf/compiler/csharp/csharp_enum.cc", - "src/google/protobuf/compiler/csharp/csharp_enum_field.cc", - "src/google/protobuf/compiler/csharp/csharp_field_base.cc", - "src/google/protobuf/compiler/csharp/csharp_generator.cc", - "src/google/protobuf/compiler/csharp/csharp_helpers.cc", - "src/google/protobuf/compiler/csharp/csharp_map_field.cc", - "src/google/protobuf/compiler/csharp/csharp_message.cc", - "src/google/protobuf/compiler/csharp/csharp_message_field.cc", - "src/google/protobuf/compiler/csharp/csharp_primitive_field.cc", - "src/google/protobuf/compiler/csharp/csharp_reflection_class.cc", - "src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc", - "src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc", - "src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc", - "src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc", - "src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc", - "src/google/protobuf/compiler/java/java_context.cc", - "src/google/protobuf/compiler/java/java_doc_comment.cc", - "src/google/protobuf/compiler/java/java_enum.cc", - "src/google/protobuf/compiler/java/java_enum_field.cc", - "src/google/protobuf/compiler/java/java_enum_field_lite.cc", - "src/google/protobuf/compiler/java/java_enum_lite.cc", - "src/google/protobuf/compiler/java/java_extension.cc", - "src/google/protobuf/compiler/java/java_extension_lite.cc", - "src/google/protobuf/compiler/java/java_field.cc", - "src/google/protobuf/compiler/java/java_file.cc", - "src/google/protobuf/compiler/java/java_generator.cc", - "src/google/protobuf/compiler/java/java_generator_factory.cc", - "src/google/protobuf/compiler/java/java_helpers.cc", - "src/google/protobuf/compiler/java/java_lazy_message_field.cc", - "src/google/protobuf/compiler/java/java_lazy_message_field_lite.cc", - "src/google/protobuf/compiler/java/java_map_field.cc", - "src/google/protobuf/compiler/java/java_map_field_lite.cc", - "src/google/protobuf/compiler/java/java_message.cc", - "src/google/protobuf/compiler/java/java_message_builder.cc", - "src/google/protobuf/compiler/java/java_message_builder_lite.cc", - "src/google/protobuf/compiler/java/java_message_field.cc", - "src/google/protobuf/compiler/java/java_message_field_lite.cc", - "src/google/protobuf/compiler/java/java_message_lite.cc", - "src/google/protobuf/compiler/java/java_name_resolver.cc", - "src/google/protobuf/compiler/java/java_primitive_field.cc", - "src/google/protobuf/compiler/java/java_primitive_field_lite.cc", - "src/google/protobuf/compiler/java/java_service.cc", - "src/google/protobuf/compiler/java/java_shared_code_generator.cc", - "src/google/protobuf/compiler/java/java_string_field.cc", - "src/google/protobuf/compiler/java/java_string_field_lite.cc", - "src/google/protobuf/compiler/javanano/javanano_enum.cc", - "src/google/protobuf/compiler/javanano/javanano_enum_field.cc", - "src/google/protobuf/compiler/javanano/javanano_extension.cc", - "src/google/protobuf/compiler/javanano/javanano_field.cc", - "src/google/protobuf/compiler/javanano/javanano_file.cc", - "src/google/protobuf/compiler/javanano/javanano_generator.cc", - "src/google/protobuf/compiler/javanano/javanano_helpers.cc", - "src/google/protobuf/compiler/javanano/javanano_map_field.cc", - "src/google/protobuf/compiler/javanano/javanano_message.cc", - "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/objectivec/objectivec_enum.cc", - "src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc", - "src/google/protobuf/compiler/objectivec/objectivec_extension.cc", - "src/google/protobuf/compiler/objectivec/objectivec_field.cc", - "src/google/protobuf/compiler/objectivec/objectivec_file.cc", - "src/google/protobuf/compiler/objectivec/objectivec_generator.cc", - "src/google/protobuf/compiler/objectivec/objectivec_helpers.cc", - "src/google/protobuf/compiler/objectivec/objectivec_map_field.cc", - "src/google/protobuf/compiler/objectivec/objectivec_message.cc", - "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/plugin.cc", - "src/google/protobuf/compiler/plugin.pb.cc", - "src/google/protobuf/compiler/python/python_generator.cc", - "src/google/protobuf/compiler/ruby/ruby_generator.cc", - "src/google/protobuf/compiler/subprocess.cc", - "src/google/protobuf/compiler/zip_writer.cc", - ], - copts = COPTS, - includes = ["src/"], - linkopts = LINK_OPTS, - visibility = ["//visibility:public"], - deps = [":protobuf_clib"], -) diff --git a/third_party/protobuf/BUILD b/third_party/protobuf/BUILD index 0f39107b93..203fe51ec2 100644 --- a/third_party/protobuf/BUILD +++ b/third_party/protobuf/BUILD @@ -2,30 +2,290 @@ package(default_visibility = ["//visibility:public"]) licenses(["notice"]) -load(":proto_alias.bzl", "proto_alias") - -PROTOBUF_VERSION = "3.0.0" +load("//third_party/protobuf:protobuf.bzl", "py_proto_library") filegroup( name = "srcs", - srcs = [ - "//third_party/protobuf/" + PROTOBUF_VERSION + ":srcs", - ] + glob(["**"]), # glob everything to satisfy the compile.sh srcs test + srcs = glob( + [ + "**", + "protobuf.bzl", + "python/google/protobuf/**/*.py", + "src/google/protobuf/**/*.proto", + ], + ), visibility = ["//third_party:__pkg__"], ) -proto_alias("protoc", PROTOBUF_VERSION) +filegroup( + name = "protoc", + srcs = select({ + # protoc-windows-x86_64.exe can't deal with long path(length > 260), change to protoc-mingw.exe. + "//third_party:windows_mingw": ["protoc-mingw.exe"], + "//third_party:windows_msys64_mingw64": ["protoc-mingw.exe"], + "//third_party:windows_msys64": ["protoc-mingw.exe"], + "//third_party:windows_clang": ["protoc-mingw.exe"], + "//third_party:darwin": ["protoc-osx-x86_32.exe"], + "//third_party:k8": ["protoc-linux-x86_64.exe"], + "//third_party:piii": ["protoc-linux-x86_32.exe"], + "//third_party:freebsd": ["protoc-linux-x86_32.exe"], + }), +) + +java_import( + name = "protobuf", + jars = ["protobuf-java-3.0.0-beta-4.jar"], +) + +# For bootstrapping JavaBuilder +filegroup( + name = "protobuf-jars", + srcs = ["protobuf-java-3.0.0-beta-4.jar"], +) -proto_alias("protobuf", PROTOBUF_VERSION) +py_library( + name = "protobuf_python_srcs", + srcs = glob( + [ + "python/google/protobuf/*.py", + "python/google/protobuf/**/*.py", + ], + ), + imports = ["python"], +) -proto_alias("protobuf-jars", PROTOBUF_VERSION) +py_proto_library( + name = "protobuf_python", + srcs = [ + "src/google/protobuf/any.proto", + "src/google/protobuf/api.proto", + "src/google/protobuf/compiler/plugin.proto", + "src/google/protobuf/descriptor.proto", + "src/google/protobuf/duration.proto", + "src/google/protobuf/empty.proto", + "src/google/protobuf/field_mask.proto", + "src/google/protobuf/source_context.proto", + "src/google/protobuf/struct.proto", + "src/google/protobuf/timestamp.proto", + "src/google/protobuf/type.proto", + "src/google/protobuf/wrappers.proto", + ], + include = "src", + default_runtime = "", + protoc = ":protoc", + py_libs = [ + ":protobuf_python_srcs", + "//third_party/py/six", + ], + srcs_version = "PY2AND3", +) -proto_alias("protobuf_python_srcs", PROTOBUF_VERSION) +COPTS = [ + "-DHAVE_PTHREAD", + "-w", +] -proto_alias("protobuf_python", PROTOBUF_VERSION) +LINK_OPTS = ["-lpthread"] -proto_alias("protobuf_lite", PROTOBUF_VERSION) +cc_library( + name = "protobuf_lite", + srcs = [ + # AUTOGEN(protobuf_lite_srcs) + "src/google/protobuf/arena.cc", + "src/google/protobuf/arenastring.cc", + "src/google/protobuf/extension_set.cc", + "src/google/protobuf/generated_message_util.cc", + "src/google/protobuf/io/coded_stream.cc", + "src/google/protobuf/io/zero_copy_stream.cc", + "src/google/protobuf/io/zero_copy_stream_impl_lite.cc", + "src/google/protobuf/message_lite.cc", + "src/google/protobuf/repeated_field.cc", + "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc", + "src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc", + "src/google/protobuf/stubs/bytestream.cc", + "src/google/protobuf/stubs/common.cc", + "src/google/protobuf/stubs/int128.cc", + "src/google/protobuf/stubs/once.cc", + "src/google/protobuf/stubs/status.cc", + "src/google/protobuf/stubs/statusor.cc", + "src/google/protobuf/stubs/stringpiece.cc", + "src/google/protobuf/stubs/stringprintf.cc", + "src/google/protobuf/stubs/structurally_valid.cc", + "src/google/protobuf/stubs/strutil.cc", + "src/google/protobuf/stubs/time.cc", + "src/google/protobuf/wire_format_lite.cc", + ], + hdrs = glob(["src/google/protobuf/**/*.h"]), + copts = COPTS, + includes = ["src/"], + linkopts = LINK_OPTS, + visibility = ["//visibility:public"], +) -proto_alias("protobuf_clib", PROTOBUF_VERSION) +cc_library( + name = "protobuf_clib", + srcs = [ + # AUTOGEN(protobuf_srcs) + "src/google/protobuf/any.cc", + "src/google/protobuf/any.pb.cc", + "src/google/protobuf/api.pb.cc", + "src/google/protobuf/compiler/importer.cc", + "src/google/protobuf/compiler/parser.cc", + "src/google/protobuf/descriptor.cc", + "src/google/protobuf/descriptor.pb.cc", + "src/google/protobuf/descriptor_database.cc", + "src/google/protobuf/duration.pb.cc", + "src/google/protobuf/dynamic_message.cc", + "src/google/protobuf/empty.pb.cc", + "src/google/protobuf/extension_set_heavy.cc", + "src/google/protobuf/field_mask.pb.cc", + "src/google/protobuf/generated_message_reflection.cc", + "src/google/protobuf/io/gzip_stream.cc", + "src/google/protobuf/io/printer.cc", + "src/google/protobuf/io/strtod.cc", + "src/google/protobuf/io/tokenizer.cc", + "src/google/protobuf/io/zero_copy_stream_impl.cc", + "src/google/protobuf/map_field.cc", + "src/google/protobuf/message.cc", + "src/google/protobuf/reflection_ops.cc", + "src/google/protobuf/service.cc", + "src/google/protobuf/source_context.pb.cc", + "src/google/protobuf/struct.pb.cc", + "src/google/protobuf/stubs/mathlimits.cc", + "src/google/protobuf/stubs/substitute.cc", + "src/google/protobuf/text_format.cc", + "src/google/protobuf/timestamp.pb.cc", + "src/google/protobuf/type.pb.cc", + "src/google/protobuf/unknown_field_set.cc", + "src/google/protobuf/util/field_comparator.cc", + "src/google/protobuf/util/field_mask_util.cc", + "src/google/protobuf/util/internal/datapiece.cc", + "src/google/protobuf/util/internal/default_value_objectwriter.cc", + "src/google/protobuf/util/internal/error_listener.cc", + "src/google/protobuf/util/internal/field_mask_utility.cc", + "src/google/protobuf/util/internal/json_escaping.cc", + "src/google/protobuf/util/internal/json_objectwriter.cc", + "src/google/protobuf/util/internal/json_stream_parser.cc", + "src/google/protobuf/util/internal/object_writer.cc", + "src/google/protobuf/util/internal/proto_writer.cc", + "src/google/protobuf/util/internal/protostream_objectsource.cc", + "src/google/protobuf/util/internal/protostream_objectwriter.cc", + "src/google/protobuf/util/internal/type_info.cc", + "src/google/protobuf/util/internal/type_info_test_helper.cc", + "src/google/protobuf/util/internal/utility.cc", + "src/google/protobuf/util/json_util.cc", + "src/google/protobuf/util/message_differencer.cc", + "src/google/protobuf/util/time_util.cc", + "src/google/protobuf/util/type_resolver_util.cc", + "src/google/protobuf/wire_format.cc", + "src/google/protobuf/wrappers.pb.cc", + ], + hdrs = glob(["src/**/*.h"]), + copts = COPTS, + includes = ["src/"], + linkopts = LINK_OPTS, + visibility = ["//visibility:public"], + deps = [":protobuf_lite"], +) -proto_alias("protoc_lib", PROTOBUF_VERSION) +cc_library( + name = "protoc_lib", + srcs = [ + # AUTOGEN(protoc_lib_srcs) + "src/google/protobuf/compiler/code_generator.cc", + "src/google/protobuf/compiler/command_line_interface.cc", + "src/google/protobuf/compiler/cpp/cpp_enum.cc", + "src/google/protobuf/compiler/cpp/cpp_enum_field.cc", + "src/google/protobuf/compiler/cpp/cpp_extension.cc", + "src/google/protobuf/compiler/cpp/cpp_field.cc", + "src/google/protobuf/compiler/cpp/cpp_file.cc", + "src/google/protobuf/compiler/cpp/cpp_generator.cc", + "src/google/protobuf/compiler/cpp/cpp_helpers.cc", + "src/google/protobuf/compiler/cpp/cpp_map_field.cc", + "src/google/protobuf/compiler/cpp/cpp_message.cc", + "src/google/protobuf/compiler/cpp/cpp_message_field.cc", + "src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", + "src/google/protobuf/compiler/cpp/cpp_service.cc", + "src/google/protobuf/compiler/cpp/cpp_string_field.cc", + "src/google/protobuf/compiler/csharp/csharp_doc_comment.cc", + "src/google/protobuf/compiler/csharp/csharp_enum.cc", + "src/google/protobuf/compiler/csharp/csharp_enum_field.cc", + "src/google/protobuf/compiler/csharp/csharp_field_base.cc", + "src/google/protobuf/compiler/csharp/csharp_generator.cc", + "src/google/protobuf/compiler/csharp/csharp_helpers.cc", + "src/google/protobuf/compiler/csharp/csharp_map_field.cc", + "src/google/protobuf/compiler/csharp/csharp_message.cc", + "src/google/protobuf/compiler/csharp/csharp_message_field.cc", + "src/google/protobuf/compiler/csharp/csharp_primitive_field.cc", + "src/google/protobuf/compiler/csharp/csharp_reflection_class.cc", + "src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc", + "src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc", + "src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc", + "src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc", + "src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc", + "src/google/protobuf/compiler/java/java_context.cc", + "src/google/protobuf/compiler/java/java_doc_comment.cc", + "src/google/protobuf/compiler/java/java_enum.cc", + "src/google/protobuf/compiler/java/java_enum_field.cc", + "src/google/protobuf/compiler/java/java_enum_field_lite.cc", + "src/google/protobuf/compiler/java/java_enum_lite.cc", + "src/google/protobuf/compiler/java/java_extension.cc", + "src/google/protobuf/compiler/java/java_field.cc", + "src/google/protobuf/compiler/java/java_file.cc", + "src/google/protobuf/compiler/java/java_generator.cc", + "src/google/protobuf/compiler/java/java_generator_factory.cc", + "src/google/protobuf/compiler/java/java_helpers.cc", + "src/google/protobuf/compiler/java/java_lazy_message_field.cc", + "src/google/protobuf/compiler/java/java_lazy_message_field_lite.cc", + "src/google/protobuf/compiler/java/java_map_field.cc", + "src/google/protobuf/compiler/java/java_map_field_lite.cc", + "src/google/protobuf/compiler/java/java_message.cc", + "src/google/protobuf/compiler/java/java_message_builder.cc", + "src/google/protobuf/compiler/java/java_message_builder_lite.cc", + "src/google/protobuf/compiler/java/java_message_field.cc", + "src/google/protobuf/compiler/java/java_message_field_lite.cc", + "src/google/protobuf/compiler/java/java_message_lite.cc", + "src/google/protobuf/compiler/java/java_name_resolver.cc", + "src/google/protobuf/compiler/java/java_primitive_field.cc", + "src/google/protobuf/compiler/java/java_primitive_field_lite.cc", + "src/google/protobuf/compiler/java/java_service.cc", + "src/google/protobuf/compiler/java/java_shared_code_generator.cc", + "src/google/protobuf/compiler/java/java_string_field.cc", + "src/google/protobuf/compiler/java/java_string_field_lite.cc", + "src/google/protobuf/compiler/javanano/javanano_enum.cc", + "src/google/protobuf/compiler/javanano/javanano_enum_field.cc", + "src/google/protobuf/compiler/javanano/javanano_extension.cc", + "src/google/protobuf/compiler/javanano/javanano_field.cc", + "src/google/protobuf/compiler/javanano/javanano_file.cc", + "src/google/protobuf/compiler/javanano/javanano_generator.cc", + "src/google/protobuf/compiler/javanano/javanano_helpers.cc", + "src/google/protobuf/compiler/javanano/javanano_map_field.cc", + "src/google/protobuf/compiler/javanano/javanano_message.cc", + "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/objectivec/objectivec_enum.cc", + "src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc", + "src/google/protobuf/compiler/objectivec/objectivec_extension.cc", + "src/google/protobuf/compiler/objectivec/objectivec_field.cc", + "src/google/protobuf/compiler/objectivec/objectivec_file.cc", + "src/google/protobuf/compiler/objectivec/objectivec_generator.cc", + "src/google/protobuf/compiler/objectivec/objectivec_helpers.cc", + "src/google/protobuf/compiler/objectivec/objectivec_map_field.cc", + "src/google/protobuf/compiler/objectivec/objectivec_message.cc", + "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/plugin.cc", + "src/google/protobuf/compiler/plugin.pb.cc", + "src/google/protobuf/compiler/python/python_generator.cc", + "src/google/protobuf/compiler/ruby/ruby_generator.cc", + "src/google/protobuf/compiler/subprocess.cc", + "src/google/protobuf/compiler/zip_writer.cc", + ], + copts = COPTS, + includes = ["src/"], + linkopts = LINK_OPTS, + visibility = ["//visibility:public"], + deps = [":protobuf_clib"], +) diff --git a/third_party/protobuf/README.md b/third_party/protobuf/README.md index 2106efbfa0..bf93a9893d 100644 --- a/third_party/protobuf/README.md +++ b/third_party/protobuf/README.md @@ -1,45 +1,43 @@ -How to update the binaries other than `protoc-linux-x86_64.exe` and `protoc-mingw.exe`: +How to update the binaries other than `protoc-linux-x86_64.exe`: 1. Go to http://search.maven.org/ 2. Search for g:"com.google.protobuf" -3. Download the "jar" link from protobuf-java and put them in `<Bazel tree>/third_party/protobuf/<version>` -4. Download all binaries from "protoc" and put them in `<Bazel tree>/third_party/protobuf/<version>` -5. Set executable bit: `chmod +x *.exe` +3. Download the "jar" link from protobuf-java. +4. Download all binaries from "protoc". +5. Strip version number from protoc files: for `i in *.exe; do mv $i $(echo $i | sed s/3.0.0-beta-2-//); done` +6. Set executable bit: `chmod +x *.exe` +7. Update `third_party/BUILD` to point to the new jar file. +8. Done. -The 64-bit Linux version of the proto compiler (`protoc-linux-x86_64.exe`) is -linked statically. To update it, do the following steps on an x86_64 machine: +The 64-bit Linux version of the proto compiler is linked statically. To update it, do +the following steps on an x86_64 machine: 1. `git clone http://github.com/google/protobuf.git` -2. `git checkout <commithash>` +2. `git checkout <commithash>` (current is `d5fb408d` or `3.0.0-beta-2`) 3. `./autogen.sh` 4. `LDFLAGS=-static ./configure` 5. Change `LDFLAGS = -static` to `LDFLAGS = -all-static` in `src/Makefile`. 6. `make` -7. `cp src/protoc <Bazel tree>/third_party/protobuf/<version>/protoc-<version>-linux-x86_64.exe` . +7. `cp src/protoc <Bazel tree>/third_party/protobuf/protoc-linux-x86_64.exe` . + +How to update `protobuf.bzl` and the `src/` directory: + +1. `git clone http://github.com/google/protobuf.git` +2. `git checkout <commithash>` (current is `d5fb408d` or `3.0.0-beta-2`) +2. `mkdir -p third_party/protobuf/src/google` in the root of the Bazel tree. +3. `cp -R <root of protobuf tree>/src/google/protobuf third_party/protobuf/src/google` +4. Update rules in `third_party/protobuf/BUILD` with the rules in the protobuf repository. +5. Done. How to update `protoc-mingw.exe`: This is pretty much the same steps as for x86_64 above, but they need to be done -from MingW shell on a Windows machine ([https://sourceforge.net/projects/msys2/files/]). +from MingW shell on Windows machine ([https://sourceforge.net/projects/msys2/files/]). 1. `git clone http://github.com/google/protobuf.git` -2. `git checkout <commithash>` +2. `git checkout <commithash>` (current is `d5fb408d` or `3.0.0-beta-2`) 3. `./autogen.sh` 6. `make` -7. `cp src/protoc.exe <Bazel tree>/third_party/protobuf/<version>/protoc-<version>-mingw.exe` . +7. `cp src/protoc.exe <Bazel tree>/third_party/protobuf/protoc-mingw.exe` . -How to update `protobuf.bzl` and the `src/` directory: - -1. `git clone http://github.com/google/protobuf.git` -2. `git checkout <commithash>` -2. `mkdir -p third_party/protobuf/<version>/src/google` in the root of the Bazel tree. -3. `cp -R <root of protobuf tree>/src/google/protobuf third_party/protobuf/<version>/src/google` - -Finally, update the rules: - -1. Add a BUILD file to `third_party/protobuf/<version>/`. Use the BUILD file - for the previous version as a template. Update the `cc_library` rules to - match the rules in the BUILD file in the protobuf repository. Also copy - `protobuf.bzl` from the protobuf repository into - `third_party/protobuf/<version>/`. -2. Modify `third_party/protobuf/BUILD` to point to the new rules. -3. Delete the old version of protobuf. +How to update anything else in this directory: follow usual procedure as described on +https://www.bazel.io/contributing.html diff --git a/third_party/protobuf/proto_alias.bzl b/third_party/protobuf/proto_alias.bzl deleted file mode 100644 index e47728f96d..0000000000 --- a/third_party/protobuf/proto_alias.bzl +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2016 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -def proto_alias(name, version): - native.alias( - name = name, - actual = "//third_party/protobuf/" + version + ":" + name) |