diff --git a/.gitignore b/.gitignore index cc881f3f2c..ea95cc94e6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,24 +1,3 @@ -# autogen.sh-generated files -Makefile.in -src/Makefile.in -config.guess -config.h.in -config.sub -configure -depcomp -install-sh -ltmain.sh -missing -configure~ - -aclocal.m4 -m4/libtool.m4 -m4/ltoptions.m4 -m4/ltsugar.m4 -m4/ltversion.m4 -m4/lt~obsolete.m4 -autom4te.cache - # CMake-generated files .ninja_deps .ninja_logs @@ -40,8 +19,6 @@ Testing/Temporary/* /gmock # in-tree configure-generated files -Makefile -src/Makefile /config.h config.log config.status @@ -56,7 +33,6 @@ stamp-h1 *.o *.lo *.la -src/.libs *.so *.a @@ -79,8 +55,6 @@ python/build/ python/docs/_build/ src/js_embed -src/protoc -src/unittest_proto_middleman # vim generated *.swp diff --git a/BUILD.bazel b/BUILD.bazel index a14476a553..3734b49ed9 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -6,7 +6,7 @@ load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library") load("@rules_java//java:defs.bzl", "java_binary", "java_lite_proto_library", "java_proto_library") load("//build_defs:cpp_opts.bzl", "COPTS", "LINK_OPTS", "PROTOC_LINK_OPTS") -load(":protobuf.bzl", "py_proto_library") +load(":protobuf.bzl", "internal_py_proto_library", "internal_php_proto_library", "internal_ruby_proto_library", "internal_objc_proto_library") licenses(["notice"]) @@ -145,6 +145,16 @@ filegroup( visibility = ["//visibility:public"], ) +internal_ruby_proto_library( + name = "well_known_ruby_protos", + srcs = [":well_known_protos"], + includes = ["src"], + visibility = [ + "//conformance:__pkg__", + "//ruby:__subpackages__", + ], +) + ################################################################################ # Protocol Buffers Compiler ################################################################################ @@ -302,6 +312,10 @@ proto_lang_toolchain( visibility = ["//visibility:public"], ) +################################################################################ +# Objective-C support +################################################################################ + alias( name = "objectivec", actual = "//objectivec", @@ -355,7 +369,7 @@ proto_library( deps = ["//src/google/protobuf:generic_test_protos"], ) -py_proto_library( +internal_py_proto_library( name = "generated_protos_py", testonly = 1, srcs = [":generated_protos"], @@ -368,22 +382,22 @@ py_proto_library( # Conformance tests ################################################################################ -alias( - name = "conformance_test_runner", - actual = "//conformance:conformance_test_runner", - visibility = ["//visibility:public"], +cc_proto_library( + name = "test_messages_proto2_cc_proto", + visibility = [ + "//conformance:__pkg__", + "//src:__subpackages__", + ], + deps = ["//src/google/protobuf:test_messages_proto2_proto"], ) -alias( - name = "test_messages_proto2_proto", - actual = "//src/google/protobuf:test_messages_proto2_proto", # proto_library - visibility = ["//visibility:public"], -) - -alias( - name = "test_messages_proto3_proto", - actual = "//src/google/protobuf:test_messages_proto3_proto", # proto_library - visibility = ["//visibility:public"], +cc_proto_library( + name = "test_messages_proto3_cc_proto", + visibility = [ + "//conformance:__pkg__", + "//src:__subpackages__", + ], + deps = ["//src/google/protobuf:test_messages_proto3_proto"], ) java_proto_library( @@ -392,7 +406,7 @@ java_proto_library( "//conformance:__pkg__", "//java:__subpackages__", ], - deps = [":test_messages_proto2_proto"], + deps = ["//src/google/protobuf:test_messages_proto2_proto"], ) java_proto_library( @@ -401,7 +415,7 @@ java_proto_library( "//conformance:__pkg__", "//java:__subpackages__", ], - deps = [":test_messages_proto3_proto"], + deps = ["//src/google/protobuf:test_messages_proto3_proto"], ) java_lite_proto_library( @@ -410,7 +424,7 @@ java_lite_proto_library( "//conformance:__pkg__", "//java:__subpackages__", ], - deps = [":test_messages_proto2_proto"], + deps = ["//src/google/protobuf:test_messages_proto2_proto"], ) java_lite_proto_library( @@ -419,7 +433,77 @@ java_lite_proto_library( "//conformance:__pkg__", "//java:__subpackages__", ], - deps = [":test_messages_proto3_proto"], + deps = ["//src/google/protobuf:test_messages_proto3_proto"], +) + +internal_objc_proto_library( + name = "test_messages_proto2_objc_proto", + srcs = ["//src/google/protobuf:test_messages_proto2.proto"], + includes = ["src/google/protobuf"], + testonly = 1, + visibility = [ + "//conformance:__pkg__", + "//objectivec:__subpackages__", + ], +) + +internal_objc_proto_library( + name = "test_messages_proto3_objc_proto", + srcs = ["//src/google/protobuf:test_messages_proto3.proto"], + proto_deps = [":well_known_protos"], + includes = ["src/google/protobuf", "src"], + testonly = 1, + visibility = [ + "//conformance:__pkg__", + "//objectivec:__subpackages__", + ], +) + +internal_php_proto_library( + name = "test_messages_proto3_php_proto", + srcs = ["//src/google/protobuf:test_messages_proto3.proto"], + proto_deps = [":well_known_protos"], + includes = ["src/google/protobuf", "src"], + outs = [ + "Protobuf_test_messages/Proto3/EnumOnlyProto3.php", + "Protobuf_test_messages/Proto3/EnumOnlyProto3/PBBool.php", + "Protobuf_test_messages/Proto3/ForeignEnum.php", + "Protobuf_test_messages/Proto3/ForeignMessage.php", + "Protobuf_test_messages/Proto3/NullHypothesisProto3.php", + "Protobuf_test_messages/Proto3/TestAllTypesProto3.php", + "Protobuf_test_messages/Proto3/TestAllTypesProto3/AliasedEnum.php", + "Protobuf_test_messages/Proto3/TestAllTypesProto3/NestedEnum.php", + "Protobuf_test_messages/Proto3/TestAllTypesProto3/NestedMessage.php", + "GPBMetadata/TestMessagesProto3.php", + ], + testonly = 1, + visibility = [ + "//conformance:__pkg__", + "//php:__subpackages__", + ], +) + +internal_ruby_proto_library( + name = "test_messages_proto2_ruby_proto", + srcs = ["//src/google/protobuf:test_messages_proto2.proto"], + includes = ["src/google/protobuf"], + testonly = 1, + visibility = [ + "//conformance:__pkg__", + "//ruby:__subpackages__", + ], +) + +internal_ruby_proto_library( + name = "test_messages_proto3_ruby_proto", + srcs = ["//src/google/protobuf:test_messages_proto3.proto"], + proto_deps = [":well_known_protos"], + includes = ["src/google/protobuf", "src"], + testonly = 1, + visibility = [ + "//conformance:__pkg__", + "//ruby:__subpackages__", + ], ) filegroup( @@ -441,22 +525,6 @@ pkg_files( "cmake/*.cmake", "cmake/*.in", "editors/*", - - # Several of these files are generated by autogen.sh, so using - # glob() lets us ignore them if they are missing. (This is not good - # practice, though.) - "Makefile.in", - "aclocal.m4", - "ar-lib", - "compile", - "config*", - "depcomp", - "install-sh", - "ltmain.sh", - "m4/*.m4", - "missing", - "protobuf*.pc.in", - "test-driver", ], allow_empty = True, ) + [ @@ -465,10 +533,8 @@ pkg_files( "CMakeLists.txt", "CONTRIBUTORS.txt", "LICENSE", - "Makefile.am", "README.md", "WORKSPACE", - "autogen.sh", "cmake/CMakeLists.txt", "cmake/README.md", "cmake/update_file_lists.sh", @@ -476,7 +542,6 @@ pkg_files( "maven_install.json", "//third_party:BUILD.bazel", "//third_party:zlib.BUILD", - "//util/python:BUILD.bazel", ], strip_prefix = strip_prefix.from_root(""), visibility = ["//pkg:__pkg__"], diff --git a/CMakeLists.txt b/CMakeLists.txt index d5d2009d32..345d7d05a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,6 +79,11 @@ mark_as_advanced(protobuf_DEBUG_POSTFIX) # User options include(${protobuf_SOURCE_DIR}/cmake/protobuf-options.cmake) +# Version metadata +set(protobuf_VERSION_STRING "3.21.4") +set(protobuf_DESCRIPTION "Protocol Buffers") +set(protobuf_CONTACT "protobuf@googlegroups.com") + # Overrides for option dependencies if (protobuf_BUILD_PROTOC_BINARIES OR protobuf_BUILD_TESTS) set(protobuf_BUILD_LIBPROTOC ON) @@ -86,23 +91,6 @@ endif () if (NOT protobuf_BUILD_PROTOBUF_BINARIES) set(protobuf_INSTALL OFF) endif() -# Path to main configure script -set(protobuf_CONFIGURE_SCRIPT "${protobuf_SOURCE_DIR}/configure.ac") - -# Parse configure script -set(protobuf_AC_INIT_REGEX - "^AC_INIT\\(\\[([^]]+)\\],\\[([^]]+)\\],\\[([^]]+)\\],\\[([^]]+)\\]\\)$") -file(STRINGS "${protobuf_CONFIGURE_SCRIPT}" protobuf_AC_INIT_LINE - LIMIT_COUNT 1 REGEX "^AC_INIT") -# Description -string(REGEX REPLACE "${protobuf_AC_INIT_REGEX}" "\\1" - protobuf_DESCRIPTION "${protobuf_AC_INIT_LINE}") -# Version -string(REGEX REPLACE "${protobuf_AC_INIT_REGEX}" "\\2" - protobuf_VERSION_STRING "${protobuf_AC_INIT_LINE}") -# Contact -string(REGEX REPLACE "${protobuf_AC_INIT_REGEX}" "\\3" - protobuf_CONTACT "${protobuf_AC_INIT_LINE}") # Parse version tweaks set(protobuf_VERSION_REGEX "^([0-9]+)\\.([0-9]+)\\.([0-9]+)([-]rc[-]|\\.)?([0-9]*)$") string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\1" diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index acc72c27ef..0000000000 --- a/Makefile.am +++ /dev/null @@ -1,1294 +0,0 @@ -## Process this file with automake to produce Makefile.in - -ACLOCAL_AMFLAGS = -I m4 - -AUTOMAKE_OPTIONS = foreign - -# Build . before src so that our all-local and clean-local hooks kicks in at -# the right time. -SUBDIRS = . src - -# Always include third_party directories in distributions. -# -# Note that distribution artifacts will be produced by Bazel in the future. -# See pkg/BUILD.bazel for overall definitions. -DIST_SUBDIRS = src conformance benchmarks third_party/googletest - -# Build gmock before we build protobuf tests. We don't add gmock to SUBDIRS -# because then "make check" would also build and run all of gmock's own tests, -# which takes a lot of time and is generally not useful to us. Also, we don't -# want "make install" to recurse into gmock since we don't want to overwrite -# the installed version of gmock if there is one. -check-local: - @echo "Making lib/libgmock.a lib/libgmock_main.a in gmock" - @cd third_party/googletest/googletest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la - @cd third_party/googletest/googlemock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la - -# We would like to clean gmock when "make clean" is invoked. But we have to -# be careful because clean-local is also invoked during "make distclean", but -# "make distclean" already recurses into gmock because it's listed among the -# DIST_SUBDIRS. distclean will delete gmock/Makefile, so if we then try to -# cd to the directory again and "make clean" it will fail. So, check that the -# Makefile exists before recursing. -clean-local: - @if test -e third_party/googletest/Makefile; then \ - echo "Making clean in googletest"; \ - cd third_party/googletest && $(MAKE) $(AM_MAKEFLAGS) clean; \ - fi; \ - if test -e conformance/Makefile; then \ - echo "Making clean in conformance"; \ - cd conformance && $(MAKE) $(AM_MAKEFLAGS) clean; \ - fi; \ - if test -e benchmarks/Makefile; then \ - echo "Making clean in benchmarks"; \ - cd benchmarks && $(MAKE) $(AM_MAKEFLAGS) clean; \ - fi; \ - if test -e objectivec/DevTools; then \ - echo "Cleaning any ObjC pyc files"; \ - rm -f objectivec/DevTools/*.pyc; \ - fi - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = protobuf.pc protobuf-lite.pc - -# Note: please keep this in sync with the dist_files rule in csharp/BUILD.bazel. -csharp_EXTRA_DIST= \ - global.json \ - csharp/.editorconfig \ - csharp/.gitignore \ - csharp/CHANGES.txt \ - csharp/Google.Protobuf.Tools.targets \ - csharp/Google.Protobuf.Tools.nuspec \ - csharp/NuGet.Config \ - csharp/README.md \ - csharp/build_packages.bat \ - csharp/build_release.sh \ - csharp/build_tools.sh \ - csharp/buildall.bat \ - csharp/buildall.sh \ - csharp/generate_protos.sh \ - csharp/install_dotnet_sdk.ps1 \ - csharp/keys/Google.Protobuf.public.snk \ - csharp/keys/Google.Protobuf.snk \ - csharp/keys/README.md \ - csharp/protos/README.md \ - csharp/protos/map_unittest_proto3.proto \ - csharp/protos/old_extensions1.proto \ - csharp/protos/old_extensions2.proto \ - csharp/protos/unittest_issue6936_a.proto \ - csharp/protos/unittest_issue6936_b.proto \ - csharp/protos/unittest_issue6936_c.proto \ - csharp/protos/unittest_custom_options_proto3.proto \ - csharp/protos/unittest_import_public_proto3.proto \ - csharp/protos/unittest_import_public.proto \ - csharp/protos/unittest_import_proto3.proto \ - csharp/protos/unittest_import.proto \ - csharp/protos/unittest_issues.proto \ - csharp/protos/unittest_proto3.proto \ - csharp/protos/unittest_selfreferential_options.proto \ - csharp/protos/unittest.proto \ - csharp/src/AddressBook/AddPerson.cs \ - csharp/src/AddressBook/Addressbook.cs \ - csharp/src/AddressBook/AddressBook.csproj \ - csharp/src/AddressBook/ListPeople.cs \ - csharp/src/AddressBook/Program.cs \ - csharp/src/AddressBook/SampleUsage.cs \ - csharp/src/Directory.Build.props \ - csharp/src/Google.Protobuf.Benchmarks/BenchmarkDatasetConfig.cs \ - csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs \ - csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs \ - csharp/src/Google.Protobuf.Benchmarks/ByteStringBenchmark.cs \ - csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj \ - csharp/src/Google.Protobuf.Benchmarks/GoogleMessageBenchmark.cs \ - csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs \ - csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs \ - csharp/src/Google.Protobuf.Benchmarks/Program.cs \ - csharp/src/Google.Protobuf.Benchmarks/wrapper_benchmark_messages.proto \ - csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs \ - csharp/src/Google.Protobuf.Benchmarks/WriteMessagesBenchmark.cs \ - csharp/src/Google.Protobuf.Benchmarks/WriteRawPrimitivesBenchmark.cs \ - csharp/src/Google.Protobuf.Conformance/Conformance.cs \ - csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj \ - csharp/src/Google.Protobuf.Conformance/Program.cs \ - csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj \ - csharp/src/Google.Protobuf.JsonDump/Program.cs \ - csharp/src/Google.Protobuf.Test/Buffers/ArrayBufferWriter.cs \ - csharp/src/Google.Protobuf.Test/ByteStringTest.cs \ - csharp/src/Google.Protobuf.Test/CodedInputStreamExtensions.cs \ - csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs \ - csharp/src/Google.Protobuf.Test/CodedOutputStreamTest.cs \ - csharp/src/Google.Protobuf.Test/Collections/MapFieldTest.cs \ - csharp/src/Google.Protobuf.Test/Collections/ProtobufEqualityComparersTest.cs \ - csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs \ - csharp/src/Google.Protobuf.Test/Compatibility/PropertyInfoExtensionsTest.cs \ - csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs \ - csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs \ - csharp/src/Google.Protobuf.Test/EqualityTester.cs \ - csharp/src/Google.Protobuf.Test/ExtensionSetTest.cs \ - csharp/src/Google.Protobuf.Test/FieldCodecTest.cs \ - csharp/src/Google.Protobuf.Test/FieldMaskTreeTest.cs \ - csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs \ - csharp/src/Google.Protobuf.Test/GeneratedMessageTest.Proto2.cs \ - csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj \ - csharp/src/Google.Protobuf.Test/IssuesTest.cs \ - csharp/src/Google.Protobuf.Test/JsonFormatterSettingsTest.cs \ - csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs \ - csharp/src/Google.Protobuf.Test/JsonParserTest.cs \ - csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs \ - csharp/src/Google.Protobuf.Test/LegacyGeneratedCodeTest.cs \ - csharp/src/Google.Protobuf.Test/MessageParsingHelpers.cs \ - csharp/src/Google.Protobuf.Test/ParsingPrimitivesTest.cs \ - csharp/src/Google.Protobuf.Test/Proto3OptionalTest.cs \ - csharp/src/Google.Protobuf.Test/ReadOnlySequenceFactory.cs \ - csharp/src/Google.Protobuf.Test/RefStructCompatibilityTest.cs \ - csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs \ - csharp/src/Google.Protobuf.Test/Reflection/DescriptorDeclarationTest.cs \ - csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs \ - csharp/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs \ - csharp/src/Google.Protobuf.Test/Reflection/TypeRegistryTest.cs \ - csharp/src/Google.Protobuf.Test/SampleEnum.cs \ - csharp/src/Google.Protobuf.Test/SampleMessages.cs \ - csharp/src/Google.Protobuf.Test/SampleNaNs.cs \ - csharp/src/Google.Protobuf.Test/TestCornerCases.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/Google.Protobuf.Test.TestProtos.csproj \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936A.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936B.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssue6936C.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/ForeignMessagePartial.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/OldExtensions1.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/OldExtensions2.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto3.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestCustomOptionsProto3.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportProto3.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublicProto3.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestImportPublic.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.cs \ - csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs \ - csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs \ - csharp/src/Google.Protobuf.Test/WellKnownTypes/DurationTest.cs \ - csharp/src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs \ - csharp/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs \ - csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs \ - csharp/src/Google.Protobuf.Test/WritingPrimitivesTest.cs \ - csharp/src/Google.Protobuf.Test/UnknownFieldSetTest.cs \ - csharp/src/Google.Protobuf.Test/testprotos.pb \ - csharp/src/Google.Protobuf.sln \ - csharp/src/Google.Protobuf/ByteArray.cs \ - csharp/src/Google.Protobuf/ByteString.cs \ - csharp/src/Google.Protobuf/ByteStringAsync.cs \ - csharp/src/Google.Protobuf/CodedInputStream.cs \ - csharp/src/Google.Protobuf/CodedOutputStream.ComputeSize.cs \ - csharp/src/Google.Protobuf/CodedOutputStream.cs \ - csharp/src/Google.Protobuf/Collections/Lists.cs \ - csharp/src/Google.Protobuf/Collections/MapField.cs \ - csharp/src/Google.Protobuf/Collections/ProtobufEqualityComparers.cs \ - csharp/src/Google.Protobuf/Collections/RepeatedField.cs \ - csharp/src/Google.Protobuf/Compatibility/DynamicallyAccessedMembersAttribute.cs \ - csharp/src/Google.Protobuf/Compatibility/DynamicallyAccessedMemberTypes.cs \ - csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs \ - csharp/src/Google.Protobuf/Compatibility/RequiresUnreferencedCodeAttribute.cs \ - csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs \ - csharp/src/Google.Protobuf/Compatibility/UnconditionalSuppressMessageAttribute.cs \ - csharp/src/Google.Protobuf/Compiler/Plugin.cs \ - csharp/src/Google.Protobuf/Extension.cs \ - csharp/src/Google.Protobuf/ExtensionRegistry.cs \ - csharp/src/Google.Protobuf/ExtensionSet.cs \ - csharp/src/Google.Protobuf/ExtensionValue.cs \ - csharp/src/Google.Protobuf/FieldCodec.cs \ - csharp/src/Google.Protobuf/FieldMaskTree.cs \ - csharp/src/Google.Protobuf/FrameworkPortability.cs \ - csharp/src/Google.Protobuf/Google.Protobuf.csproj \ - csharp/src/Google.Protobuf/IBufferMessage.cs \ - csharp/src/Google.Protobuf/ICustomDiagnosticMessage.cs \ - csharp/src/Google.Protobuf/IDeepCloneable.cs \ - csharp/src/Google.Protobuf/IExtendableMessage.cs \ - csharp/src/Google.Protobuf/IMessage.cs \ - csharp/src/Google.Protobuf/InvalidJsonException.cs \ - csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs \ - csharp/src/Google.Protobuf/JsonFormatter.cs \ - csharp/src/Google.Protobuf/JsonParser.cs \ - csharp/src/Google.Protobuf/JsonToken.cs \ - csharp/src/Google.Protobuf/JsonTokenizer.cs \ - csharp/src/Google.Protobuf/LimitedInputStream.cs \ - csharp/src/Google.Protobuf/MessageExtensions.cs \ - csharp/src/Google.Protobuf/MessageParser.cs \ - csharp/src/Google.Protobuf/ObjectIntPair.cs \ - csharp/src/Google.Protobuf/ParseContext.cs \ - csharp/src/Google.Protobuf/ParserInternalState.cs \ - csharp/src/Google.Protobuf/ParsingPrimitives.cs \ - csharp/src/Google.Protobuf/ParsingPrimitivesMessages.cs \ - csharp/src/Google.Protobuf/ParsingPrimitivesWrappers.cs \ - csharp/src/Google.Protobuf/ProtoPreconditions.cs \ - csharp/src/Google.Protobuf/SegmentedBufferHelper.cs \ - csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs \ - csharp/src/Google.Protobuf/Reflection/CustomOptions.cs \ - csharp/src/Google.Protobuf/Reflection/Descriptor.cs \ - csharp/src/Google.Protobuf/Reflection/DescriptorBase.cs \ - csharp/src/Google.Protobuf/Reflection/DescriptorDeclaration.cs \ - csharp/src/Google.Protobuf/Reflection/DescriptorPool.cs \ - csharp/src/Google.Protobuf/Reflection/DescriptorUtil.cs \ - csharp/src/Google.Protobuf/Reflection/DescriptorValidationException.cs \ - csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/EnumValueDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/ExtensionAccessor.cs \ - csharp/src/Google.Protobuf/Reflection/ExtensionCollection.cs \ - csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs \ - csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/FieldType.cs \ - csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/GeneratedClrTypeInfo.cs \ - csharp/src/Google.Protobuf/Reflection/IDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/IFieldAccessor.cs \ - csharp/src/Google.Protobuf/Reflection/MapFieldAccessor.cs \ - csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/MethodDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs \ - csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/OriginalNameAttribute.cs \ - csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs \ - csharp/src/Google.Protobuf/Reflection/RepeatedFieldAccessor.cs \ - csharp/src/Google.Protobuf/Reflection/ServiceDescriptor.cs \ - csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs \ - csharp/src/Google.Protobuf/Reflection/TypeRegistry.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Any.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/AnyPartial.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Api.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/DurationPartial.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/FieldMaskPartial.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/TimeExtensions.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/TimestampPartial.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Type.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/ValuePartial.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs \ - csharp/src/Google.Protobuf/WellKnownTypes/WrappersPartial.cs \ - csharp/src/Google.Protobuf/WireFormat.cs \ - csharp/src/Google.Protobuf/WritingPrimitivesMessages.cs \ - csharp/src/Google.Protobuf/WritingPrimitives.cs \ - csharp/src/Google.Protobuf/WriterInternalState.cs \ - csharp/src/Google.Protobuf/WriteContext.cs \ - csharp/src/Google.Protobuf/WriteBufferHelper.cs \ - csharp/src/Google.Protobuf/UnknownField.cs \ - csharp/src/Google.Protobuf/UnknownFieldSet.cs \ - csharp/src/Google.Protobuf/UnsafeByteOperations.cs - -# Note: please keep this in sync with the dist_files rules under java/.../BUILD.bazel. -java_EXTRA_DIST= \ - java/README.md \ - java/bom/pom.xml \ - java/core/BUILD.bazel \ - java/core/generate-sources-build.xml \ - java/core/generate-test-sources-build.xml \ - java/core/pom.xml \ - java/core/pom_template.xml \ - java/core/src/main/java/com/google/protobuf/AbstractMessage.java \ - java/core/src/main/java/com/google/protobuf/AbstractMessageLite.java \ - java/core/src/main/java/com/google/protobuf/AbstractParser.java \ - java/core/src/main/java/com/google/protobuf/AbstractProtobufList.java \ - java/core/src/main/java/com/google/protobuf/AllocatedBuffer.java \ - java/core/src/main/java/com/google/protobuf/Android.java \ - java/core/src/main/java/com/google/protobuf/ArrayDecoders.java \ - java/core/src/main/java/com/google/protobuf/BinaryReader.java \ - java/core/src/main/java/com/google/protobuf/BinaryWriter.java \ - java/core/src/main/java/com/google/protobuf/BlockingRpcChannel.java \ - java/core/src/main/java/com/google/protobuf/BlockingService.java \ - java/core/src/main/java/com/google/protobuf/BooleanArrayList.java \ - java/core/src/main/java/com/google/protobuf/BufferAllocator.java \ - java/core/src/main/java/com/google/protobuf/ByteBufferWriter.java \ - java/core/src/main/java/com/google/protobuf/ByteOutput.java \ - java/core/src/main/java/com/google/protobuf/ByteString.java \ - java/core/src/main/java/com/google/protobuf/CanIgnoreReturnValue.java \ - java/core/src/main/java/com/google/protobuf/CheckReturnValue.java \ - java/core/src/main/java/com/google/protobuf/CodedInputStream.java \ - java/core/src/main/java/com/google/protobuf/CodedInputStreamReader.java \ - java/core/src/main/java/com/google/protobuf/CodedOutputStream.java \ - java/core/src/main/java/com/google/protobuf/CodedOutputStreamWriter.java \ - java/core/src/main/java/com/google/protobuf/CompileTimeConstant.java \ - java/core/src/main/java/com/google/protobuf/DescriptorMessageInfoFactory.java \ - java/core/src/main/java/com/google/protobuf/Descriptors.java \ - java/core/src/main/java/com/google/protobuf/DiscardUnknownFieldsParser.java \ - java/core/src/main/java/com/google/protobuf/DoubleArrayList.java \ - java/core/src/main/java/com/google/protobuf/DynamicMessage.java \ - java/core/src/main/java/com/google/protobuf/ExperimentalApi.java \ - java/core/src/main/java/com/google/protobuf/Extension.java \ - java/core/src/main/java/com/google/protobuf/ExtensionLite.java \ - java/core/src/main/java/com/google/protobuf/ExtensionRegistry.java \ - java/core/src/main/java/com/google/protobuf/ExtensionRegistryFactory.java \ - java/core/src/main/java/com/google/protobuf/ExtensionRegistryLite.java \ - java/core/src/main/java/com/google/protobuf/ExtensionSchema.java \ - java/core/src/main/java/com/google/protobuf/ExtensionSchemaFull.java \ - java/core/src/main/java/com/google/protobuf/ExtensionSchemaLite.java \ - java/core/src/main/java/com/google/protobuf/ExtensionSchemas.java \ - java/core/src/main/java/com/google/protobuf/FieldInfo.java \ - java/core/src/main/java/com/google/protobuf/FieldSet.java \ - java/core/src/main/java/com/google/protobuf/FieldType.java \ - java/core/src/main/java/com/google/protobuf/FloatArrayList.java \ - java/core/src/main/java/com/google/protobuf/GeneratedMessage.java \ - java/core/src/main/java/com/google/protobuf/GeneratedMessageInfoFactory.java \ - java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java \ - java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java \ - java/core/src/main/java/com/google/protobuf/InlineMe.java \ - java/core/src/main/java/com/google/protobuf/IntArrayList.java \ - java/core/src/main/java/com/google/protobuf/Internal.java \ - java/core/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java \ - java/core/src/main/java/com/google/protobuf/IterableByteBufferInputStream.java \ - java/core/src/main/java/com/google/protobuf/JavaType.java \ - java/core/src/main/java/com/google/protobuf/LazyField.java \ - java/core/src/main/java/com/google/protobuf/LazyFieldLite.java \ - java/core/src/main/java/com/google/protobuf/LazyStringArrayList.java \ - java/core/src/main/java/com/google/protobuf/LazyStringList.java \ - java/core/src/main/java/com/google/protobuf/ListFieldSchema.java \ - java/core/src/main/java/com/google/protobuf/LongArrayList.java \ - java/core/src/main/java/com/google/protobuf/ManifestSchemaFactory.java \ - java/core/src/main/java/com/google/protobuf/MapEntry.java \ - java/core/src/main/java/com/google/protobuf/MapEntryLite.java \ - java/core/src/main/java/com/google/protobuf/MapField.java \ - java/core/src/main/java/com/google/protobuf/MapFieldLite.java \ - java/core/src/main/java/com/google/protobuf/MapFieldSchema.java \ - java/core/src/main/java/com/google/protobuf/MapFieldSchemaFull.java \ - java/core/src/main/java/com/google/protobuf/MapFieldSchemaLite.java \ - java/core/src/main/java/com/google/protobuf/MapFieldSchemas.java \ - java/core/src/main/java/com/google/protobuf/Message.java \ - java/core/src/main/java/com/google/protobuf/MessageInfo.java \ - java/core/src/main/java/com/google/protobuf/MessageInfoFactory.java \ - java/core/src/main/java/com/google/protobuf/MessageLite.java \ - java/core/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java \ - java/core/src/main/java/com/google/protobuf/MessageLiteToString.java \ - java/core/src/main/java/com/google/protobuf/MessageOrBuilder.java \ - java/core/src/main/java/com/google/protobuf/MessageReflection.java \ - java/core/src/main/java/com/google/protobuf/MessageSchema.java \ - java/core/src/main/java/com/google/protobuf/MessageSetSchema.java \ - java/core/src/main/java/com/google/protobuf/MutabilityOracle.java \ - java/core/src/main/java/com/google/protobuf/NewInstanceSchema.java \ - java/core/src/main/java/com/google/protobuf/NewInstanceSchemaFull.java \ - java/core/src/main/java/com/google/protobuf/NewInstanceSchemaLite.java \ - java/core/src/main/java/com/google/protobuf/NewInstanceSchemas.java \ - java/core/src/main/java/com/google/protobuf/NioByteString.java \ - java/core/src/main/java/com/google/protobuf/OneofInfo.java \ - java/core/src/main/java/com/google/protobuf/Parser.java \ - java/core/src/main/java/com/google/protobuf/PrimitiveNonBoxingCollection.java \ - java/core/src/main/java/com/google/protobuf/ProtoSyntax.java \ - java/core/src/main/java/com/google/protobuf/Protobuf.java \ - java/core/src/main/java/com/google/protobuf/ProtobufArrayList.java \ - java/core/src/main/java/com/google/protobuf/ProtobufLists.java \ - java/core/src/main/java/com/google/protobuf/ProtocolMessageEnum.java \ - java/core/src/main/java/com/google/protobuf/ProtocolStringList.java \ - java/core/src/main/java/com/google/protobuf/RawMessageInfo.java \ - java/core/src/main/java/com/google/protobuf/Reader.java \ - java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilder.java \ - java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilderV3.java \ - java/core/src/main/java/com/google/protobuf/RopeByteString.java \ - java/core/src/main/java/com/google/protobuf/RpcCallback.java \ - java/core/src/main/java/com/google/protobuf/RpcChannel.java \ - java/core/src/main/java/com/google/protobuf/RpcController.java \ - java/core/src/main/java/com/google/protobuf/RpcUtil.java \ - java/core/src/main/java/com/google/protobuf/Schema.java \ - java/core/src/main/java/com/google/protobuf/SchemaFactory.java \ - java/core/src/main/java/com/google/protobuf/SchemaUtil.java \ - java/core/src/main/java/com/google/protobuf/Service.java \ - java/core/src/main/java/com/google/protobuf/ServiceException.java \ - java/core/src/main/java/com/google/protobuf/SingleFieldBuilder.java \ - java/core/src/main/java/com/google/protobuf/SingleFieldBuilderV3.java \ - java/core/src/main/java/com/google/protobuf/SmallSortedMap.java \ - java/core/src/main/java/com/google/protobuf/StructuralMessageInfo.java \ - java/core/src/main/java/com/google/protobuf/TextFormat.java \ - java/core/src/main/java/com/google/protobuf/TextFormatEscaper.java \ - java/core/src/main/java/com/google/protobuf/TextFormatParseInfoTree.java \ - java/core/src/main/java/com/google/protobuf/TextFormatParseLocation.java \ - java/core/src/main/java/com/google/protobuf/TypeRegistry.java \ - java/core/src/main/java/com/google/protobuf/UninitializedMessageException.java \ - java/core/src/main/java/com/google/protobuf/UnknownFieldSchema.java \ - java/core/src/main/java/com/google/protobuf/UnknownFieldSet.java \ - java/core/src/main/java/com/google/protobuf/UnknownFieldSetLite.java \ - java/core/src/main/java/com/google/protobuf/UnknownFieldSetLiteSchema.java \ - java/core/src/main/java/com/google/protobuf/UnknownFieldSetSchema.java \ - java/core/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java \ - java/core/src/main/java/com/google/protobuf/UnsafeByteOperations.java \ - java/core/src/main/java/com/google/protobuf/UnsafeUtil.java \ - java/core/src/main/java/com/google/protobuf/Utf8.java \ - java/core/src/main/java/com/google/protobuf/WireFormat.java \ - java/core/src/main/java/com/google/protobuf/Writer.java \ - java/core/src/test/java/com/google/protobuf/AbstractMessageTest.java \ - java/core/src/test/java/com/google/protobuf/AbstractProto2LiteSchemaTest.java \ - java/core/src/test/java/com/google/protobuf/AbstractProto2SchemaTest.java \ - java/core/src/test/java/com/google/protobuf/AbstractProto3LiteSchemaTest.java \ - java/core/src/test/java/com/google/protobuf/AbstractProto3SchemaTest.java \ - java/core/src/test/java/com/google/protobuf/AbstractSchemaTest.java \ - java/core/src/test/java/com/google/protobuf/AnyTest.java \ - java/core/src/test/java/com/google/protobuf/ArrayDecodersTest.java \ - java/core/src/test/java/com/google/protobuf/BinaryProtocolTest.java \ - java/core/src/test/java/com/google/protobuf/BooleanArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/BoundedByteStringTest.java \ - java/core/src/test/java/com/google/protobuf/ByteBufferWriterTest.java \ - java/core/src/test/java/com/google/protobuf/ByteStringTest.java \ - java/core/src/test/java/com/google/protobuf/CachedFieldSizeTest.java \ - java/core/src/test/java/com/google/protobuf/CheckUtf8Test.java \ - java/core/src/test/java/com/google/protobuf/CodedAdapterTest.java \ - java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java \ - java/core/src/test/java/com/google/protobuf/CodedOutputStreamTest.java \ - java/core/src/test/java/com/google/protobuf/DecodeUtf8Test.java \ - java/core/src/test/java/com/google/protobuf/DeprecatedFieldTest.java \ - java/core/src/test/java/com/google/protobuf/DescriptorsTest.java \ - java/core/src/test/java/com/google/protobuf/DiscardUnknownFieldsTest.java \ - java/core/src/test/java/com/google/protobuf/DoubleArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/DynamicMessageTest.java \ - java/core/src/test/java/com/google/protobuf/EnumTest.java \ - java/core/src/test/java/com/google/protobuf/ExperimentalMessageFactory.java \ - java/core/src/test/java/com/google/protobuf/ExperimentalSerializationUtil.java \ - java/core/src/test/java/com/google/protobuf/ExperimentalTestDataProvider.java \ - java/core/src/test/java/com/google/protobuf/ExtensionRegistryFactoryTest.java \ - java/core/src/test/java/com/google/protobuf/FieldPresenceTest.java \ - java/core/src/test/java/com/google/protobuf/FloatArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/GeneratedMessageTest.java \ - java/core/src/test/java/com/google/protobuf/IntArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/InvalidProtocolBufferExceptionTest.java \ - java/core/src/test/java/com/google/protobuf/IsValidUtf8Test.java \ - java/core/src/test/java/com/google/protobuf/IsValidUtf8TestUtil.java \ - java/core/src/test/java/com/google/protobuf/LazyFieldLiteTest.java \ - java/core/src/test/java/com/google/protobuf/LazyFieldTest.java \ - java/core/src/test/java/com/google/protobuf/LazyMessageLiteTest.java \ - java/core/src/test/java/com/google/protobuf/LazyStringArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/LazyStringEndToEndTest.java \ - java/core/src/test/java/com/google/protobuf/LiteEqualsAndHashTest.java \ - java/core/src/test/java/com/google/protobuf/LiteralByteStringTest.java \ - java/core/src/test/java/com/google/protobuf/LongArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/MapForProto2LiteTest.java \ - java/core/src/test/java/com/google/protobuf/MapForProto2Test.java \ - java/core/src/test/java/com/google/protobuf/MapLiteTest.java \ - java/core/src/test/java/com/google/protobuf/MapTest.java \ - java/core/src/test/java/com/google/protobuf/MessageTest.java \ - java/core/src/test/java/com/google/protobuf/NestedBuildersTest.java \ - java/core/src/test/java/com/google/protobuf/NioByteStringTest.java \ - java/core/src/test/java/com/google/protobuf/PackedFieldTest.java \ - java/core/src/test/java/com/google/protobuf/ParseExceptionsTest.java \ - java/core/src/test/java/com/google/protobuf/ParserLiteTest.java \ - java/core/src/test/java/com/google/protobuf/ParserTest.java \ - java/core/src/test/java/com/google/protobuf/Proto2ExtensionLookupSchemaTest.java \ - java/core/src/test/java/com/google/protobuf/Proto2LiteSchemaTest.java \ - java/core/src/test/java/com/google/protobuf/Proto2MessageFactory.java \ - java/core/src/test/java/com/google/protobuf/Proto2MessageLiteFactory.java \ - java/core/src/test/java/com/google/protobuf/Proto2SchemaTest.java \ - java/core/src/test/java/com/google/protobuf/Proto2UnknownEnumValueTest.java \ - java/core/src/test/java/com/google/protobuf/Proto3LiteSchemaTest.java \ - java/core/src/test/java/com/google/protobuf/Proto3MessageFactory.java \ - java/core/src/test/java/com/google/protobuf/Proto3MessageLiteFactory.java \ - java/core/src/test/java/com/google/protobuf/Proto3SchemaTest.java \ - java/core/src/test/java/com/google/protobuf/ProtobufArrayListTest.java \ - java/core/src/test/java/com/google/protobuf/RepeatedFieldBuilderV3Test.java \ - java/core/src/test/java/com/google/protobuf/RopeByteStringSubstringTest.java \ - java/core/src/test/java/com/google/protobuf/RopeByteStringTest.java \ - java/core/src/test/java/com/google/protobuf/ServiceTest.java \ - java/core/src/test/java/com/google/protobuf/SingleFieldBuilderV3Test.java \ - java/core/src/test/java/com/google/protobuf/SmallSortedMapTest.java \ - java/core/src/test/java/com/google/protobuf/TestBadIdentifiers.java \ - java/core/src/test/java/com/google/protobuf/TestBadIdentifiersLite.java \ - java/core/src/test/java/com/google/protobuf/TestSchemas.java \ - java/core/src/test/java/com/google/protobuf/TestSchemasLite.java \ - java/core/src/test/java/com/google/protobuf/TestUtil.java \ - java/core/src/test/java/com/google/protobuf/TestUtilLite.java \ - java/core/src/test/java/com/google/protobuf/TextFormatParseInfoTreeTest.java \ - java/core/src/test/java/com/google/protobuf/TextFormatParseLocationTest.java \ - java/core/src/test/java/com/google/protobuf/TextFormatTest.java \ - java/core/src/test/java/com/google/protobuf/TypeRegistryTest.java \ - java/core/src/test/java/com/google/protobuf/UnknownEnumValueTest.java \ - java/core/src/test/java/com/google/protobuf/UnknownFieldSetTest.java \ - java/core/src/test/java/com/google/protobuf/UnknownFieldSetPerformanceTest.java \ - java/core/src/test/java/com/google/protobuf/UnmodifiableLazyStringListTest.java \ - java/core/src/test/java/com/google/protobuf/Utf8Test.java \ - java/core/src/test/java/com/google/protobuf/WellKnownTypesTest.java \ - java/core/src/test/java/com/google/protobuf/WireFormatLiteTest.java \ - java/core/src/test/java/com/google/protobuf/WireFormatTest.java \ - java/core/src/test/java/com/google/protobuf/WrappersLiteOfMethodTest.java \ - java/core/src/test/java/com/google/protobuf/WrappersOfMethodTest.java \ - java/core/src/test/proto/com/google/protobuf/any_test.proto \ - java/core/src/test/proto/com/google/protobuf/cached_field_size_test.proto \ - java/core/src/test/proto/com/google/protobuf/deprecated_file.proto \ - java/core/src/test/proto/com/google/protobuf/dynamic_message_test.proto \ - java/core/src/test/proto/com/google/protobuf/field_presence_test.proto \ - java/core/src/test/proto/com/google/protobuf/lazy_fields_lite.proto \ - java/core/src/test/proto/com/google/protobuf/lite_equals_and_hash.proto \ - java/core/src/test/proto/com/google/protobuf/map_for_proto2_lite_test.proto \ - java/core/src/test/proto/com/google/protobuf/map_for_proto2_test.proto \ - java/core/src/test/proto/com/google/protobuf/map_initialization_order_test.proto \ - java/core/src/test/proto/com/google/protobuf/map_lite_test.proto \ - java/core/src/test/proto/com/google/protobuf/map_test.proto \ - java/core/src/test/proto/com/google/protobuf/multiple_files_test.proto \ - java/core/src/test/proto/com/google/protobuf/nested_builders_test.proto \ - java/core/src/test/proto/com/google/protobuf/nested_extension.proto \ - java/core/src/test/proto/com/google/protobuf/nested_extension_lite.proto \ - java/core/src/test/proto/com/google/protobuf/non_nested_extension.proto \ - java/core/src/test/proto/com/google/protobuf/non_nested_extension_lite.proto \ - java/core/src/test/proto/com/google/protobuf/outer_class_name_test.proto \ - java/core/src/test/proto/com/google/protobuf/outer_class_name_test2.proto \ - java/core/src/test/proto/com/google/protobuf/outer_class_name_test3.proto \ - java/core/src/test/proto/com/google/protobuf/packed_field_test.proto \ - java/core/src/test/proto/com/google/protobuf/proto2_message.proto \ - java/core/src/test/proto/com/google/protobuf/proto2_message_lite.proto \ - java/core/src/test/proto/com/google/protobuf/proto2_unknown_enum_values.proto \ - java/core/src/test/proto/com/google/protobuf/proto3_message.proto \ - java/core/src/test/proto/com/google/protobuf/proto3_message_lite.proto \ - java/core/src/test/proto/com/google/protobuf/test_bad_identifiers.proto \ - java/core/src/test/proto/com/google/protobuf/test_check_utf8.proto \ - java/core/src/test/proto/com/google/protobuf/test_check_utf8_size.proto \ - java/core/src/test/proto/com/google/protobuf/test_custom_options.proto \ - java/core/src/test/proto/com/google/protobuf/wrappers_test.proto \ - java/internal/BUILD.bazel \ - java/internal/testing.bzl \ - java/kotlin/BUILD.bazel \ - java/kotlin/generate-sources-build.xml \ - java/kotlin/generate-test-sources-build.xml \ - java/kotlin/pom.xml \ - java/kotlin/pom_template.xml \ - java/kotlin/src/main/kotlin/com/google/protobuf/Anies.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/ByteStrings.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/DslList.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/DslMap.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/DslProxy.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/ExtendableMessageExtensions.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/ExtensionList.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/OnlyForUseByGeneratedProtoCode.kt\ - java/kotlin/src/main/kotlin/com/google/protobuf/ProtoDslMarker.kt \ - java/kotlin/src/main/kotlin/com/google/protobuf/UnmodifiableCollections.kt \ - java/kotlin/src/test/kotlin/com/google/protobuf/AniesTest.kt \ - java/kotlin/src/test/kotlin/com/google/protobuf/ByteStringsTest.kt \ - java/kotlin/src/test/kotlin/com/google/protobuf/DslListTest.kt \ - java/kotlin/src/test/kotlin/com/google/protobuf/DslMapTest.kt \ - java/kotlin/src/test/kotlin/com/google/protobuf/ExtendableMessageExtensionsTest.kt\ - java/kotlin/src/test/kotlin/com/google/protobuf/ExtensionListTest.kt \ - java/kotlin/src/test/kotlin/com/google/protobuf/Proto2Test.kt \ - java/kotlin/src/test/kotlin/com/google/protobuf/Proto3Test.kt \ - java/kotlin/src/test/proto/com/google/protobuf/evil_names_proto2.proto \ - java/kotlin/src/test/proto/com/google/protobuf/evil_names_proto3.proto \ - java/kotlin/src/test/proto/com/google/protobuf/example_extensible_message.proto \ - java/kotlin/src/test/proto/com/google/protobuf/multiple_files_proto3.proto \ - java/kotlin-lite/BUILD.bazel \ - java/kotlin-lite/generate-sources-build.xml \ - java/kotlin-lite/generate-test-sources-build.xml \ - java/kotlin-lite/lite.awk \ - java/kotlin-lite/pom.xml \ - java/kotlin-lite/pom_template.xml \ - java/kotlin-lite/process-lite-sources-build.xml \ - java/kotlin-lite/src/main/kotlin/com/google/protobuf/ExtendableMessageLiteExtensions.kt\ - java/kotlin-lite/src/test/kotlin/com/google/protobuf/ExtendableMessageLiteExtensionsTest.kt\ - java/kotlin-lite/src/test/kotlin/com/google/protobuf/Proto2LiteTest.kt \ - java/lite.md \ - java/lite/BUILD.bazel \ - java/lite/generate-sources-build.xml \ - java/lite/generate-test-sources-build.xml \ - java/lite/lite.awk \ - java/lite/pom.xml \ - java/lite/pom_template.xml \ - java/lite/process-lite-sources-build.xml \ - java/lite/src/test/java/com/google/protobuf/LiteTest.java \ - java/BUILD.bazel \ - java/pom.xml \ - java/protoc/pom.xml \ - java/util/BUILD.bazel \ - java/util/pom.xml \ - java/util/pom_template.xml \ - java/util/src/main/java/com/google/protobuf/util/Durations.java \ - java/util/src/main/java/com/google/protobuf/util/FieldMaskTree.java \ - java/util/src/main/java/com/google/protobuf/util/FieldMaskUtil.java \ - java/util/src/main/java/com/google/protobuf/util/JsonFormat.java \ - java/util/src/main/java/com/google/protobuf/util/Structs.java \ - java/util/src/main/java/com/google/protobuf/util/Timestamps.java \ - java/util/src/main/java/com/google/protobuf/util/Values.java \ - java/util/src/test/java/com/google/protobuf/util/DurationsTest.java \ - java/util/src/test/java/com/google/protobuf/util/FieldMaskTreeTest.java \ - java/util/src/test/java/com/google/protobuf/util/FieldMaskUtilTest.java \ - java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java \ - java/util/src/test/java/com/google/protobuf/util/StructsTest.java \ - java/util/src/test/java/com/google/protobuf/util/TimestampsTest.java \ - java/util/src/test/java/com/google/protobuf/util/ValuesTest.java \ - java/util/src/test/proto/com/google/protobuf/util/json_test.proto - -# Note: please keep this in sync with the dist_files rule in objectivec/BUILD.bazel. -objectivec_EXTRA_DIST= \ - objectivec/.clang-format \ - objectivec/BUILD.bazel \ - objectivec/DevTools/check_version_stamps.sh \ - objectivec/DevTools/compile_testing_protos.sh \ - objectivec/DevTools/full_mac_build.sh \ - objectivec/DevTools/pddm.py \ - objectivec/DevTools/pddm_tests.py \ - objectivec/generate_well_known_types.sh \ - objectivec/google/protobuf/Any.pbobjc.h \ - objectivec/google/protobuf/Api.pbobjc.h \ - objectivec/google/protobuf/Duration.pbobjc.h \ - objectivec/google/protobuf/Empty.pbobjc.h \ - objectivec/google/protobuf/FieldMask.pbobjc.h \ - objectivec/google/protobuf/SourceContext.pbobjc.h \ - objectivec/google/protobuf/Struct.pbobjc.h \ - objectivec/google/protobuf/Timestamp.pbobjc.h \ - objectivec/google/protobuf/Type.pbobjc.h \ - objectivec/google/protobuf/Wrappers.pbobjc.h \ - objectivec/GPBAny.pbobjc.h \ - objectivec/GPBAny.pbobjc.m \ - objectivec/GPBApi.pbobjc.h \ - objectivec/GPBApi.pbobjc.m \ - objectivec/GPBArray.h \ - objectivec/GPBArray.m \ - objectivec/GPBArray_PackagePrivate.h \ - objectivec/GPBBootstrap.h \ - objectivec/GPBCodedInputStream.h \ - objectivec/GPBCodedInputStream.m \ - objectivec/GPBCodedInputStream_PackagePrivate.h \ - objectivec/GPBCodedOutputStream.h \ - objectivec/GPBCodedOutputStream.m \ - objectivec/GPBCodedOutputStream_PackagePrivate.h \ - objectivec/GPBDescriptor.h \ - objectivec/GPBDescriptor.m \ - objectivec/GPBDescriptor_PackagePrivate.h \ - objectivec/GPBDictionary.h \ - objectivec/GPBDictionary.m \ - objectivec/GPBDictionary_PackagePrivate.h \ - objectivec/GPBDuration.pbobjc.h \ - objectivec/GPBDuration.pbobjc.m \ - objectivec/GPBEmpty.pbobjc.h \ - objectivec/GPBEmpty.pbobjc.m \ - objectivec/GPBExtensionInternals.h \ - objectivec/GPBExtensionInternals.m \ - objectivec/GPBExtensionRegistry.h \ - objectivec/GPBExtensionRegistry.m \ - objectivec/GPBFieldMask.pbobjc.h \ - objectivec/GPBFieldMask.pbobjc.m \ - objectivec/GPBMessage.h \ - objectivec/GPBMessage.m \ - objectivec/GPBMessage_PackagePrivate.h \ - objectivec/GPBProtocolBuffers.h \ - objectivec/GPBProtocolBuffers.m \ - objectivec/GPBProtocolBuffers_RuntimeSupport.h \ - objectivec/GPBRootObject.h \ - objectivec/GPBRootObject.m \ - objectivec/GPBRootObject_PackagePrivate.h \ - objectivec/GPBRuntimeTypes.h \ - objectivec/GPBSourceContext.pbobjc.h \ - objectivec/GPBSourceContext.pbobjc.m \ - objectivec/GPBStruct.pbobjc.h \ - objectivec/GPBStruct.pbobjc.m \ - objectivec/GPBTimestamp.pbobjc.h \ - objectivec/GPBTimestamp.pbobjc.m \ - objectivec/GPBType.pbobjc.h \ - objectivec/GPBType.pbobjc.m \ - objectivec/GPBUnknownField.h \ - objectivec/GPBUnknownField.m \ - objectivec/GPBUnknownField_PackagePrivate.h \ - objectivec/GPBUnknownFieldSet.h \ - objectivec/GPBUnknownFieldSet.m \ - objectivec/GPBUnknownFieldSet_PackagePrivate.h \ - objectivec/GPBUtilities.h \ - objectivec/GPBUtilities.m \ - objectivec/GPBUtilities_PackagePrivate.h \ - objectivec/GPBWellKnownTypes.h \ - objectivec/GPBWellKnownTypes.m \ - objectivec/GPBWireFormat.h \ - objectivec/GPBWireFormat.m \ - objectivec/GPBWrappers.pbobjc.h \ - objectivec/GPBWrappers.pbobjc.m \ - objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj \ - objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ - objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist \ - objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings \ - objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme \ - objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme \ - objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj \ - objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ - objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist \ - objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings \ - objectivec/ProtocolBuffers_OSX.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme \ - objectivec/ProtocolBuffers_OSX.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme \ - objectivec/ProtocolBuffers_tvOS.xcodeproj/project.pbxproj \ - objectivec/ProtocolBuffers_tvOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ - objectivec/ProtocolBuffers_tvOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist \ - objectivec/ProtocolBuffers_tvOS.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings \ - objectivec/ProtocolBuffers_tvOS.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme \ - objectivec/ProtocolBuffers_tvOS.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme \ - objectivec/README.md \ - objectivec/Tests/golden_message \ - objectivec/Tests/golden_packed_fields_message \ - objectivec/Tests/GPBARCUnittestProtos.m \ - objectivec/Tests/GPBArrayTests.m \ - objectivec/Tests/GPBCodedInputStreamTests.m \ - objectivec/Tests/GPBCodedOuputStreamTests.m \ - objectivec/Tests/GPBCompileTest01.m \ - objectivec/Tests/GPBCompileTest02.m \ - objectivec/Tests/GPBCompileTest03.m \ - objectivec/Tests/GPBCompileTest04.m \ - objectivec/Tests/GPBCompileTest05.m \ - objectivec/Tests/GPBCompileTest06.m \ - objectivec/Tests/GPBCompileTest07.m \ - objectivec/Tests/GPBCompileTest08.m \ - objectivec/Tests/GPBCompileTest09.m \ - objectivec/Tests/GPBCompileTest10.m \ - objectivec/Tests/GPBCompileTest11.m \ - objectivec/Tests/GPBCompileTest12.m \ - objectivec/Tests/GPBCompileTest13.m \ - objectivec/Tests/GPBCompileTest14.m \ - objectivec/Tests/GPBCompileTest15.m \ - objectivec/Tests/GPBCompileTest16.m \ - objectivec/Tests/GPBCompileTest17.m \ - objectivec/Tests/GPBCompileTest18.m \ - objectivec/Tests/GPBCompileTest19.m \ - objectivec/Tests/GPBCompileTest20.m \ - objectivec/Tests/GPBCompileTest21.m \ - objectivec/Tests/GPBCompileTest22.m \ - objectivec/Tests/GPBCompileTest23.m \ - objectivec/Tests/GPBCompileTest24.m \ - objectivec/Tests/GPBCompileTest25.m \ - objectivec/Tests/GPBConcurrencyTests.m \ - objectivec/Tests/GPBDescriptorTests.m \ - objectivec/Tests/GPBDictionaryTests+Bool.m \ - objectivec/Tests/GPBDictionaryTests+Int32.m \ - objectivec/Tests/GPBDictionaryTests+Int64.m \ - objectivec/Tests/GPBDictionaryTests+String.m \ - objectivec/Tests/GPBDictionaryTests+UInt32.m \ - objectivec/Tests/GPBDictionaryTests+UInt64.m \ - objectivec/Tests/GPBDictionaryTests.m \ - objectivec/Tests/GPBDictionaryTests.pddm \ - objectivec/Tests/GPBExtensionRegistryTest.m \ - objectivec/Tests/GPBMessageTests+ClassNames.m \ - objectivec/Tests/GPBMessageTests+Merge.m \ - objectivec/Tests/GPBMessageTests+Runtime.m \ - objectivec/Tests/GPBMessageTests+Serialization.m \ - objectivec/Tests/GPBMessageTests.m \ - objectivec/Tests/GPBObjectiveCPlusPlusTest.mm \ - objectivec/Tests/GPBPerfTests.m \ - objectivec/Tests/GPBSwiftTests.swift \ - objectivec/Tests/GPBTestUtilities.h \ - objectivec/Tests/GPBTestUtilities.m \ - objectivec/Tests/GPBUnittestProtos.m \ - objectivec/Tests/GPBUnittestProtos2.m \ - objectivec/Tests/GPBUnknownFieldSetTest.m \ - objectivec/Tests/GPBUtilitiesTests.m \ - objectivec/Tests/GPBWellKnownTypesTest.m \ - objectivec/Tests/GPBWireFormatTests.m \ - objectivec/Tests/text_format_extensions_unittest_data.txt \ - objectivec/Tests/text_format_map_unittest_data.txt \ - objectivec/Tests/text_format_unittest_data.txt \ - objectivec/Tests/unittest_cycle.proto \ - objectivec/Tests/unittest_deprecated.proto \ - objectivec/Tests/unittest_deprecated_file.proto \ - objectivec/Tests/unittest_extension_chain_a.proto \ - objectivec/Tests/unittest_extension_chain_b.proto \ - objectivec/Tests/unittest_extension_chain_c.proto \ - objectivec/Tests/unittest_extension_chain_d.proto \ - objectivec/Tests/unittest_extension_chain_e.proto \ - objectivec/Tests/unittest_extension_chain_f.proto \ - objectivec/Tests/unittest_extension_chain_g.proto \ - objectivec/Tests/unittest_objc.proto \ - objectivec/Tests/unittest_objc_options.proto \ - objectivec/Tests/unittest_objc_startup.proto \ - objectivec/Tests/unittest_runtime_proto2.proto \ - objectivec/Tests/unittest_runtime_proto3.proto \ - objectivec/Tests/UnitTests-Bridging-Header.h \ - objectivec/Tests/UnitTests-Info.plist \ - Protobuf.podspec - -# Note: please keep this in sync with the dist_files rule in php/BUILD.bazel. -php_EXTRA_DIST= \ - php/README.md \ - php/REFCOUNTING.md \ - php/composer.json \ - php/composer.json.dist \ - php/ext/google/protobuf/arena.c \ - php/ext/google/protobuf/arena.h \ - php/ext/google/protobuf/array.c \ - php/ext/google/protobuf/array.h \ - php/ext/google/protobuf/config.m4 \ - php/ext/google/protobuf/convert.c \ - php/ext/google/protobuf/convert.h \ - php/ext/google/protobuf/def.c \ - php/ext/google/protobuf/def.h \ - php/ext/google/protobuf/map.c \ - php/ext/google/protobuf/map.h \ - php/ext/google/protobuf/message.c \ - php/ext/google/protobuf/message.h \ - php/ext/google/protobuf/names.c \ - php/ext/google/protobuf/names.h \ - php/ext/google/protobuf/package.xml \ - php/ext/google/protobuf/php-upb.c \ - php/ext/google/protobuf/php-upb.h \ - php/ext/google/protobuf/php_protobuf.h \ - php/ext/google/protobuf/protobuf.c \ - php/ext/google/protobuf/protobuf.h \ - php/ext/google/protobuf/wkt.inc \ - php/ext/google/protobuf/tests/unnecessary_zval.phpt \ - php/generate_descriptor_protos.sh \ - php/generate_test_protos.sh \ - php/release.sh \ - php/src/GPBMetadata/Google/Protobuf/Any.php \ - php/src/GPBMetadata/Google/Protobuf/Api.php \ - php/src/GPBMetadata/Google/Protobuf/Duration.php \ - php/src/GPBMetadata/Google/Protobuf/FieldMask.php \ - php/src/GPBMetadata/Google/Protobuf/GPBEmpty.php \ - php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php \ - php/src/GPBMetadata/Google/Protobuf/SourceContext.php \ - php/src/GPBMetadata/Google/Protobuf/Struct.php \ - php/src/GPBMetadata/Google/Protobuf/Timestamp.php \ - php/src/GPBMetadata/Google/Protobuf/Type.php \ - php/src/GPBMetadata/Google/Protobuf/Wrappers.php \ - php/src/Google/Protobuf/Any.php \ - php/src/Google/Protobuf/Api.php \ - php/src/Google/Protobuf/BoolValue.php \ - php/src/Google/Protobuf/BytesValue.php \ - php/src/Google/Protobuf/Descriptor.php \ - php/src/Google/Protobuf/DescriptorPool.php \ - php/src/Google/Protobuf/DoubleValue.php \ - php/src/Google/Protobuf/Duration.php \ - php/src/Google/Protobuf/Enum.php \ - php/src/Google/Protobuf/EnumDescriptor.php \ - php/src/Google/Protobuf/EnumValue.php \ - php/src/Google/Protobuf/EnumValueDescriptor.php \ - php/src/Google/Protobuf/Field.php \ - php/src/Google/Protobuf/FieldDescriptor.php \ - php/src/Google/Protobuf/FieldMask.php \ - php/src/Google/Protobuf/Field/Cardinality.php \ - php/src/Google/Protobuf/Field_Cardinality.php \ - php/src/Google/Protobuf/Field/Kind.php \ - php/src/Google/Protobuf/Field_Kind.php \ - php/src/Google/Protobuf/FloatValue.php \ - php/src/Google/Protobuf/GPBEmpty.php \ - php/src/Google/Protobuf/Int32Value.php \ - php/src/Google/Protobuf/Int64Value.php \ - php/src/Google/Protobuf/Internal/AnyBase.php \ - php/src/Google/Protobuf/Internal/CodedInputStream.php \ - php/src/Google/Protobuf/Internal/CodedOutputStream.php \ - php/src/Google/Protobuf/Internal/Descriptor.php \ - php/src/Google/Protobuf/Internal/DescriptorPool.php \ - php/src/Google/Protobuf/Internal/DescriptorProto.php \ - php/src/Google/Protobuf/Internal/DescriptorProto/ExtensionRange.php \ - php/src/Google/Protobuf/Internal/DescriptorProto/ReservedRange.php \ - php/src/Google/Protobuf/Internal/EnumBuilderContext.php \ - php/src/Google/Protobuf/Internal/EnumDescriptor.php \ - php/src/Google/Protobuf/Internal/EnumDescriptorProto.php \ - php/src/Google/Protobuf/Internal/EnumDescriptorProto/EnumReservedRange.php \ - php/src/Google/Protobuf/Internal/EnumOptions.php \ - php/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php \ - php/src/Google/Protobuf/Internal/EnumValueOptions.php \ - php/src/Google/Protobuf/Internal/ExtensionRangeOptions.php \ - php/src/Google/Protobuf/Internal/FieldDescriptorProto.php \ - php/src/Google/Protobuf/Internal/FieldDescriptor.php \ - php/src/Google/Protobuf/Internal/FieldDescriptorProto.php \ - php/src/Google/Protobuf/Internal/FieldDescriptorProto/Label.php \ - php/src/Google/Protobuf/Internal/FieldDescriptorProto/Type.php \ - php/src/Google/Protobuf/Internal/FieldOptions.php \ - php/src/Google/Protobuf/Internal/FieldOptions/CType.php \ - php/src/Google/Protobuf/Internal/FieldOptions/JSType.php \ - php/src/Google/Protobuf/Internal/FileDescriptor.php \ - php/src/Google/Protobuf/Internal/FileDescriptorProto.php \ - php/src/Google/Protobuf/Internal/FileDescriptorSet.php \ - php/src/Google/Protobuf/Internal/FileOptions.php \ - php/src/Google/Protobuf/Internal/FileOptions/OptimizeMode.php \ - php/src/Google/Protobuf/Internal/GPBDecodeException.php \ - php/src/Google/Protobuf/Internal/GPBJsonWire.php \ - php/src/Google/Protobuf/Internal/GPBLabel.php \ - php/src/Google/Protobuf/Internal/GPBType.php \ - php/src/Google/Protobuf/Internal/GPBUtil.php \ - php/src/Google/Protobuf/Internal/GPBWire.php \ - php/src/Google/Protobuf/Internal/GPBWireType.php \ - php/src/Google/Protobuf/Internal/GeneratedCodeInfo.php \ - php/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php \ - php/src/Google/Protobuf/Internal/GetPublicDescriptorTrait.php \ - php/src/Google/Protobuf/Internal/HasPublicDescriptorTrait.php \ - php/src/Google/Protobuf/Internal/MapEntry.php \ - php/src/Google/Protobuf/Internal/MapField.php \ - php/src/Google/Protobuf/Internal/MapFieldIter.php \ - php/src/Google/Protobuf/Internal/Message.php \ - php/src/Google/Protobuf/Internal/MessageBuilderContext.php \ - php/src/Google/Protobuf/Internal/MessageOptions.php \ - php/src/Google/Protobuf/Internal/MethodDescriptorProto.php \ - php/src/Google/Protobuf/Internal/MethodOptions.php \ - php/src/Google/Protobuf/Internal/MethodOptions/IdempotencyLevel.php \ - php/src/Google/Protobuf/Internal/OneofDescriptor.php \ - php/src/Google/Protobuf/Internal/OneofDescriptorProto.php \ - php/src/Google/Protobuf/Internal/OneofField.php \ - php/src/Google/Protobuf/Internal/OneofOptions.php \ - php/src/Google/Protobuf/Internal/RawInputStream.php \ - php/src/Google/Protobuf/Internal/RepeatedField.php \ - php/src/Google/Protobuf/Internal/RepeatedFieldIter.php \ - php/src/Google/Protobuf/Internal/ServiceDescriptorProto.php \ - php/src/Google/Protobuf/Internal/ServiceOptions.php \ - php/src/Google/Protobuf/Internal/SourceCodeInfo.php \ - php/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php \ - php/src/Google/Protobuf/Internal/TimestampBase.php \ - php/src/Google/Protobuf/Internal/UninterpretedOption.php \ - php/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php \ - php/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php \ - php/src/Google/Protobuf/Internal/DescriptorProto_ReservedRange.php \ - php/src/Google/Protobuf/Internal/EnumDescriptorProto_EnumReservedRange.php \ - php/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php \ - php/src/Google/Protobuf/Internal/FieldDescriptorProto_Type.php \ - php/src/Google/Protobuf/Internal/FieldOptions_CType.php \ - php/src/Google/Protobuf/Internal/FieldOptions_JSType.php \ - php/src/Google/Protobuf/Internal/FileOptions_OptimizeMode.php \ - php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php \ - php/src/Google/Protobuf/Internal/MethodOptions_IdempotencyLevel.php \ - php/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php \ - php/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php \ - php/src/Google/Protobuf/ListValue.php \ - php/src/Google/Protobuf/Method.php \ - php/src/Google/Protobuf/Mixin.php \ - php/src/Google/Protobuf/NullValue.php \ - php/src/Google/Protobuf/OneofDescriptor.php \ - php/src/Google/Protobuf/Option.php \ - php/src/Google/Protobuf/SourceContext.php \ - php/src/Google/Protobuf/StringValue.php \ - php/src/Google/Protobuf/Struct.php \ - php/src/Google/Protobuf/Syntax.php \ - php/src/Google/Protobuf/Timestamp.php \ - php/src/Google/Protobuf/Type.php \ - php/src/Google/Protobuf/UInt32Value.php \ - php/src/Google/Protobuf/UInt64Value.php \ - php/src/Google/Protobuf/Value.php \ - php/src/phpdoc.dist.xml \ - php/tests/ArrayTest.php \ - php/tests/compatibility_test.sh \ - php/tests/compile_extension.sh \ - php/tests/DescriptorsTest.php \ - php/tests/EncodeDecodeTest.php \ - php/tests/force_c_ext.php \ - php/tests/gdb_test.sh \ - php/tests/generated_previous/GPBMetadata/ProtoPrevious/TestPreviouslyUnreservedMessage.php \ - php/tests/generated_previous/Previous/readonly.php \ - php/tests/GeneratedClassTest.php \ - php/tests/GeneratedPhpdocTest.php \ - php/tests/GeneratedServiceTest.php \ - php/tests/MapFieldTest.php \ - php/tests/memory_leak_test.php \ - php/tests/memory_leak_test.sh \ - php/tests/multirequest.php \ - php/tests/multirequest.sh \ - php/tests/PhpImplementationTest.php \ - php/tests/PreviouslyGeneratedClassTest.php \ - php/tests/proto/empty/echo.proto \ - php/tests/proto/test.proto \ - php/tests/proto/test_descriptors.proto \ - php/tests/proto/test_empty_php_namespace.proto \ - php/tests/proto/test_import_descriptor_proto.proto \ - php/tests/proto/test_include.proto \ - php/tests/proto/test_no_namespace.proto \ - php/tests/proto/test_php_namespace.proto \ - php/tests/proto/test_prefix.proto \ - php/tests/proto/test_reserved_enum_lower.proto \ - php/tests/proto/test_reserved_enum_upper.proto \ - php/tests/proto/test_reserved_enum_value_lower.proto \ - php/tests/proto/test_reserved_enum_value_upper.proto \ - php/tests/proto/test_reserved_message_lower.proto \ - php/tests/proto/test_reserved_message_upper.proto \ - php/tests/proto/test_service.proto \ - php/tests/proto/test_service_namespace.proto \ - php/tests/proto/test_wrapper_type_setters.proto \ - php/tests/proto_previous/test_previously_unreserved_message.proto \ - php/tests/test_base.php \ - php/tests/test_util.php \ - php/tests/valgrind.supp \ - php/tests/WellKnownTest.php \ - php/tests/WrapperTypeSettersTest.php - -# Note: please keep this in sync with the python_dist_files rule in BUILD.bazel. -python_EXTRA_DIST= \ - python/BUILD.bazel \ - python/MANIFEST.in \ - python/google/__init__.py \ - python/google/protobuf/__init__.py \ - python/google/protobuf/compiler/__init__.py \ - python/google/protobuf/descriptor.py \ - python/google/protobuf/descriptor_database.py \ - python/google/protobuf/descriptor_pool.py \ - python/google/protobuf/internal/__init__.py \ - python/google/protobuf/internal/_parameterized.py \ - python/google/protobuf/internal/any_test.proto \ - python/google/protobuf/internal/any_test.proto \ - python/google/protobuf/internal/api_implementation.cc \ - python/google/protobuf/internal/api_implementation.py \ - python/google/protobuf/internal/builder.py \ - python/google/protobuf/internal/containers.py \ - python/google/protobuf/internal/decoder.py \ - python/google/protobuf/internal/descriptor_database_test.py \ - python/google/protobuf/internal/descriptor_pool_test.py \ - python/google/protobuf/internal/descriptor_pool_test1.proto \ - python/google/protobuf/internal/descriptor_pool_test2.proto \ - python/google/protobuf/internal/descriptor_test.py \ - python/google/protobuf/internal/encoder.py \ - python/google/protobuf/internal/enum_type_wrapper.py \ - python/google/protobuf/internal/extension_dict.py \ - python/google/protobuf/internal/factory_test1.proto \ - python/google/protobuf/internal/factory_test2.proto \ - python/google/protobuf/internal/file_options_test.proto \ - python/google/protobuf/internal/generator_test.py \ - python/google/protobuf/internal/import_test.py \ - python/google/protobuf/internal/import_test_package/__init__.py \ - python/google/protobuf/internal/import_test_package/import_public.proto \ - python/google/protobuf/internal/import_test_package/import_public_nested.proto \ - python/google/protobuf/internal/import_test_package/inner.proto \ - python/google/protobuf/internal/import_test_package/outer.proto \ - python/google/protobuf/internal/json_format_test.py \ - python/google/protobuf/internal/keywords_test.py \ - python/google/protobuf/internal/message_factory_test.py \ - python/google/protobuf/internal/message_listener.py \ - python/google/protobuf/internal/message_set_extensions.proto \ - python/google/protobuf/internal/message_test.py \ - python/google/protobuf/internal/missing_enum_values.proto \ - python/google/protobuf/internal/more_extensions.proto \ - python/google/protobuf/internal/more_extensions_dynamic.proto \ - python/google/protobuf/internal/more_messages.proto \ - python/google/protobuf/internal/no_package.proto \ - python/google/protobuf/internal/packed_field_test.proto \ - python/google/protobuf/internal/proto_builder_test.py \ - python/google/protobuf/internal/python_message.py \ - python/google/protobuf/internal/python_protobuf.cc \ - python/google/protobuf/internal/reflection_test.py \ - python/google/protobuf/internal/service_reflection_test.py \ - python/google/protobuf/internal/symbol_database_test.py \ - python/google/protobuf/internal/test_bad_identifiers.proto \ - python/google/protobuf/internal/test_proto3_optional.proto \ - python/google/protobuf/internal/test_util.py \ - python/google/protobuf/internal/testing_refleaks.py \ - python/google/protobuf/internal/text_encoding_test.py \ - python/google/protobuf/internal/text_format_test.py \ - python/google/protobuf/internal/type_checkers.py \ - python/google/protobuf/internal/unknown_fields_test.py \ - python/google/protobuf/internal/well_known_types.py \ - python/google/protobuf/internal/well_known_types.py \ - python/google/protobuf/internal/well_known_types_test.py \ - python/google/protobuf/internal/well_known_types_test.py \ - python/google/protobuf/internal/wire_format.py \ - python/google/protobuf/internal/wire_format_test.py \ - python/google/protobuf/json_format.py \ - python/google/protobuf/message.py \ - python/google/protobuf/message_factory.py \ - python/google/protobuf/proto_api.h \ - python/google/protobuf/proto_builder.py \ - python/google/protobuf/pyext/README \ - python/google/protobuf/pyext/__init__.py \ - python/google/protobuf/pyext/cpp_message.py \ - python/google/protobuf/pyext/descriptor.cc \ - python/google/protobuf/pyext/descriptor.h \ - python/google/protobuf/pyext/descriptor_containers.cc \ - python/google/protobuf/pyext/descriptor_containers.h \ - python/google/protobuf/pyext/descriptor_database.cc \ - python/google/protobuf/pyext/descriptor_database.h \ - python/google/protobuf/pyext/descriptor_pool.cc \ - python/google/protobuf/pyext/descriptor_pool.h \ - python/google/protobuf/pyext/extension_dict.cc \ - python/google/protobuf/pyext/extension_dict.h \ - python/google/protobuf/pyext/map_container.cc \ - python/google/protobuf/pyext/map_container.h \ - python/google/protobuf/pyext/message.cc \ - python/google/protobuf/pyext/message.h \ - python/google/protobuf/pyext/field.cc \ - python/google/protobuf/pyext/field.h \ - python/google/protobuf/pyext/unknown_fields.cc \ - python/google/protobuf/pyext/unknown_fields.h \ - python/google/protobuf/pyext/message_factory.cc \ - python/google/protobuf/pyext/message_factory.h \ - python/google/protobuf/pyext/message_module.cc \ - python/google/protobuf/pyext/proto2_api_test.proto \ - python/google/protobuf/pyext/python.proto \ - python/google/protobuf/pyext/repeated_composite_container.cc \ - python/google/protobuf/pyext/repeated_composite_container.h \ - python/google/protobuf/pyext/repeated_scalar_container.cc \ - python/google/protobuf/pyext/repeated_scalar_container.h \ - python/google/protobuf/pyext/safe_numerics.h \ - python/google/protobuf/pyext/scoped_pyobject_ptr.h \ - python/google/protobuf/pyext/unknown_field_set.cc \ - python/google/protobuf/pyext/unknown_field_set.h \ - python/google/protobuf/python_protobuf.h \ - python/google/protobuf/reflection.py \ - python/google/protobuf/service.py \ - python/google/protobuf/service_reflection.py \ - python/google/protobuf/symbol_database.py \ - python/google/protobuf/text_encoding.py \ - python/google/protobuf/text_format.py \ - python/google/protobuf/unknown_fields.py \ - python/google/protobuf/util/__init__.py \ - python/internal.bzl \ - python/release.sh \ - python/mox.py \ - python/setup.cfg \ - python/setup.py \ - python/stubout.py \ - python/tox.ini \ - python/README.md - -# Note: please keep this in sync with the dist_files rule in ruby/BUILD.bazel. -ruby_EXTRA_DIST= \ - ruby/Gemfile \ - ruby/.gitignore \ - ruby/README.md \ - ruby/Rakefile \ - ruby/compatibility_tests/v3.0.0/tests/test_import.proto \ - ruby/compatibility_tests/v3.0.0/tests/stress.rb \ - ruby/compatibility_tests/v3.0.0/tests/repeated_field_test.rb \ - ruby/compatibility_tests/v3.0.0/tests/generated_code_test.rb \ - ruby/compatibility_tests/v3.0.0/tests/generated_code.proto \ - ruby/compatibility_tests/v3.0.0/tests/basic.rb \ - ruby/compatibility_tests/v3.0.0/test.sh \ - ruby/compatibility_tests/v3.0.0/Rakefile \ - ruby/compatibility_tests/v3.0.0/README.md \ - ruby/ext/google/protobuf_c/convert.c \ - ruby/ext/google/protobuf_c/convert.h \ - ruby/ext/google/protobuf_c/defs.c \ - ruby/ext/google/protobuf_c/defs.h \ - ruby/ext/google/protobuf_c/extconf.rb \ - ruby/ext/google/protobuf_c/map.c \ - ruby/ext/google/protobuf_c/map.h \ - ruby/ext/google/protobuf_c/message.c \ - ruby/ext/google/protobuf_c/message.h \ - ruby/ext/google/protobuf_c/protobuf.c \ - ruby/ext/google/protobuf_c/protobuf.h \ - ruby/ext/google/protobuf_c/repeated_field.c \ - ruby/ext/google/protobuf_c/repeated_field.h \ - ruby/ext/google/protobuf_c/ruby-upb.c \ - ruby/ext/google/protobuf_c/ruby-upb.h \ - ruby/ext/google/protobuf_c/wrap_memcpy.c \ - ruby/google-protobuf.gemspec \ - ruby/lib/google/protobuf/descriptor_dsl.rb \ - ruby/lib/google/protobuf/message_exts.rb \ - ruby/lib/google/protobuf/repeated_field.rb \ - ruby/lib/google/protobuf/well_known_types.rb \ - ruby/lib/google/protobuf.rb \ - ruby/pom.xml \ - ruby/src/main/java/com/google/protobuf/jruby/RubyDescriptor.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyDescriptorPool.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyEnum.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyEnumDescriptor.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyFieldDescriptor.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyFileDescriptor.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyMap.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyOneofDescriptor.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyProtobuf.java \ - ruby/src/main/java/com/google/protobuf/jruby/RubyRepeatedField.java \ - ruby/src/main/java/com/google/protobuf/jruby/SentinelOuterClass.java \ - ruby/src/main/java/com/google/protobuf/jruby/Utils.java \ - ruby/src/main/java/google/ProtobufJavaService.java \ - ruby/src/main/sentinel.proto \ - ruby/tests/basic_proto2.rb \ - ruby/tests/basic_test_proto2.proto \ - ruby/tests/basic_test.proto \ - ruby/tests/basic.rb \ - ruby/tests/common_tests.rb \ - ruby/tests/encode_decode_test.rb \ - ruby/tests/gc_test.rb \ - ruby/tests/repeated_field_test.rb \ - ruby/tests/stress.rb \ - ruby/tests/generated_code_proto2_test.rb \ - ruby/tests/generated_code_proto2.proto \ - ruby/tests/generated_code.proto \ - ruby/tests/multi_level_nesting_test.proto \ - ruby/tests/multi_level_nesting_test.rb \ - ruby/tests/test_import_proto2.proto \ - ruby/tests/test_import.proto \ - ruby/tests/test_ruby_package_proto2.proto \ - ruby/tests/test_ruby_package.proto \ - ruby/tests/generated_code_test.rb \ - ruby/tests/well_known_types_test.rb \ - ruby/tests/type_errors.rb \ - ruby/travis-test.sh - -all_EXTRA_DIST=$(csharp_EXTRA_DIST) $(java_EXTRA_DIST) $(objectivec_EXTRA_DIST) $(php_EXTRA_DIST) $(python_EXTRA_DIST) $(ruby_EXTRA_DIST) - -# Note: please keep this in sync with the common_dist_files rule in BUILD.bazel. -EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \ - autogen.sh \ - generate_descriptor_proto.sh \ - README.md \ - LICENSE \ - CONTRIBUTORS.txt \ - CHANGES.txt \ - BUILD.bazel \ - WORKSPACE \ - CMakeLists.txt \ - build_defs/BUILD.bazel \ - build_defs/cc_proto_blacklist_test.bzl \ - build_defs/compiler_config_setting.bzl \ - build_defs/cpp_opts.bzl \ - cmake/CMakeLists.txt \ - cmake/README.md \ - cmake/conformance.cmake \ - cmake/examples.cmake \ - cmake/install.cmake \ - cmake/libprotobuf-lite.cmake \ - cmake/libprotobuf.cmake \ - cmake/libprotoc.cmake \ - cmake/protobuf-config-version.cmake.in \ - cmake/protobuf-config.cmake.in \ - cmake/protobuf-lite.pc.cmake \ - cmake/protobuf-module.cmake.in \ - cmake/protobuf-options.cmake \ - cmake/protobuf.pc.cmake \ - cmake/protoc.cmake \ - cmake/update_file_lists.sh \ - cmake/tests.cmake \ - cmake/version.rc.in \ - csharp/BUILD.bazel \ - editors/README.txt \ - editors/proto.vim \ - editors/protobuf-mode.el \ - examples/AddPerson.java \ - examples/BUILD.bazel \ - examples/CMakeLists.txt \ - examples/ListPeople.java \ - examples/Makefile \ - examples/README.md \ - examples/WORKSPACE \ - examples/add_person.cc \ - examples/add_person.dart \ - examples/add_person.py \ - examples/addressbook.proto \ - examples/go/cmd/add_person/add_person.go \ - examples/go/cmd/add_person/add_person_test.go \ - examples/go/cmd/list_people/list_people.go \ - examples/go/cmd/list_people/list_people_test.go \ - examples/go/go.sum \ - examples/go/go.mod \ - examples/list_people.cc \ - examples/list_people.dart \ - examples/list_people.py \ - examples/pubspec.yaml \ - conformance/BUILD.bazel \ - conformance/defs.bzl \ - maven_install.json \ - php/BUILD.bazel \ - protobuf.bzl \ - protobuf_deps.bzl \ - protobuf_release.bzl \ - protobuf_version.bzl \ - ruby/BUILD.bazel \ - third_party/zlib.BUILD \ - util/python/BUILD.bazel - -# Deletes all the files generated by autogen.sh. -MAINTAINERCLEANFILES = \ - aclocal.m4 \ - ar-lib \ - config.guess \ - config.sub \ - configure \ - depcomp \ - install-sh \ - ltmain.sh \ - Makefile.in \ - missing \ - mkinstalldirs \ - config.h.in \ - stamp.h.in \ - m4/ltsugar.m4 \ - m4/libtool.m4 \ - m4/ltversion.m4 \ - m4/lt~obsolete.m4 \ - m4/ltoptions.m4 diff --git a/README.md b/README.md index ae631588a7..ad2b4d34a0 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,7 @@ to use the github main version at HEAD, or you need to modify protobuf code, or you are using C++, it's recommended to build your own protoc binary from source. -If you would like to build protoc binary from source, see the [C++ Installation -Instructions](src/README.md). +If you would like to build protoc binary from source, see the [C++ Installation Instructions](src/README.md). Protobuf Runtime Installation ----------------------------- diff --git a/WORKSPACE b/WORKSPACE index d01122a90a..ebe53315f0 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -30,11 +30,6 @@ http_archive( load("//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS", "protobuf_deps") protobuf_deps() -bind( - name = "python_headers", - actual = "//util/python:python_headers", -) - load("@rules_jvm_external//:defs.bzl", "maven_install") maven_install( @@ -69,3 +64,11 @@ kt_register_toolchains() load("@upb//bazel:workspace_deps.bzl", "upb_deps") upb_deps() + +load("@upb//bazel:system_python.bzl", "system_python") +system_python(name = "local_config_python") + +bind( + name = "python_headers", + actual = "@local_config_python//:python_headers", +) diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 105bf09b67..0000000000 --- a/autogen.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh - -# Run this script to generate the configure script and other files that will -# be included in the distribution. These files are not checked in because they -# are automatically generated. - -set -e - -if [ ! -z "$@" ]; then - for argument in "$@"; do - case $argument in - # make curl silent - "-s") - curlopts="-s" - ;; - esac - done -fi - -# Check that we're being run from the right directory. -if test ! -f src/google/protobuf/stubs/common.h; then - cat >&2 << __EOF__ -Could not find source code. Make sure you are running this script from the -root of the distribution tree. -__EOF__ - exit 1 -fi - -set -ex - -# The absence of a m4 directory in googletest causes autoreconf to fail when -# building under the CentOS docker image. It's a warning in regular build on -# Ubuntu/gLinux as well. (This is only needed if git submodules have been -# initialized, which is typically only needed for testing; see the installation -# instructions for details.) -if test -d third_party/googletest; then - mkdir -p third_party/googletest/m4 -fi - -# TODO(kenton): Remove the ",no-obsolete" part and fix the resulting warnings. -autoreconf -f -i -Wall,no-obsolete - -rm -rf autom4te.cache config.h.in~ -exit 0 diff --git a/benchmarks/BUILD.bazel b/benchmarks/BUILD.bazel index cd80ca69e1..46c908bd69 100644 --- a/benchmarks/BUILD.bazel +++ b/benchmarks/BUILD.bazel @@ -2,6 +2,11 @@ load("@rules_cc//cc:defs.bzl", "cc_proto_library") load("@rules_java//java:defs.bzl", "java_proto_library") load("@rules_pkg//:mappings.bzl", "pkg_filegroup", "pkg_files", "strip_prefix") load("@rules_proto//proto:defs.bzl", "proto_library") +load("//:protobuf.bzl", "internal_py_proto_library", "internal_php_proto_library") + +################################################################################ +# Benchmark Protos +################################################################################ proto_library( name = "benchmarks_proto", @@ -34,6 +39,26 @@ java_proto_library( ], ) +internal_php_proto_library( + name = "benchmarks_php_proto", + srcs = ["benchmarks.proto"], + outs = [ + "Benchmarks/BenchmarkDataset.php", + "GPBMetadata/Benchmarks.php", + ], + visibility = [ + "//benchmarks:__subpackages__", + ], +) + +internal_py_proto_library( + name = "benchmarks_py_proto", + srcs = ["benchmarks.proto"], + visibility = [ + "//benchmarks:__subpackages__", + ], +) + proto_library( name = "google_size_proto", srcs = [ @@ -65,19 +90,13 @@ java_proto_library( ], ) +################################################################################ +# Distribution files +################################################################################ + pkg_files( name = "dist_files", - srcs = glob( - [ - "*", - "python/*.cc", - "util/*.cc", - ], - exclude = [ - "__init__.py", # not in autotools dist - "go/*", - ], - ), + srcs = glob(["*"]), strip_prefix = strip_prefix.from_root(""), ) @@ -93,6 +112,10 @@ pkg_filegroup( "//benchmarks/datasets/google_message2:dist_files", "//benchmarks/datasets/google_message3:dist_files", "//benchmarks/datasets/google_message4:dist_files", + "//benchmarks/java:dist_files", + "//benchmarks/php:dist_files", + "//benchmarks/python:dist_files", + "//benchmarks/util:dist_files", ], visibility = ["//pkg:__pkg__"], ) diff --git a/benchmarks/Makefile.am b/benchmarks/Makefile.am deleted file mode 100644 index 3ab35e37ca..0000000000 --- a/benchmarks/Makefile.am +++ /dev/null @@ -1,664 +0,0 @@ -benchmarks_protoc_inputs_benchmark_wrapper = \ - benchmarks.proto - -benchmarks_protoc_inputs = \ - datasets/google_message1/proto3/benchmark_message1_proto3.proto - -benchmarks_protoc_inputs_proto2 = \ - datasets/google_message1/proto2/benchmark_message1_proto2.proto \ - datasets/google_message2/benchmark_message2.proto \ - datasets/google_message3/benchmark_message3.proto \ - datasets/google_message3/benchmark_message3_1.proto \ - datasets/google_message3/benchmark_message3_2.proto \ - datasets/google_message3/benchmark_message3_3.proto \ - datasets/google_message3/benchmark_message3_4.proto \ - datasets/google_message3/benchmark_message3_5.proto \ - datasets/google_message3/benchmark_message3_6.proto \ - datasets/google_message3/benchmark_message3_7.proto \ - datasets/google_message3/benchmark_message3_8.proto \ - datasets/google_message4/benchmark_message4.proto \ - datasets/google_message4/benchmark_message4_1.proto \ - datasets/google_message4/benchmark_message4_2.proto \ - datasets/google_message4/benchmark_message4_3.proto - -make_tmp_dir: - mkdir -p 'tmp/java/src/main/java' - touch make_tmp_dir - - -# We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is -# relative to srcdir, which may not be the same as the current directory when -# building out-of-tree. -protoc_middleman: make_tmp_dir $(top_srcdir)/src/protoc$(EXEEXT) $(benchmarks_protoc_inputs) $(well_known_type_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) - oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd/cpp --java_out=$$oldpwd/tmp/java/src/main/java --python_out=$$oldpwd/tmp $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) ) - touch protoc_middleman - -protoc_middleman2: make_tmp_dir $(top_srcdir)/src/protoc$(EXEEXT) $(benchmarks_protoc_inputs_proto2) $(well_known_type_protoc_inputs) - oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd/cpp --java_out=$$oldpwd/tmp/java/src/main/java --python_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2) ) - touch protoc_middleman2 - -all_data = $$(find $$(cd $(srcdir) && pwd) -type f -name "dataset.*.pb" -not -path "$$(cd $(srcdir) && pwd)/tmp/*") - -############# CPP RULES ############## - -benchmarks_protoc_outputs = \ - cpp/benchmarks.pb.cc \ - cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc - -benchmarks_protoc_outputs_header = \ - cpp/benchmarks.pb.h \ - cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.h - -benchmarks_protoc_outputs_proto2_header = \ - cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.h \ - cpp/datasets/google_message2/benchmark_message2.pb.h \ - cpp/datasets/google_message3/benchmark_message3.pb.h \ - cpp/datasets/google_message3/benchmark_message3_1.pb.h \ - cpp/datasets/google_message3/benchmark_message3_2.pb.h \ - cpp/datasets/google_message3/benchmark_message3_3.pb.h \ - cpp/datasets/google_message3/benchmark_message3_4.pb.h \ - cpp/datasets/google_message3/benchmark_message3_5.pb.h \ - cpp/datasets/google_message3/benchmark_message3_6.pb.h \ - cpp/datasets/google_message3/benchmark_message3_7.pb.h \ - cpp/datasets/google_message3/benchmark_message3_8.pb.h \ - cpp/datasets/google_message4/benchmark_message4.pb.h \ - cpp/datasets/google_message4/benchmark_message4_1.pb.h \ - cpp/datasets/google_message4/benchmark_message4_2.pb.h \ - cpp/datasets/google_message4/benchmark_message4_3.pb.h - -benchmarks_protoc_outputs_proto2 = \ - cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc \ - cpp/datasets/google_message2/benchmark_message2.pb.cc \ - cpp/datasets/google_message3/benchmark_message3.pb.cc \ - cpp/datasets/google_message3/benchmark_message3_1.pb.cc \ - cpp/datasets/google_message3/benchmark_message3_2.pb.cc \ - cpp/datasets/google_message3/benchmark_message3_3.pb.cc \ - cpp/datasets/google_message3/benchmark_message3_4.pb.cc \ - cpp/datasets/google_message3/benchmark_message3_5.pb.cc \ - cpp/datasets/google_message3/benchmark_message3_6.pb.cc \ - cpp/datasets/google_message3/benchmark_message3_7.pb.cc \ - cpp/datasets/google_message3/benchmark_message3_8.pb.cc \ - cpp/datasets/google_message4/benchmark_message4.pb.cc \ - cpp/datasets/google_message4/benchmark_message4_1.pb.cc \ - cpp/datasets/google_message4/benchmark_message4_2.pb.cc \ - cpp/datasets/google_message4/benchmark_message4_3.pb.cc - - -$(benchmarks_protoc_outputs): protoc_middleman -$(benchmarks_protoc_outputs_header): protoc_middleman -$(benchmarks_protoc_outputs_proto2): protoc_middleman2 -$(benchmarks_protoc_outputs_proto2_header): protoc_middleman2 - -initialize_submodule: - oldpwd=`pwd` - cd $(top_srcdir) && git submodule update --init -r third_party/benchmark && \ - cd third_party/benchmark && cmake -DCMAKE_BUILD_TYPE=Release && make - cd $$oldpwd - touch initialize_submodule - -$(top_srcdir)/third_party/benchmark/src/libbenchmark.a: initialize_submodule - -AM_CXXFLAGS = $(NO_OPT_CXXFLAGS) $(PROTOBUF_OPT_FLAG) -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare - -bin_PROGRAMS = cpp-benchmark - -cpp_benchmark_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a -cpp_benchmark_SOURCES = cpp/cpp_benchmark.cc -cpp_benchmark_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(top_srcdir)/third_party/benchmark/include -# Explicit deps because BUILT_SOURCES are only done before a "make all/check" -# so a direct "make test_cpp" could fail if parallel enough. -# See: https://www.gnu.org/software/automake/manual/html_node/Built-Sources-Example.html#Recording-Dependencies-manually -cpp/cpp_benchmark-cpp_benchmark.$(OBJEXT): $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2) $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header) $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a -cpp/benchmark-cpp_benchmark.$(OBJEXT): $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2) $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header) $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a -nodist_cpp_benchmark_SOURCES = \ - $(benchmarks_protoc_outputs) \ - $(benchmarks_protoc_outputs_proto2) \ - $(benchmarks_protoc_outputs_proto2_header) \ - $(benchmarks_protoc_outputs_header) - -cpp: protoc_middleman protoc_middleman2 cpp-benchmark initialize_submodule - ./cpp-benchmark $(all_data) - -############ CPP RULES END ############ - -############# JAVA RULES ############## - -java_benchmark_testing_files = \ - java/src/main/java/com/google/protobuf/ProtoCaliperBenchmark.java - -javac_middleman: $(java_benchmark_testing_files) protoc_middleman protoc_middleman2 - cp -r $(srcdir)/java tmp - mkdir -p tmp/java/lib - cp $(top_srcdir)/java/core/target/*.jar tmp/java/lib/protobuf-java.jar - cd tmp/java && mvn clean compile assembly:single -Dprotobuf.version=$(PACKAGE_VERSION) && cd ../.. - @touch javac_middleman - -java-benchmark: javac_middleman - @echo "Writing shortcut script java-benchmark..." - @echo '#! /bin/bash' > java-benchmark - @echo 'all_data=""' >> java-benchmark - @echo 'conf=()' >> java-benchmark - @echo 'data_files=""' >> java-benchmark - @echo 'for arg in $$@; do if [[ $${arg:0:1} == "-" ]]; then conf+=($$arg); else data_files+="$$arg,"; fi; done' >> java-benchmark - @echo 'java -cp '\"tmp/java/target/*:$(top_srcdir)/java/core/target/*:$(top_srcdir)/java/util/target/*\"" \\" >>java-benchmark - @echo ' com.google.caliper.runner.CaliperMain com.google.protobuf.ProtoCaliperBenchmark -i runtime '"\\" >> java-benchmark - @echo ' -b serializeToByteArray,serializeToMemoryStream,deserializeFromByteArray,deserializeFromMemoryStream '"\\" >> java-benchmark - @echo ' -DdataFile=$${data_files:0:-1} $${conf[*]}' >> java-benchmark - @chmod +x java-benchmark - -java: protoc_middleman protoc_middleman2 java-benchmark - ./java-benchmark $(all_data) - -############# JAVA RULES END ############## - - -############# PYTHON RULES ############## - -python_add_init: protoc_middleman protoc_middleman2 - all_file=`find tmp -type f -regex '.*\.py'` && \ - for file in $${all_file[@]}; do \ - path="$${file%/*}"; \ - while true; do \ - touch "$$path/__init__.py" && chmod +x "$$path/__init__.py"; \ - if [[ $$path != *"/"* ]]; then break; fi; \ - path=$${path%/*}; \ - done \ - done - -python_cpp_pkg_flags = `pkg-config --cflags --libs python3` - -lib_LTLIBRARIES = libbenchmark_messages.la -libbenchmark_messages_la_SOURCES = python/python_benchmark_messages.cc -libbenchmark_messages_la_LIBADD = $(top_srcdir)/src/.libs/libprotobuf.la -libbenchmark_messages_la_LDFLAGS = -version-info 1:0:0 -export-dynamic -libbenchmark_messages_la_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp $(python_cpp_pkg_flags) -libbenchmark_messages_la-python_benchmark_messages.$(OBJEXT): $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header) $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2) -nodist_libbenchmark_messages_la_SOURCES = \ - $(benchmarks_protoc_outputs) \ - $(benchmarks_protoc_outputs_proto2) \ - $(benchmarks_protoc_outputs_proto2_header) \ - $(benchmarks_protoc_outputs_header) - -python-pure-python-benchmark: python_add_init - @echo "Writing shortcut script python-pure-python-benchmark..." - @echo '#! /bin/bash' > python-pure-python-benchmark - @echo export LD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-pure-python-benchmark - @echo export DYLD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-pure-python-benchmark - @echo export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=\'python\' >> python-pure-python-benchmark - @echo cp $(srcdir)/python/py_benchmark.py tmp >> python-pure-python-benchmark - @echo python3 tmp/py_benchmark.py '$$@' >> python-pure-python-benchmark - @chmod +x python-pure-python-benchmark - -python-cpp-reflection-benchmark: python_add_init - @echo "Writing shortcut script python-cpp-reflection-benchmark..." - @echo '#! /bin/bash' > python-cpp-reflection-benchmark - @echo export LD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-cpp-reflection-benchmark - @echo export DYLD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-cpp-reflection-benchmark - @echo export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=\'cpp\' >> python-cpp-reflection-benchmark - @echo cp $(srcdir)/python/py_benchmark.py tmp >> python-cpp-reflection-benchmark - @echo python3 tmp/py_benchmark.py '$$@' >> python-cpp-reflection-benchmark - @chmod +x python-cpp-reflection-benchmark - -python-cpp-generated-code-benchmark: python_add_init libbenchmark_messages.la - @echo "Writing shortcut script python-cpp-generated-code-benchmark..." - @echo '#! /bin/bash' > python-cpp-generated-code-benchmark - @echo export LD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-cpp-generated-code-benchmark - @echo export DYLD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-cpp-generated-code-benchmark - @echo export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=\'cpp\' >> python-cpp-generated-code-benchmark - @echo cp $(srcdir)/python/py_benchmark.py tmp >> python-cpp-generated-code-benchmark - @echo python3 tmp/py_benchmark.py --cpp_generated '$$@' >> python-cpp-generated-code-benchmark - @chmod +x python-cpp-generated-code-benchmark - -python-pure-python: python-pure-python-benchmark - ./python-pure-python-benchmark $(all_data) - -python-cpp-reflection: python-cpp-reflection-benchmark - ./python-cpp-reflection-benchmark $(all_data) - -python-cpp-generated-code: python-cpp-generated-code-benchmark - ./python-cpp-generated-code-benchmark $(all_data) - -############# PYTHON RULES END ############## - -############# GO RULES BEGIN ############## - -benchmarks_protoc_inputs_proto2_message1 = \ - datasets/google_message1/proto2/benchmark_message1_proto2.proto - -benchmarks_protoc_inputs_proto2_message2 = \ - datasets/google_message2/benchmark_message2.proto - -benchmarks_protoc_inputs_proto2_message3 = \ - datasets/google_message3/benchmark_message3.proto \ - datasets/google_message3/benchmark_message3_1.proto \ - datasets/google_message3/benchmark_message3_2.proto \ - datasets/google_message3/benchmark_message3_3.proto \ - datasets/google_message3/benchmark_message3_4.proto \ - datasets/google_message3/benchmark_message3_5.proto \ - datasets/google_message3/benchmark_message3_6.proto \ - datasets/google_message3/benchmark_message3_7.proto \ - datasets/google_message3/benchmark_message3_8.proto - -benchmarks_protoc_inputs_proto2_message4 = \ - datasets/google_message4/benchmark_message4.proto \ - datasets/google_message4/benchmark_message4_1.proto \ - datasets/google_message4/benchmark_message4_2.proto \ - datasets/google_message4/benchmark_message4_3.proto - -go_protoc_middleman: make_tmp_dir $(top_srcdir)/src/protoc$(EXEEXT) $(benchmarks_protoc_inputs) $(well_known_type_protoc_inputs) $(benchmarks_protoc_inputs_proto2_message1) $(benchmarks_protoc_inputs_proto2_message2) $(benchmarks_protoc_inputs_proto2_message3) $(benchmarks_protoc_inputs_proto2_message4) $(well_known_type_protoc_inputs) - oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs) ) - oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_benchmark_wrapper) ) - oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2_message1) ) - oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2_message2) ) - oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2_message3) ) - oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2_message4) ) - touch go_protoc_middleman - -go-benchmark: go_protoc_middleman - @echo "Writing shortcut script go-benchmark..." - @echo '#! /bin/bash' > go-benchmark - @echo 'cd $(srcdir)/go' >> go-benchmark - @echo 'all_data=""' >> go-benchmark - @echo 'conf=()' >> go-benchmark - @echo 'data_files=()' >> go-benchmark - @echo 'for arg in $$@; do if [[ $${arg:0:1} == "-" ]]; then conf+=($$arg); else data_files+=("$$arg"); fi; done' >> go-benchmark - @echo 'go test -bench=. $${conf[*]} -- $${data_files[*]}' >> go-benchmark - @echo 'cd ..' >> go-benchmark - @chmod +x go-benchmark - -go: go_protoc_middleman go-benchmark - ./go-benchmark $(all_data) - -############# GO RULES END ############## - -############# GOGO RULES BEGIN ############ - -cpp_no_group_benchmarks_protoc_outputs_header = \ - gogo/cpp_no_group/benchmarks.pb.h \ - gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.h - -cpp_no_group_benchmarks_protoc_outputs = \ - gogo/cpp_no_group/benchmarks.pb.cc \ - gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc - -cpp_no_group_benchmarks_protoc_outputs_proto2_header = \ - gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.h \ - gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.h \ - gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.h \ - gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.h \ - gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.h \ - gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.h \ - gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.h \ - gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.h \ - gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.h \ - gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.h \ - gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.h \ - gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.h \ - gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.h \ - gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.h \ - gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.h - -cpp_no_group_benchmarks_protoc_outputs_proto2 = \ - gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc \ - gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.cc \ - gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.cc \ - gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.cc \ - gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.cc \ - gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.cc \ - gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.cc \ - gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.cc \ - gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.cc \ - gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.cc \ - gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.cc \ - gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.cc \ - gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.cc \ - gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.cc \ - gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.cc - -$(cpp_no_group_benchmarks_protoc_outputs): cpp_no_group_protoc_middleman -$(cpp_no_group_benchmarks_protoc_outputs_header): cpp_no_group_protoc_middleman -$(cpp_no_group_benchmarks_protoc_outputs_proto2): cpp_no_group_protoc_middleman -$(cpp_no_group_benchmarks_protoc_outputs_proto2_header): cpp_no_group_protoc_middleman - -generate_cpp_no_group_benchmark_code: - cp $(srcdir)/cpp/cpp_benchmark.cc gogo/cpp_no_group/cpp_benchmark.cc - sed -i -e "s/\#include \"datasets/\#include \"gogo\/cpp_no_group\/datasets/g" gogo/cpp_no_group/cpp_benchmark.cc - sed -i -e "s/\#include \"benchmarks.pb.h/\#include \"gogo\/cpp_no_group\/benchmarks.pb.h/g" gogo/cpp_no_group/cpp_benchmark.cc - touch generate_cpp_no_group_benchmark_code - -bin_PROGRAMS += cpp-no-group-benchmark -cpp_no_group_benchmark_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a -cpp_no_group_benchmark_SOURCES = gogo/cpp_no_group/cpp_benchmark.cc -cpp_no_group_benchmark_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/gogo/cpp_no_group -I$(top_srcdir)/third_party/benchmark/include -# Explicit deps because BUILT_SOURCES are only done before a "make all/check" -# so a direct "make test_cpp" could fail if parallel enough. -# See: https://www.gnu.org/software/automake/manual/html_node/Built-Sources-Example.html#Recording-Dependencies-manually -gogo/cpp_no_group/cpp_no_group_benchmark-cpp_benchmark.$(OBJEXT): $(cpp_no_group_benchmarks_protoc_outputs) $(cpp_no_group_benchmarks_protoc_outputs_proto2) $(cpp_no_group_benchmarks_protoc_outputs_header) \ - $(cpp_no_group_benchmarks_protoc_outputs_proto2_header) $(top_srcdir)/third_party/benchmark/src/libbenchmark.a generate_cpp_no_group_benchmark_code -gogo/cpp_no_group/cpp_benchmark.cc: generate_cpp_no_group_benchmark_code -nodist_cpp_no_group_benchmark_SOURCES = \ - $(cpp_no_group_benchmarks_protoc_outputs_proto2) \ - $(cpp_no_group_benchmarks_protoc_outputs) \ - $(cpp_no_group_benchmarks_protoc_outputs_header) \ - $(cpp_no_group_benchmarks_protoc_outputs_proto2_header) - -cpp_no_group: cpp_no_group_protoc_middleman generate_gogo_data cpp-no-group-benchmark - ./cpp-no-group-benchmark $(gogo_data) - -gogo_proto_middleman: protoc-gen-gogoproto - mkdir -p "tmp/gogo_proto" - oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I$(srcdir) -I$(top_srcdir) --plugin=protoc-gen-gogoproto --gogoproto_out=$$oldpwd/tmp/gogo_proto $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2) ) - touch gogo_proto_middleman - -gogo_data = $$(for data in $(all_data); do echo "tmp/gogo_data$${data\#$(srcdir)}"; done | xargs) - -generate_gogo_data: protoc_middleman protoc_middleman2 gogo-data-scrubber - mkdir -p `dirname $(gogo_data)` - ./gogo-data-scrubber $(all_data) $(gogo_data) - touch generate_gogo_data - -make_tmp_dir_gogo: - mkdir -p tmp/go_no_group/benchmark_code - mkdir -p tmp/gogofast/benchmark_code - mkdir -p tmp/gogofaster/benchmark_code - mkdir -p tmp/gogoslick/benchmark_code - touch make_tmp_dir_gogo - -go_no_group_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_benchmark_wrapper) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_proto2_message1) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_proto2_message2) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_proto2_message3) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_proto2_message4) ) - touch go_no_group_protoc_middleman - -cpp_no_group_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_benchmark_wrapper) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_proto2_message1) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_proto2_message2) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_proto2_message3) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_proto2_message4) ) - touch cpp_no_group_protoc_middleman - -gogofast_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_benchmark_wrapper) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_proto2_message1) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_proto2_message2) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_proto2_message3) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_proto2_message4) ) - touch gogofast_protoc_middleman - -gogofaster_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_benchmark_wrapper) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_proto2_message1) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_proto2_message2) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_proto2_message3) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_proto2_message4) ) - touch gogofaster_protoc_middleman - -gogoslick_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_benchmark_wrapper) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_proto2_message1) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_proto2_message2) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_proto2_message3) ) - oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_proto2_message4) ) - touch gogoslick_protoc_middleman - -generate-gogo-benchmark-code: - @echo '#! /bin/bash' > generate-gogo-benchmark-code - @echo 'cp $(srcdir)/go/go_benchmark_test.go tmp/$$1/benchmark_code/$$1_benchmark1_test.go' >> generate-gogo-benchmark-code - @echo 'sed -i -e "s/\.\.\/tmp/../g" tmp/$$1/benchmark_code/$$1_benchmark1_test.go' >> generate-gogo-benchmark-code - @echo 'sed -i -e "s/b\.Run(\"\(.*\)\"/b.Run(\"\1\_$$1\"/g" tmp/$$1/benchmark_code/$$1_benchmark1_test.go' >> generate-gogo-benchmark-code - @echo 'if [[ $$2 == 1 ]]; then sed -i -e "s/github\.com\/golang/github.com\/gogo/g" tmp/$$1/benchmark_code/$$1_benchmark1_test.go; fi ' >> generate-gogo-benchmark-code - @chmod +x generate-gogo-benchmark-code - -generate_all_gogo_benchmark_code: generate-gogo-benchmark-code make_tmp_dir_gogo - ./generate-gogo-benchmark-code go_no_group 0 - ./generate-gogo-benchmark-code gogofast 1 - ./generate-gogo-benchmark-code gogofaster 1 - ./generate-gogo-benchmark-code gogoslick 1 - -gogo-benchmark: - @echo "Writing shortcut script gogo-benchmark..." - @echo '#! /bin/bash' > gogo-benchmark - @echo 'cd tmp/$$1/benchmark_code' >> gogo-benchmark - @echo 'shift' >> gogo-benchmark - @echo 'all_data=""' >> gogo-benchmark - @echo 'for data_file in $$@; do all_data="$$all_data ../../../$$data_file"; done' >> gogo-benchmark - @echo 'go test -bench=. -- $$all_data' >> gogo-benchmark - @echo 'cd ../..' >> gogo-benchmark - @chmod +x gogo-benchmark - -go_no_group: go_no_group_protoc_middleman generate_gogo_data generate_all_gogo_benchmark_code gogo-benchmark - ./gogo-benchmark go_no_group $(gogo_data) - -gogofast: gogofast_protoc_middleman generate_gogo_data gogo-benchmark generate_all_gogo_benchmark_code - ./gogo-benchmark gogofast $(gogo_data) - -gogofaster: gogofaster_protoc_middleman generate_gogo_data gogo-benchmark generate_all_gogo_benchmark_code - ./gogo-benchmark gogofaster $(gogo_data) - -gogoslick: gogoslick_protoc_middleman generate_gogo_data gogo-benchmark generate_all_gogo_benchmark_code - ./gogo-benchmark gogoslick $(gogo_data) - - -############# GOGO RULES END ############ - - -############ UTIL RULES BEGIN ############ - -bin_PROGRAMS += protoc-gen-gogoproto gogo-data-scrubber protoc-gen-proto2_to_proto3 proto3-data-stripper - -protoc_gen_gogoproto_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/src/libprotoc.la -protoc_gen_gogoproto_SOURCES = util/protoc-gen-gogoproto.cc -protoc_gen_gogoproto_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(srcdir)/util - -gogo_data_scrubber_LDADD = $(top_srcdir)/src/libprotobuf.la -gogo_data_scrubber_SOURCES = util/gogo_data_scrubber.cc -gogo_data_scrubber_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(srcdir)/util -util/gogo_data_scrubber-gogo_data_scrubber.$(OBJEXT): $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2) $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header) -nodist_gogo_data_scrubber_SOURCES = \ - $(benchmarks_protoc_outputs) \ - $(benchmarks_protoc_outputs_proto2) \ - $(benchmarks_protoc_outputs_proto2_header) \ - $(benchmarks_protoc_outputs_header) - -protoc_gen_proto2_to_proto3_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/src/libprotoc.la -protoc_gen_proto2_to_proto3_SOURCES = util/protoc-gen-proto2_to_proto3.cc -protoc_gen_proto2_to_proto3_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(srcdir)/util - -proto3_data_stripper_LDADD = $(top_srcdir)/src/libprotobuf.la -proto3_data_stripper_SOURCES = util/proto3_data_stripper.cc -proto3_data_stripper_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(srcdir)/util -util/proto3_data_stripper-proto3_data_stripper.$(OBJEXT): $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2) $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header) -nodist_proto3_data_stripper_SOURCES = \ - $(benchmarks_protoc_outputs) \ - $(benchmarks_protoc_outputs_proto2) \ - $(benchmarks_protoc_outputs_proto2_header) \ - $(benchmarks_protoc_outputs_header) - - -############ UTIL RULES END ############ - -############ PROTO3 PREPARATION BEGIN ############# - -proto3_proto_middleman: protoc-gen-proto2_to_proto3 - mkdir -p "tmp/proto3_proto" - oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I$(srcdir) -I$(top_srcdir) --plugin=protoc-gen-proto2_to_proto3 --proto2_to_proto3_out=$$oldpwd/tmp/proto3_proto $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2) ) - touch proto3_proto_middleman - -full_srcdir = $$(cd $(srcdir) && pwd) -proto3_data = $$(for data in $(all_data); do echo $(full_srcdir)"/tmp/proto3_data$${data\#$(full_srcdir)}"; done | xargs) - -generate_proto3_data: protoc_middleman protoc_middleman2 proto3-data-stripper - mkdir -p `dirname $(proto3_data)` - ./proto3-data-stripper $(all_data) $(proto3_data) - touch generate_proto3_data - -############ PROTO3 PREPARATION END ############# - -############ PHP RULES BEGIN ################# - -proto3_middleman_php: proto3_proto_middleman - mkdir -p "tmp/php" - oldpwd=`pwd` && ( cd tmp/proto3_proto && $$oldpwd/../src/protoc$(EXEEXT) -I$(srcdir) -I$(top_srcdir) --php_out=$$oldpwd/tmp/php $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2) ) - touch proto3_middleman_php - -php-benchmark: proto3_middleman_php generate_proto3_data - mkdir -p "tmp/php/Google/Protobuf/Benchmark" && cp php/PhpBenchmark.php "tmp/php/Google/Protobuf/Benchmark" - cp php/autoload.php "tmp/php" - @echo "Writing shortcut script php-benchmark..." - @echo '#! /bin/bash' > php-benchmark - @echo 'export PROTOBUF_PHP_SRCDIR="$$(cd $(top_srcdir) && pwd)/php/src"' >> php-benchmark - @echo 'cd tmp/php' >> php-benchmark - @echo 'export CURRENT_DIR=$$(pwd)' >> php-benchmark - @echo 'php -d auto_prepend_file="autoload.php" -d include_path="$$(pwd)" Google/Protobuf/Benchmark/PhpBenchmark.php $$@' >> php-benchmark - @echo 'cd ../..' >> php-benchmark - @chmod +x php-benchmark - -php: php-benchmark proto3_middleman_php - ./php-benchmark --behavior_prefix="php" $(proto3_data) - -php_c_extension: - cd $(top_srcdir)/php/ext/google/protobuf && phpize && ./configure CFLAGS='-O3' && make -j8 - -php-c-benchmark: proto3_middleman_php generate_proto3_data php_c_extension php_c_extension - mkdir -p "tmp/php/Google/Protobuf/Benchmark" && cp php/PhpBenchmark.php "tmp/php/Google/Protobuf/Benchmark" - cp php/autoload.php "tmp/php" - @echo "Writing shortcut script php-c-benchmark..." - @echo '#! /bin/bash' > php-c-benchmark - @echo 'export PROTOBUF_PHP_SRCDIR="$$(cd $(top_srcdir) && pwd)/php/src"' >> php-c-benchmark - @echo 'export PROTOBUF_PHP_EXTDIR="$$PROTOBUF_PHP_SRCDIR/../ext/google/protobuf/modules"' >> php-c-benchmark - @echo 'cd tmp/php' >> php-c-benchmark - @echo 'export CURRENT_DIR=$$(pwd)' >> php-c-benchmark - @echo 'php -d auto_prepend_file="autoload.php" -d include_path="$$(pwd)" -d extension="$$PROTOBUF_PHP_EXTDIR/protobuf.so" Google/Protobuf/Benchmark/PhpBenchmark.php $$@' >> php-c-benchmark - @echo 'cd ../..' >> php-c-benchmark - @chmod +x php-c-benchmark - -php_c: php-c-benchmark proto3_middleman_php - ./php-c-benchmark --behavior_prefix="php_c" $(proto3_data) - - -############ PHP RULES END ################# - -############ protobuf.js RULE BEGIN ############# - -pbjs_preparation: - mkdir -p tmp/protobuf.js - cd tmp/protobuf.js && git clone https://github.com/dcodeIO/protobuf.js.git && \ - cd protobuf.js && npm install && npm run build - cd tmp/protobuf.js && npm install benchmark - cp protobuf.js/* tmp/protobuf.js - cp js/benchmark_suite.js tmp/protobuf.js - touch pbjs_preparation - -pbjs_middleman: pbjs_preparation - export OLDDIR=$$(pwd) && cd tmp/protobuf.js && node generate_pbjs_files.js --target static-module --include_path=$$OLDDIR -o generated_bundle_code.js $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2) - touch pbjs_middleman - -pbjs-benchmark: pbjs_middleman - @echo '#! /bin/bash' > pbjs-benchmark - @echo 'cd tmp/protobuf.js' >> pbjs-benchmark - @echo 'sed -i "s/protobufjs/.\/protobuf.js/g" generated_bundle_code.js' >> pbjs-benchmark - @echo 'env NODE_PATH=".:./node_modules:$$NODE_PATH" node protobufjs_benchmark.js $$@' >> pbjs-benchmark - @chmod +x pbjs-benchmark - -pbjs: pbjs-benchmark - ./pbjs-benchmark $(all_data) - -############ protobuf.js RULE END ############# - -############ JS RULE BEGIN ############# - -js_preparation: - mkdir -p tmp/js - oldpwd=$$(pwd) && cd $(top_srcdir)/js && npm install && npm test - cd tmp/js && npm install benchmark - cp js/* tmp/js - touch js_preparation - -js_middleman: js_preparation - oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --js_out=import_style=commonjs,binary:$$oldpwd/tmp/js $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2)) - touch js_middleman - -js-benchmark: js_middleman - @echo '#! /bin/bash' > js-benchmark - @echo 'export TOP_JS_SRCDIR=$$(cd $(top_srcdir)/js && pwd)' >> js-benchmark - @echo 'cd tmp/js' >> js-benchmark - @echo 'env NODE_PATH="$$TOP_JS_SRCDIR:.:./node_modules:$$NODE_PATH" node --max-old-space-size=4096 js_benchmark.js $$@' >> js-benchmark - @chmod +x js-benchmark - -js: js-benchmark - ./js-benchmark $(all_data) - -############ JS RULE END ############# - -EXTRA_DIST = \ - $(benchmarks_protoc_inputs_benchmark_wrapper) \ - $(benchmarks_protoc_inputs) \ - $(benchmarks_protoc_inputs_proto2) \ - google_size.proto - -MAINTAINERCLEANFILES = \ - Makefile.in - -CLEANFILES = \ - $(benchmarks_protoc_outputs) \ - $(benchmarks_protoc_outputs_header) \ - $(benchmarks_protoc_outputs_proto2) \ - $(benchmarks_protoc_outputs_proto2_header) \ - initialize_submodule \ - make_tmp_dir \ - protoc_middleman \ - protoc_middleman2 \ - javac_middleman \ - java-benchmark \ - python_cpp_proto_library \ - python-pure-python-benchmark \ - python-cpp-reflection-benchmark \ - python-cpp-generated-code-benchmark \ - go-benchmark \ - go_protoc_middleman \ - make_tmp_dir_gogo \ - gogo_proto_middleman \ - generate_gogo_data \ - go_no_group_protoc_middleman \ - go_no_group \ - go-no-group-benchmark \ - $(cpp_no_group_benchmarks_protoc_outputs_header) \ - $(cpp_no_group_benchmarks_protoc_outputs) \ - $(cpp_no_group_benchmarks_protoc_outputs_proto2_header) \ - $(cpp_no_group_benchmarks_protoc_outputs_proto2) \ - generate_all_gogo_benchmark_code \ - generate-gogo-benchmark-code \ - cpp_no_group_protoc_middleman \ - generate_cpp_no_group_benchmark_code \ - generate_gogo_benchmark_code \ - gogofast_protoc_middleman \ - gogofast \ - gogofaster_protoc_middleman \ - gogofaster \ - gogoslick_protoc_middleman \ - gogoslick \ - gogo-benchmark \ - gogo/cpp_no_group/cpp_benchmark.* \ - proto3_proto_middleman \ - generate_proto3_data \ - php-benchmark \ - php-c-benchmark \ - proto3_middleman_php \ - pbjs_preparation \ - pbjs_middleman \ - pbjs-benchmark \ - js_preparation \ - js_middleman \ - js-benchmark - -clean-local: - -rm -rf tmp/* - diff --git a/benchmarks/cpp/BUILD.bazel b/benchmarks/cpp/BUILD.bazel index 7a3d3ba63e..72100e600e 100644 --- a/benchmarks/cpp/BUILD.bazel +++ b/benchmarks/cpp/BUILD.bazel @@ -1,12 +1,13 @@ load("@rules_cc//cc:defs.bzl", "cc_binary") load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") +load("//benchmarks:internal.bzl", "internal_benchmark_test") +# The benchmark binary which can be run over any dataset. cc_binary( - name = "cpp", + name = "cpp_benchmark", srcs = [ "cpp_benchmark.cc", ], - tags = ["benchmark"], deps = [ "//:protobuf", "//benchmarks:benchmarks_cc_proto", @@ -15,6 +16,15 @@ cc_binary( ], ) +# A pre-configured binary using the checked in datasets. +internal_benchmark_test( + name = "cpp", + binary = ":cpp_benchmark", + datasets = [ + "//benchmarks/datasets", + ], +) + pkg_files( name = "dist_files", srcs = [ diff --git a/benchmarks/cpp/cpp_benchmark.cc b/benchmarks/cpp/cpp_benchmark.cc index 036d234fb7..0cfb9169e1 100644 --- a/benchmarks/cpp/cpp_benchmark.cc +++ b/benchmarks/cpp/cpp_benchmark.cc @@ -32,11 +32,11 @@ #include #include "benchmark/benchmark.h" #include "benchmarks.pb.h" -#include "datasets/google_message1/proto2/benchmark_message1_proto2.pb.h" -#include "datasets/google_message1/proto3/benchmark_message1_proto3.pb.h" -#include "datasets/google_message2/benchmark_message2.pb.h" -#include "datasets/google_message3/benchmark_message3.pb.h" -#include "datasets/google_message4/benchmark_message4.pb.h" +#include "benchmarks/datasets/google_message1/proto2/benchmark_message1_proto2.pb.h" +#include "benchmarks/datasets/google_message1/proto3/benchmark_message1_proto3.pb.h" +#include "benchmarks/datasets/google_message2/benchmark_message2.pb.h" +#include "benchmarks/datasets/google_message3/benchmark_message3.pb.h" +#include "benchmarks/datasets/google_message4/benchmark_message4.pb.h" #define PREFIX "dataset." diff --git a/benchmarks/datasets/BUILD.bazel b/benchmarks/datasets/BUILD.bazel index 2a8b402668..4d4b195e70 100644 --- a/benchmarks/datasets/BUILD.bazel +++ b/benchmarks/datasets/BUILD.bazel @@ -14,6 +14,21 @@ filegroup( ], visibility = [ "//benchmarks:__subpackages__", + "//conformance:__subpackages__", + ], +) + +filegroup( + name = "proto3_datasets", + srcs = [ + "//benchmarks/datasets/google_message1/proto2:proto3_datasets", + "//benchmarks/datasets/google_message1/proto3:datasets", + "//benchmarks/datasets/google_message2:proto3_datasets", + ], + visibility = [ + "//benchmarks:__subpackages__", + "//conformance:__subpackages__", + "//csharp:__pkg__", ], ) @@ -59,6 +74,46 @@ java_library( ], ) +py_library( + name = "py_protos", + visibility = [ + "//benchmarks:__subpackages__", + ], + deps = [ + "//benchmarks/datasets/google_message1/proto2:benchmark_message1_proto2_py_proto", + "//benchmarks/datasets/google_message1/proto3:benchmark_message1_proto3_py_proto", + "//benchmarks/datasets/google_message2:benchmark_message2_py_proto", + "//benchmarks/datasets/google_message3:benchmark_message3_py_proto", + "//benchmarks/datasets/google_message4:benchmark_message4_py_proto", + ], +) + +filegroup( + name = "php_protos", + visibility = [ + "//benchmarks:__subpackages__", + ], + srcs = [ + "//benchmarks/datasets/google_message1/proto2:benchmark_message1_proto2_php_proto", + "//benchmarks/datasets/google_message1/proto3:benchmark_message1_proto3_php_proto", + "//benchmarks/datasets/google_message2:benchmark_message2_php_proto", + ], +) + +filegroup( + name = "csharp_protos", + visibility = [ + "//benchmarks:__subpackages__", + ], + srcs = [ + "//benchmarks/datasets/google_message1/proto2:benchmark_message1_proto2_csharp_proto", + "//benchmarks/datasets/google_message1/proto3:benchmark_message1_proto3_csharp_proto", + "//benchmarks/datasets/google_message2:benchmark_message2_csharp_proto", + "//benchmarks/datasets/google_message3:benchmark_message3_csharp_proto", + "//benchmarks/datasets/google_message4:benchmark_message4_csharp_proto", + ], +) + pkg_files( name = "dist_files", srcs = ["BUILD.bazel"], diff --git a/benchmarks/datasets/google_message1/proto2/BUILD.bazel b/benchmarks/datasets/google_message1/proto2/BUILD.bazel index 30caed574e..b7ee62ccbb 100644 --- a/benchmarks/datasets/google_message1/proto2/BUILD.bazel +++ b/benchmarks/datasets/google_message1/proto2/BUILD.bazel @@ -2,6 +2,8 @@ load("@rules_cc//cc:defs.bzl", "cc_proto_library") load("@rules_java//java:defs.bzl", "java_proto_library") load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") load("@rules_proto//proto:defs.bzl", "proto_library") +load("//:protobuf.bzl", "internal_py_proto_library", "internal_csharp_proto_library") +load("//benchmarks/util:compatibility.bzl", "proto3_from_proto2_data", "php_proto3_from_proto2_library") filegroup( name = "datasets", @@ -13,12 +15,21 @@ filegroup( ], ) +proto3_from_proto2_data( + name = "proto3_datasets", + srcs = [ + "dataset.google_message1_proto2.pb", + ], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + proto_library( name = "benchmark_message1_proto2_proto", srcs = [ "benchmark_message1_proto2.proto", ], - strip_import_prefix = "/benchmarks", visibility = [ "//benchmarks/datasets:__pkg__", ], @@ -34,6 +45,14 @@ cc_proto_library( ], ) +internal_csharp_proto_library( + name = "benchmark_message1_proto2_csharp_proto", + srcs = ["benchmark_message1_proto2.proto"], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + java_proto_library( name = "benchmark_message1_proto2_java_proto", visibility = [ @@ -44,6 +63,27 @@ java_proto_library( ], ) +php_proto3_from_proto2_library( + name = "benchmark_message1_proto2_php_proto", + src = "benchmark_message1_proto2.proto", + outs = [ + "Benchmarks/Proto2/GoogleMessage1.php", + "Benchmarks/Proto2/GoogleMessage1SubMessage.php", + "GPBMetadata/BenchmarkMessage1Proto2.php", + ], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + +internal_py_proto_library( + name = "benchmark_message1_proto2_py_proto", + srcs = ["benchmark_message1_proto2.proto"], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + pkg_files( name = "dist_files", srcs = glob(["*"]), diff --git a/benchmarks/datasets/google_message1/proto3/BUILD.bazel b/benchmarks/datasets/google_message1/proto3/BUILD.bazel index 0dc59d1445..ae9b4009cd 100644 --- a/benchmarks/datasets/google_message1/proto3/BUILD.bazel +++ b/benchmarks/datasets/google_message1/proto3/BUILD.bazel @@ -2,6 +2,7 @@ load("@rules_cc//cc:defs.bzl", "cc_proto_library") load("@rules_java//java:defs.bzl", "java_proto_library") load("@rules_proto//proto:defs.bzl", "proto_library") load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") +load("//:protobuf.bzl", "internal_py_proto_library", "internal_php_proto_library", "internal_csharp_proto_library") filegroup( name = "datasets", @@ -18,7 +19,6 @@ proto_library( srcs = [ "benchmark_message1_proto3.proto", ], - strip_import_prefix = "/benchmarks", visibility = [ "//benchmarks/datasets:__pkg__", ], @@ -34,6 +34,14 @@ cc_proto_library( ], ) +internal_csharp_proto_library( + name = "benchmark_message1_proto3_csharp_proto", + srcs = ["benchmark_message1_proto3.proto"], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + java_proto_library( name = "benchmark_message1_proto3_java_proto", visibility = [ @@ -44,6 +52,27 @@ java_proto_library( ], ) +internal_php_proto_library( + name = "benchmark_message1_proto3_php_proto", + srcs = ["benchmark_message1_proto3.proto"], + outs = [ + "Benchmarks/Proto3/GoogleMessage1.php", + "Benchmarks/Proto3/GoogleMessage1SubMessage.php", + "GPBMetadata/BenchmarkMessage1Proto3.php", + ], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + +internal_py_proto_library( + name = "benchmark_message1_proto3_py_proto", + srcs = ["benchmark_message1_proto3.proto"], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + pkg_files( name = "dist_files", srcs = glob(["*"]), diff --git a/benchmarks/datasets/google_message2/BUILD.bazel b/benchmarks/datasets/google_message2/BUILD.bazel index f3d66a25c0..654a3e2fef 100644 --- a/benchmarks/datasets/google_message2/BUILD.bazel +++ b/benchmarks/datasets/google_message2/BUILD.bazel @@ -2,6 +2,8 @@ load("@rules_cc//cc:defs.bzl", "cc_proto_library") load("@rules_java//java:defs.bzl", "java_proto_library") load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") load("@rules_proto//proto:defs.bzl", "proto_library") +load("//:protobuf.bzl", "internal_py_proto_library", "internal_csharp_proto_library") +load("//benchmarks/util:compatibility.bzl", "proto3_from_proto2_data", "php_proto3_from_proto2_library") filegroup( name = "datasets", @@ -13,12 +15,21 @@ filegroup( ], ) +proto3_from_proto2_data( + name = "proto3_datasets", + srcs = [ + "dataset.google_message2.pb", + ], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + proto_library( name = "benchmark_message2_proto", srcs = [ "benchmark_message2.proto", ], - strip_import_prefix = "/benchmarks", visibility = [ "//benchmarks/datasets:__pkg__", ], @@ -34,6 +45,14 @@ cc_proto_library( ], ) +internal_csharp_proto_library( + name = "benchmark_message2_csharp_proto", + srcs = ["benchmark_message2.proto"], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + java_proto_library( name = "benchmark_message2_java_proto", visibility = [ @@ -44,6 +63,27 @@ java_proto_library( ], ) +php_proto3_from_proto2_library( + name = "benchmark_message2_php_proto", + src = "benchmark_message2.proto", + outs = [ + "Benchmarks/Proto2/GoogleMessage2.php", + "Benchmarks/Proto2/GoogleMessage2GroupedMessage.php", + "GPBMetadata/BenchmarkMessage2.php", + ], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + +internal_py_proto_library( + name = "benchmark_message2_py_proto", + srcs = ["benchmark_message2.proto"], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + pkg_files( name = "dist_files", srcs = glob(["*"]), diff --git a/benchmarks/datasets/google_message3/BUILD.bazel b/benchmarks/datasets/google_message3/BUILD.bazel index a729e50fbc..68ad3f8df9 100644 --- a/benchmarks/datasets/google_message3/BUILD.bazel +++ b/benchmarks/datasets/google_message3/BUILD.bazel @@ -2,6 +2,7 @@ load("@rules_cc//cc:defs.bzl", "cc_proto_library") load("@rules_java//java:defs.bzl", "java_proto_library") load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") load("@rules_proto//proto:defs.bzl", "proto_library") +load("//:protobuf.bzl", "internal_py_proto_library", "internal_csharp_proto_library") filegroup( name = "datasets", @@ -24,7 +25,6 @@ proto_library( "benchmark_message3_7.proto", "benchmark_message3_8.proto", ], - strip_import_prefix = "/benchmarks", visibility = [ "//benchmarks/datasets:__pkg__", ], @@ -40,6 +40,24 @@ cc_proto_library( ], ) +internal_csharp_proto_library( + name = "benchmark_message3_csharp_proto", + srcs = [ + "benchmark_message3.proto", + "benchmark_message3_1.proto", + "benchmark_message3_2.proto", + "benchmark_message3_3.proto", + "benchmark_message3_4.proto", + "benchmark_message3_5.proto", + "benchmark_message3_6.proto", + "benchmark_message3_7.proto", + "benchmark_message3_8.proto", + ], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + java_proto_library( name = "benchmark_message3_java_proto", visibility = [ @@ -50,6 +68,24 @@ java_proto_library( ], ) +internal_py_proto_library( + name = "benchmark_message3_py_proto", + srcs = [ + "benchmark_message3.proto", + "benchmark_message3_1.proto", + "benchmark_message3_2.proto", + "benchmark_message3_3.proto", + "benchmark_message3_4.proto", + "benchmark_message3_5.proto", + "benchmark_message3_6.proto", + "benchmark_message3_7.proto", + "benchmark_message3_8.proto", + ], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + pkg_files( name = "dist_files", srcs = glob(["*"]), diff --git a/benchmarks/datasets/google_message3/benchmark_message3.proto b/benchmarks/datasets/google_message3/benchmark_message3.proto index 82422f924e..947060dc35 100644 --- a/benchmarks/datasets/google_message3/benchmark_message3.proto +++ b/benchmarks/datasets/google_message3/benchmark_message3.proto @@ -34,13 +34,13 @@ syntax = "proto2"; package benchmarks.google_message3; -import "datasets/google_message3/benchmark_message3_1.proto"; -import "datasets/google_message3/benchmark_message3_2.proto"; -import "datasets/google_message3/benchmark_message3_3.proto"; -import "datasets/google_message3/benchmark_message3_4.proto"; -import "datasets/google_message3/benchmark_message3_5.proto"; -import "datasets/google_message3/benchmark_message3_7.proto"; -import "datasets/google_message3/benchmark_message3_8.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_1.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_2.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_3.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_4.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_5.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_7.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_8.proto"; option cc_enable_arenas = true; option java_package = "com.google.protobuf.benchmarks"; diff --git a/benchmarks/datasets/google_message3/benchmark_message3_1.proto b/benchmarks/datasets/google_message3/benchmark_message3_1.proto index 1ee5c9eca6..f5c1f78fd4 100644 --- a/benchmarks/datasets/google_message3/benchmark_message3_1.proto +++ b/benchmarks/datasets/google_message3/benchmark_message3_1.proto @@ -34,11 +34,11 @@ syntax = "proto2"; package benchmarks.google_message3; -import "datasets/google_message3/benchmark_message3_2.proto"; -import "datasets/google_message3/benchmark_message3_3.proto"; -import "datasets/google_message3/benchmark_message3_5.proto"; -import "datasets/google_message3/benchmark_message3_7.proto"; -import "datasets/google_message3/benchmark_message3_8.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_2.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_3.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_5.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_7.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_8.proto"; option cc_enable_arenas = true; option java_package = "com.google.protobuf.benchmarks"; diff --git a/benchmarks/datasets/google_message3/benchmark_message3_2.proto b/benchmarks/datasets/google_message3/benchmark_message3_2.proto index d123a7204c..0bf5995774 100644 --- a/benchmarks/datasets/google_message3/benchmark_message3_2.proto +++ b/benchmarks/datasets/google_message3/benchmark_message3_2.proto @@ -34,11 +34,11 @@ syntax = "proto2"; package benchmarks.google_message3; -import "datasets/google_message3/benchmark_message3_3.proto"; -import "datasets/google_message3/benchmark_message3_4.proto"; -import "datasets/google_message3/benchmark_message3_5.proto"; -import "datasets/google_message3/benchmark_message3_7.proto"; -import "datasets/google_message3/benchmark_message3_8.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_3.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_4.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_5.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_7.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_8.proto"; option cc_enable_arenas = true; option java_package = "com.google.protobuf.benchmarks"; diff --git a/benchmarks/datasets/google_message3/benchmark_message3_3.proto b/benchmarks/datasets/google_message3/benchmark_message3_3.proto index 2e534a67d6..5965ebd4fe 100644 --- a/benchmarks/datasets/google_message3/benchmark_message3_3.proto +++ b/benchmarks/datasets/google_message3/benchmark_message3_3.proto @@ -34,10 +34,10 @@ syntax = "proto2"; package benchmarks.google_message3; -import "datasets/google_message3/benchmark_message3_4.proto"; -import "datasets/google_message3/benchmark_message3_5.proto"; -import "datasets/google_message3/benchmark_message3_7.proto"; -import "datasets/google_message3/benchmark_message3_8.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_4.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_5.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_7.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_8.proto"; option cc_enable_arenas = true; option java_package = "com.google.protobuf.benchmarks"; diff --git a/benchmarks/datasets/google_message3/benchmark_message3_4.proto b/benchmarks/datasets/google_message3/benchmark_message3_4.proto index b304148198..768e1f4ed0 100644 --- a/benchmarks/datasets/google_message3/benchmark_message3_4.proto +++ b/benchmarks/datasets/google_message3/benchmark_message3_4.proto @@ -34,10 +34,10 @@ syntax = "proto2"; package benchmarks.google_message3; -import "datasets/google_message3/benchmark_message3_5.proto"; -import "datasets/google_message3/benchmark_message3_6.proto"; -import "datasets/google_message3/benchmark_message3_7.proto"; -import "datasets/google_message3/benchmark_message3_8.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_5.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_6.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_7.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_8.proto"; option cc_enable_arenas = true; option java_package = "com.google.protobuf.benchmarks"; diff --git a/benchmarks/datasets/google_message3/benchmark_message3_5.proto b/benchmarks/datasets/google_message3/benchmark_message3_5.proto index e72d7ee85a..8031c99069 100644 --- a/benchmarks/datasets/google_message3/benchmark_message3_5.proto +++ b/benchmarks/datasets/google_message3/benchmark_message3_5.proto @@ -34,9 +34,9 @@ syntax = "proto2"; package benchmarks.google_message3; -import "datasets/google_message3/benchmark_message3_6.proto"; -import "datasets/google_message3/benchmark_message3_7.proto"; -import "datasets/google_message3/benchmark_message3_8.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_6.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_7.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_8.proto"; option cc_enable_arenas = true; option java_package = "com.google.protobuf.benchmarks"; diff --git a/benchmarks/datasets/google_message3/benchmark_message3_6.proto b/benchmarks/datasets/google_message3/benchmark_message3_6.proto index c766f7c2ef..5941ad73f0 100644 --- a/benchmarks/datasets/google_message3/benchmark_message3_6.proto +++ b/benchmarks/datasets/google_message3/benchmark_message3_6.proto @@ -34,8 +34,8 @@ syntax = "proto2"; package benchmarks.google_message3; -import "datasets/google_message3/benchmark_message3_7.proto"; -import "datasets/google_message3/benchmark_message3_8.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_7.proto"; +import "benchmarks/datasets/google_message3/benchmark_message3_8.proto"; option cc_enable_arenas = true; option java_package = "com.google.protobuf.benchmarks"; diff --git a/benchmarks/datasets/google_message4/BUILD.bazel b/benchmarks/datasets/google_message4/BUILD.bazel index 33de093788..079a9a2d5b 100644 --- a/benchmarks/datasets/google_message4/BUILD.bazel +++ b/benchmarks/datasets/google_message4/BUILD.bazel @@ -2,6 +2,7 @@ load("@rules_cc//cc:defs.bzl", "cc_proto_library") load("@rules_java//java:defs.bzl", "java_proto_library") load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") load("@rules_proto//proto:defs.bzl", "proto_library") +load("//:protobuf.bzl", "internal_py_proto_library", "internal_csharp_proto_library") filegroup( name = "datasets", @@ -19,7 +20,6 @@ proto_library( "benchmark_message4_2.proto", "benchmark_message4_3.proto", ], - strip_import_prefix = "/benchmarks", visibility = [ "//benchmarks/datasets:__pkg__", ], @@ -35,6 +35,19 @@ cc_proto_library( ], ) +internal_csharp_proto_library( + name = "benchmark_message4_csharp_proto", + srcs = [ + "benchmark_message4.proto", + "benchmark_message4_1.proto", + "benchmark_message4_2.proto", + "benchmark_message4_3.proto", + ], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + java_proto_library( name = "benchmark_message4_java_proto", visibility = [ @@ -45,6 +58,19 @@ java_proto_library( ], ) +internal_py_proto_library( + name = "benchmark_message4_py_proto", + srcs = [ + "benchmark_message4.proto", + "benchmark_message4_1.proto", + "benchmark_message4_2.proto", + "benchmark_message4_3.proto", + ], + visibility = [ + "//benchmarks/datasets:__pkg__", + ], +) + pkg_files( name = "dist_files", srcs = glob(["*"]), diff --git a/benchmarks/datasets/google_message4/benchmark_message4.proto b/benchmarks/datasets/google_message4/benchmark_message4.proto index 424ed10811..156e188ac0 100644 --- a/benchmarks/datasets/google_message4/benchmark_message4.proto +++ b/benchmarks/datasets/google_message4/benchmark_message4.proto @@ -34,9 +34,9 @@ syntax = "proto2"; package benchmarks.google_message4; -import "datasets/google_message4/benchmark_message4_1.proto"; -import "datasets/google_message4/benchmark_message4_2.proto"; -import "datasets/google_message4/benchmark_message4_3.proto"; +import "benchmarks/datasets/google_message4/benchmark_message4_1.proto"; +import "benchmarks/datasets/google_message4/benchmark_message4_2.proto"; +import "benchmarks/datasets/google_message4/benchmark_message4_3.proto"; option cc_enable_arenas = true; option java_package = "com.google.protobuf.benchmarks"; diff --git a/benchmarks/datasets/google_message4/benchmark_message4_1.proto b/benchmarks/datasets/google_message4/benchmark_message4_1.proto index c5deecd0df..6e5256f8df 100644 --- a/benchmarks/datasets/google_message4/benchmark_message4_1.proto +++ b/benchmarks/datasets/google_message4/benchmark_message4_1.proto @@ -34,8 +34,8 @@ syntax = "proto2"; package benchmarks.google_message4; -import "datasets/google_message4/benchmark_message4_2.proto"; -import "datasets/google_message4/benchmark_message4_3.proto"; +import "benchmarks/datasets/google_message4/benchmark_message4_2.proto"; +import "benchmarks/datasets/google_message4/benchmark_message4_3.proto"; option cc_enable_arenas = true; option java_package = "com.google.protobuf.benchmarks"; diff --git a/benchmarks/datasets/google_message4/benchmark_message4_2.proto b/benchmarks/datasets/google_message4/benchmark_message4_2.proto index 0c4cdfd853..dbd43e4289 100644 --- a/benchmarks/datasets/google_message4/benchmark_message4_2.proto +++ b/benchmarks/datasets/google_message4/benchmark_message4_2.proto @@ -32,7 +32,7 @@ syntax = "proto2"; package benchmarks.google_message4; -import "datasets/google_message4/benchmark_message4_3.proto"; +import "benchmarks/datasets/google_message4/benchmark_message4_3.proto"; option cc_enable_arenas = true; option java_package = "com.google.protobuf.benchmarks"; diff --git a/benchmarks/go/go_benchmark_test.go b/benchmarks/go/go_benchmark_test.go deleted file mode 100644 index 8c741b7106..0000000000 --- a/benchmarks/go/go_benchmark_test.go +++ /dev/null @@ -1,124 +0,0 @@ -package main - -import ( - benchmarkWrapper "../tmp" - googleMessage1Proto2 "../tmp/datasets/google_message1/proto2" - googleMessage1Proto3 "../tmp/datasets/google_message1/proto3" - googleMessage2 "../tmp/datasets/google_message2" - googleMessage3 "../tmp/datasets/google_message3" - googleMessage4 "../tmp/datasets/google_message4" - "flag" - "github.com/golang/protobuf/proto" - "io/ioutil" - "testing" -) - -// Data is returned by the Load function. -type Dataset struct { - name string - newMessage func() proto.Message - marshaled [][]byte - unmarshaled []proto.Message -} - -var datasets []Dataset - -// This is used to getDefaultInstance for a message type. -func generateNewMessageFunction(dataset benchmarkWrapper.BenchmarkDataset) func() proto.Message { - switch dataset.MessageName { - case "benchmarks.proto3.GoogleMessage1": - return func() proto.Message { return new(googleMessage1Proto3.GoogleMessage1) } - case "benchmarks.proto2.GoogleMessage1": - return func() proto.Message { return new(googleMessage1Proto2.GoogleMessage1) } - case "benchmarks.proto2.GoogleMessage2": - return func() proto.Message { return new(googleMessage2.GoogleMessage2) } - case "benchmarks.google_message3.GoogleMessage3": - return func() proto.Message { return new(googleMessage3.GoogleMessage3) } - case "benchmarks.google_message4.GoogleMessage4": - return func() proto.Message { return new(googleMessage4.GoogleMessage4) } - default: - panic("Unknown message type: " + dataset.MessageName) - } -} - -func init() { - flag.Parse() - for _, f := range flag.Args() { - // Load the benchmark. - b, err := ioutil.ReadFile(f) - if err != nil { - panic(err) - } - - // Parse the benchmark. - var dm benchmarkWrapper.BenchmarkDataset - if err := proto.Unmarshal(b, &dm); err != nil { - panic(err) - } - - // Determine the concrete protobuf message type to use. - var ds Dataset - ds.newMessage = generateNewMessageFunction(dm) - - // Unmarshal each test message. - for _, payload := range dm.Payload { - ds.marshaled = append(ds.marshaled, payload) - m := ds.newMessage() - if err := proto.Unmarshal(payload, m); err != nil { - panic(err) - } - ds.unmarshaled = append(ds.unmarshaled, m) - } - ds.name = f - - datasets = append(datasets, ds) - } -} - -func Benchmark(b *testing.B) { - for _, ds := range datasets { - b.Run(ds.name, func(b *testing.B) { - b.Run("Unmarshal", func(b *testing.B) { - for i := 0; i < b.N; i++ { - for j, payload := range ds.marshaled { - out := ds.newMessage() - if err := proto.Unmarshal(payload, out); err != nil { - b.Fatalf("can't unmarshal message %d %v", j, err) - } - } - } - }) - b.Run("Marshal", func(b *testing.B) { - for i := 0; i < b.N; i++ { - for j, m := range ds.unmarshaled { - if _, err := proto.Marshal(m); err != nil { - b.Fatalf("can't marshal message %d %+v: %v", j, m, err) - } - } - } - }) - b.Run("Size", func(b *testing.B) { - for i := 0; i < b.N; i++ { - for _, m := range ds.unmarshaled { - proto.Size(m) - } - } - }) - b.Run("Clone", func(b *testing.B) { - for i := 0; i < b.N; i++ { - for _, m := range ds.unmarshaled { - proto.Clone(m) - } - } - }) - b.Run("Merge", func(b *testing.B) { - for i := 0; i < b.N; i++ { - for _, m := range ds.unmarshaled { - out := ds.newMessage() - proto.Merge(out, m) - } - } - }) - }) - } -} diff --git a/benchmarks/internal.bzl b/benchmarks/internal.bzl new file mode 100644 index 0000000000..c060353d13 --- /dev/null +++ b/benchmarks/internal.bzl @@ -0,0 +1,37 @@ +"""Starlark definitions for Protobuf benchmark tests. + +PLEASE DO NOT DEPEND ON THE CONTENTS OF THIS FILE, IT IS UNSTABLE. +""" +load("//build_defs:internal_shell.bzl", "inline_sh_binary") + +def internal_benchmark_test( + name, + binary, + datasets, + args = [], + env_vars = []): + """Benchmark test runner. + + Args: + name: the name for the test. + binary: a benchmark test binary. + datasets: a set of datasets to benchmark. + args: optional arguments to pass the binary. + env_vars: environment variables to set in the test. + """ + + dataset_labels = [] + for dataset in datasets: + dataset_labels.append("$(rootpaths %s)" % dataset) + inline_sh_binary( + name = name, + srcs = datasets, + tools = [binary], + cmd = "%s $(rootpath %s) %s %s" % ( + " ".join(env_vars), + binary, + " ".join(args), + " ".join(dataset_labels)), + tags = ["benchmark"], + testonly = 1, + ) diff --git a/benchmarks/java/BUILD.bazel b/benchmarks/java/BUILD.bazel new file mode 100644 index 0000000000..f8976bf664 --- /dev/null +++ b/benchmarks/java/BUILD.bazel @@ -0,0 +1,55 @@ +load("@rules_java//java:defs.bzl", "java_library", "java_binary") +load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") +load("//build_defs:internal_shell.bzl", "inline_sh_binary") +load("//benchmarks:internal.bzl", "internal_benchmark_test") + +java_binary( + name = "java_benchmark_jar", + srcs = [ + "src/main/java/com/google/protobuf/ProtoCaliperBenchmark.java", + ], + main_class = "com.google.caliper.runner.CaliperMain", + deps = [ + "//:protobuf_java", + "//benchmarks:benchmarks_java_proto", + "//benchmarks/datasets:java_protos", + "@maven//:com_google_caliper_caliper", + "@maven//:com_google_caliper_caliper_api", + ], +) + +# The benchmark binary which can be run over any dataset. +inline_sh_binary( + name = "java_benchmark", + srcs = ["//benchmarks/datasets"], + tools = [":java_benchmark_jar"], + cmd = """ + data_files="" + conf=() + for arg in "$${@:1}"; do + if [[ $${arg:0:1} == "-" ]]; then + conf+=($$arg) + else + data_files+="$$arg," + fi + done + $(rootpath :java_benchmark_jar) com.google.protobuf.ProtoCaliperBenchmark \ + -i runtime -DdataFile=$${data_files:0:-1} $${conf[*]} + """ +) + +# A pre-configured binary using the checked in datasets. +internal_benchmark_test( + name = "java", + binary = ":java_benchmark", + datasets = ["//benchmarks/datasets"], +) + +pkg_files( + name = "dist_files", + srcs = [ + "BUILD.bazel", + ] + glob(["**/*.java"]), + strip_prefix = strip_prefix.from_root(""), + visibility = ["//benchmarks:__pkg__"], +) diff --git a/benchmarks/java/pom.xml b/benchmarks/java/pom.xml deleted file mode 100644 index c0dc9408c1..0000000000 --- a/benchmarks/java/pom.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - 4.0.0 - protobuf-java-benchmark - com.google.protobuf - 1.0.0 - Protocol Buffers [Benchmark] - The benchmark tools for Protobuf Java. - - - - com.google.protobuf - protobuf-java - ${protobuf.version} - jar - system - ${project.basedir}/lib/protobuf-java.jar - - - com.google.caliper - caliper - 1.0-beta-3 - - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.4.1 - - - - jar-with-dependencies - - - - - com.mkyong.core.utils.App - - - - - - make-assembly - - package - - single - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.5.1 - - 1.8 - 1.8 - - - - org.apache.maven.plugins - maven-jar-plugin - 2.5 - - - - true - com.google.protocolbuffers.ProtoBench - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.4 - - - attach-sources - - jar-no-fork - - - - - - - - - diff --git a/benchmarks/js/benchmark_suite.js b/benchmarks/js/benchmark_suite.js deleted file mode 100644 index c5c3e5105a..0000000000 --- a/benchmarks/js/benchmark_suite.js +++ /dev/null @@ -1,33 +0,0 @@ -var benchmark = require("benchmark"); - -function newBenchmark(messageName, filename, language) { - var benches = []; - return { - suite: new benchmark.Suite(messageName + filename + language ) - .on("add", function(event) { - benches.push(event.target); - }) - .on("start", function() { - process.stdout.write( - "benchmarking message " + messageName - + " of dataset file " + filename - + "'s performance ..." + "\n\n"); - }) - .on("cycle", function(event) { - process.stdout.write(String(event.target) + "\n"); - }) - .on("complete", function() { - var getHz = function(bench) { - return 1 / (bench.stats.mean + bench.stats.moe); - } - benches.forEach(function(val, index) { - benches[index] = getHz(val); - }); - }), - benches: benches - } -} - -module.exports = { - newBenchmark: newBenchmark -} diff --git a/benchmarks/js/js_benchmark.js b/benchmarks/js/js_benchmark.js deleted file mode 100644 index 9ba4828969..0000000000 --- a/benchmarks/js/js_benchmark.js +++ /dev/null @@ -1,82 +0,0 @@ -require('./datasets/google_message1/proto2/benchmark_message1_proto2_pb.js'); -require('./datasets/google_message1/proto3/benchmark_message1_proto3_pb.js'); -require('./datasets/google_message2/benchmark_message2_pb.js'); -require('./datasets/google_message3/benchmark_message3_pb.js'); -require('./datasets/google_message4/benchmark_message4_pb.js'); -require('./benchmarks_pb.js'); - -var fs = require('fs'); -var benchmarkSuite = require("./benchmark_suite.js"); - - -function getNewPrototype(name) { - var message = eval("proto." + name); - if (typeof(message) == "undefined") { - throw "type " + name + " is undefined"; - } - return message; -} - -var results = []; -var json_file = ""; - -console.log("#####################################################"); -console.log("Js Benchmark: "); -process.argv.forEach(function(filename, index) { - if (index < 2) { - return; - } - if (filename.indexOf("--json_output") != -1) { - json_file = filename.replace(/^--json_output=/, ''); - return; - } - - var benchmarkDataset = - proto.benchmarks.BenchmarkDataset.deserializeBinary(fs.readFileSync(filename)); - var messageList = []; - var totalBytes = 0; - benchmarkDataset.getPayloadList().forEach(function(onePayload) { - var message = getNewPrototype(benchmarkDataset.getMessageName()); - messageList.push(message.deserializeBinary(onePayload)); - totalBytes += onePayload.length; - }); - - var scenarios = benchmarkSuite.newBenchmark( - benchmarkDataset.getMessageName(), filename, "js"); - scenarios.suite - .add("js deserialize", function() { - benchmarkDataset.getPayloadList().forEach(function(onePayload) { - var protoType = getNewPrototype(benchmarkDataset.getMessageName()); - protoType.deserializeBinary(onePayload); - }); - }) - .add("js serialize", function() { - var protoType = getNewPrototype(benchmarkDataset.getMessageName()); - messageList.forEach(function(message) { - message.serializeBinary(); - }); - }) - .run({"Async": false}); - - results.push({ - filename: filename, - benchmarks: { - protobufjs_decoding: scenarios.benches[0] * totalBytes / 1024 / 1024, - protobufjs_encoding: scenarios.benches[1] * totalBytes / 1024 / 1024 - } - }) - - console.log("Throughput for deserialize: " - + scenarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" ); - console.log("Throughput for serialize: " - + scenarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" ); - console.log(""); -}); -console.log("#####################################################"); - -if (json_file != "") { - fs.writeFile(json_file, JSON.stringify(results), (err) => { - if (err) throw err; - }); -} - diff --git a/benchmarks/php/BUILD.bazel b/benchmarks/php/BUILD.bazel new file mode 100644 index 0000000000..a1a9319909 --- /dev/null +++ b/benchmarks/php/BUILD.bazel @@ -0,0 +1,69 @@ +load("//benchmarks:internal.bzl", "internal_benchmark_test") +load("//build_defs:internal_shell.bzl", "inline_sh_binary") +load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") + +# The benchmark binary which can be run over any dataset. +inline_sh_binary( + name = "php_benchmark", + srcs = [ + "PhpBenchmark.php", + "autoload.php", + ], + deps = [ + "//benchmarks:benchmarks_php_proto", + "//benchmarks/datasets:php_protos", + "//php:source_files", + ], + cmd = """ + php -d include_path=benchmarks:php/src \\ + -d auto_prepend_file=$(rootpath autoload.php) \\ + $(rootpath PhpBenchmark.php) $$@ + """, + testonly = 1, +) + +# A pre-configured binary using the checked in datasets. +internal_benchmark_test( + name = "php", + binary = ":php_benchmark", + datasets = ["//benchmarks/datasets:proto3_datasets"], + env_vars = ["PROTOBUF_PHP_SRCDIR=php/src"], + args = ["--behavior_prefix='php'"], +) + +# The benchmark binary which can be run over any dataset. +inline_sh_binary( + name = "php_c_benchmark", + srcs = [ + "PhpBenchmark.php", + "//php:extension", + ], + deps = [ + "//benchmarks:benchmarks_php_proto", + "//benchmarks/datasets:php_protos", + ], + cmd = """ + php -d include_path=benchmarks:php/src \\ + -dextension=$(rootpath //php:extension) \\ + $(rootpath PhpBenchmark.php) $$@ + """, + testonly = 1, +) + +# A pre-configured binary using the checked in datasets. +internal_benchmark_test( + name = "php_c", + binary = ":php_c_benchmark", + datasets = ["//benchmarks/datasets:proto3_datasets"], + env_vars = ["PROTOBUF_PHP_SRCDIR=php/src"], + args = ["--behavior_prefix='php_c'"], +) + +pkg_files( + name = "dist_files", + srcs = glob(["*.php"]) + [ + "BUILD.bazel", + ], + strip_prefix = strip_prefix.from_root(""), + visibility = ["//benchmarks:__pkg__"], +) diff --git a/benchmarks/protobuf.js/generate_pbjs_files.js b/benchmarks/protobuf.js/generate_pbjs_files.js deleted file mode 100644 index 11945bf9e6..0000000000 --- a/benchmarks/protobuf.js/generate_pbjs_files.js +++ /dev/null @@ -1,25 +0,0 @@ -var pbjs = require("./protobuf.js/cli").pbjs - -var argv = []; -var protoFiles = []; -var prefix = ""; -process.argv.forEach(function(val, index) { - var arg = val; - if (arg.length > 6 && arg.substring(arg.length - 6) == ".proto") { - protoFiles.push(arg); - } else if (arg.length > 15 && arg.substring(0, 15) == "--include_path=") { - prefix = arg.substring(15); - } else if (index >= 2) { - argv.push(arg); - } -}); -protoFiles.forEach(function(val) { - argv.push(prefix + "/" + val); -}); - -pbjs.main(argv, function(err, output){ - if (err) { - console.log(err); - } -}); - diff --git a/benchmarks/protobuf.js/protobufjs_benchmark.js b/benchmarks/protobuf.js/protobufjs_benchmark.js deleted file mode 100644 index e062d1c6b8..0000000000 --- a/benchmarks/protobuf.js/protobufjs_benchmark.js +++ /dev/null @@ -1,66 +0,0 @@ -var root = require("./generated_bundle_code.js"); -var fs = require('fs'); -var benchmark = require("./node_modules/benchmark"); -var benchmarkSuite = require("./benchmark_suite.js"); - - -function getNewPrototype(name) { - var message = eval("root." + name); - if (typeof(message) == "undefined") { - throw "type " + name + " is undefined"; - } - return message; -} - - -var results = []; - -console.log("#####################################################"); -console.log("ProtobufJs Benchmark: "); -process.argv.forEach(function(filename, index) { - if (index < 2) { - return; - } - var benchmarkDataset = - root.benchmarks.BenchmarkDataset.decode(fs.readFileSync(filename)); - var messageList = []; - var totalBytes = 0; - benchmarkDataset.payload.forEach(function(onePayload) { - var message = getNewPrototype(benchmarkDataset.messageName); - messageList.push(message.decode(onePayload)); - totalBytes += onePayload.length; - }); - - var scenarios = benchmarkSuite.newBenchmark( - benchmarkDataset.messageName, filename, "protobufjs"); - scenarios.suite - .add("protobuf.js static decoding", function() { - benchmarkDataset.payload.forEach(function(onePayload) { - var protoType = getNewPrototype(benchmarkDataset.messageName); - protoType.decode(onePayload); - }); - }) - .add("protobuf.js static encoding", function() { - var protoType = getNewPrototype(benchmarkDataset.messageName); - messageList.forEach(function(message) { - protoType.encode(message).finish(); - }); - }) - .run({"Async": false}); - - results.push({ - filename: filename, - benchmarks: { - protobufjs_decoding: scenarios.benches[0] * totalBytes, - protobufjs_encoding: scenarios.benches[1] * totalBytes - } - }) - - console.log("Throughput for decoding: " - + scenarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" ); - console.log("Throughput for encoding: " - + scenarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" ); - console.log(""); -}); -console.log("#####################################################"); - diff --git a/benchmarks/python/BUILD.bazel b/benchmarks/python/BUILD.bazel new file mode 100644 index 0000000000..a8b1801fb9 --- /dev/null +++ b/benchmarks/python/BUILD.bazel @@ -0,0 +1,71 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("@rules_python//python:defs.bzl", "py_library", "py_binary") +load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") +load("//benchmarks:internal.bzl", "internal_benchmark_test") + +cc_binary( + name = "libbenchmark_messages.so", + srcs = ["python_benchmark_messages.cc"], + deps = [ + "@local_config_python//:python_headers", + "//external:python_headers", + "//benchmarks:benchmarks_cc_proto", + "//benchmarks/datasets:cc_protos", + ], + linkshared = True, + linkstatic = True, + visibility = ["//visibility:private"], +) + +# The benchmark binary which can be run over any dataset. +py_binary( + name = "python_benchmark", + srcs = ["py_benchmark.py"], + main = "py_benchmark.py", + data = ["libbenchmark_messages.so"], + deps = [ + "//:protobuf_python", + "//benchmarks:benchmarks_py_proto", + "//benchmarks/datasets:py_protos", + ], + env = select({ + "//python:use_fast_cpp_protos": {"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": "cpp"}, + "//conditions:default": {"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": "python"}, + }), +) + +# Pre-configured binaries using the checked in datasets. + +internal_benchmark_test( + name = "python", + binary = ":python_benchmark", + datasets = ["//benchmarks/datasets"], + env_vars = ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python"], +) + +# Note: this requires --define=use_fast_cpp_protos=true +internal_benchmark_test( + name = "cpp_reflection", + binary = ":python_benchmark", + datasets = ["//benchmarks/datasets"], + env_vars = ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp"], +) + +# Note: this requires --define=use_fast_cpp_protos=true +internal_benchmark_test( + name = "cpp_generated_code", + binary = ":python_benchmark", + datasets = ["//benchmarks/datasets"], + env_vars = ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp"], + args = ["--cpp_generated"], +) + +pkg_files( + name = "dist_files", + srcs = glob(["*.py"]) + [ + "BUILD.bazel", + "python_benchmark_messages.cc", + ], + strip_prefix = strip_prefix.from_root(""), + visibility = ["//benchmarks:__pkg__"], +) diff --git a/benchmarks/python/py_benchmark.py b/benchmarks/python/py_benchmark.py index 60e377e4b8..053c78cc31 100644 --- a/benchmarks/python/py_benchmark.py +++ b/benchmarks/python/py_benchmark.py @@ -27,17 +27,17 @@ args = parser.parse_args() # for the descriptor can be found in the pool if args.cpp_generated != "no": sys.path.append( os.path.dirname( os.path.dirname( os.path.abspath(__file__) ) ) + "/.libs" ) - import libbenchmark_messages + from benchmarks.python import libbenchmark_messages sys.path.append( os.path.dirname( os.path.dirname( os.path.abspath(__file__) ) ) + "/tmp" ) # END CPP GENERATED MESSAGE -import datasets.google_message1.proto2.benchmark_message1_proto2_pb2 as benchmark_message1_proto2_pb2 -import datasets.google_message1.proto3.benchmark_message1_proto3_pb2 as benchmark_message1_proto3_pb2 -import datasets.google_message2.benchmark_message2_pb2 as benchmark_message2_pb2 -import datasets.google_message3.benchmark_message3_pb2 as benchmark_message3_pb2 -import datasets.google_message4.benchmark_message4_pb2 as benchmark_message4_pb2 -import benchmarks_pb2 as benchmarks_pb2 +import benchmarks.datasets.google_message1.proto2.benchmark_message1_proto2_pb2 as benchmark_message1_proto2_pb2 +import benchmarks.datasets.google_message1.proto3.benchmark_message1_proto3_pb2 as benchmark_message1_proto3_pb2 +import benchmarks.datasets.google_message2.benchmark_message2_pb2 as benchmark_message2_pb2 +import benchmarks.datasets.google_message3.benchmark_message3_pb2 as benchmark_message3_pb2 +import benchmarks.datasets.google_message4.benchmark_message4_pb2 as benchmark_message4_pb2 +import benchmarks.benchmarks_pb2 as benchmarks_pb2 def run_one_test(filename): diff --git a/benchmarks/python/python_benchmark_messages.cc b/benchmarks/python/python_benchmark_messages.cc index f6ddcf3185..8a65125b3b 100644 --- a/benchmarks/python/python_benchmark_messages.cc +++ b/benchmarks/python/python_benchmark_messages.cc @@ -1,11 +1,11 @@ #include #include "benchmarks.pb.h" -#include "datasets/google_message1/proto2/benchmark_message1_proto2.pb.h" -#include "datasets/google_message1/proto3/benchmark_message1_proto3.pb.h" -#include "datasets/google_message2/benchmark_message2.pb.h" -#include "datasets/google_message3/benchmark_message3.pb.h" -#include "datasets/google_message4/benchmark_message4.pb.h" +#include "benchmarks/datasets/google_message1/proto2/benchmark_message1_proto2.pb.h" +#include "benchmarks/datasets/google_message1/proto3/benchmark_message1_proto3.pb.h" +#include "benchmarks/datasets/google_message2/benchmark_message2.pb.h" +#include "benchmarks/datasets/google_message3/benchmark_message3.pb.h" +#include "benchmarks/datasets/google_message4/benchmark_message4.pb.h" static struct PyModuleDef _module = {PyModuleDef_HEAD_INIT, "libbenchmark_messages", diff --git a/benchmarks/util/BUILD.bazel b/benchmarks/util/BUILD.bazel new file mode 100644 index 0000000000..6b3aa2beb1 --- /dev/null +++ b/benchmarks/util/BUILD.bazel @@ -0,0 +1,50 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") +load("@rules_python//python:defs.bzl", "py_binary") + +package(default_visibility = ["//benchmarks:__subpackages__"]) + +cc_binary( + name = "protoc-gen-proto2_to_proto3", + srcs = [ + "schema_proto2_to_proto3_util.h", + "protoc-gen-proto2_to_proto3.cc", + ], + deps = [ + "//:protobuf", + "//src/google/protobuf/compiler:code_generator", + "//benchmarks:benchmarks_cc_proto", + ], + visibility = ["//benchmarks:__subpackages__"], +) + +cc_binary( + name = "proto3_data_stripper", + srcs = [ + "data_proto2_to_proto3_util.h", + "proto3_data_stripper.cc", + ], + deps = [ + "//:protobuf", + "//benchmarks/datasets:cc_protos", + "//benchmarks:benchmarks_cc_proto", + ], +) + +py_binary( + name = "result_parser", + srcs = ["result_parser.py"], + deps = [ + "//benchmarks:benchmarks_py_proto", + ], +) + +################################################################################ +# Distribution files +################################################################################ + +pkg_files( + name = "dist_files", + srcs = glob(["*"]), + strip_prefix = strip_prefix.from_root(""), +) diff --git a/benchmarks/util/compatibility.bzl b/benchmarks/util/compatibility.bzl new file mode 100644 index 0000000000..044ade6d0f --- /dev/null +++ b/benchmarks/util/compatibility.bzl @@ -0,0 +1,103 @@ +"""Starlark definitions for converting proto2 to proto3. + +PLEASE DO NOT DEPEND ON THE CONTENTS OF THIS FILE, IT IS UNSTABLE. +""" + +load("//:protobuf.bzl", "internal_php_proto_library") + +def proto3_from_proto2_data( + name, + srcs, + **kwargs): + """Transforms proto2 binary data into a proto3-compatible format, + + Args: + name: the name of the target representing the generated proto files. + srcs: the source binary protobuf data files. + **kwargs: standard arguments to forward on + """ + outs = [] + out_files = [] + src_files = [] + for src in srcs: + outs.append("proto3/" + src) + out_files.append("$(RULEDIR)/proto3/" + src) + src_files.append("$(rootpath %s)" % src); + + native.genrule( + name = name + "_genrule", + srcs = srcs, + exec_tools = [ + "//benchmarks/util:proto3_data_stripper", + ], + outs = outs, + cmd = "$(execpath //benchmarks/util:proto3_data_stripper) %s %s" % ( + " ".join(src_files), " ".join(out_files)), + ) + + native.filegroup( + name = name, + srcs = outs, + **kwargs, + ) + +def _proto3_from_proto2_library( + name, + srcs, + **kwargs): + """Create a proto3 library from a proto2 source. + + Args: + name: the name of the target representing the generated proto files. + srcs: the source proto2 files. Note: these must be raw sources. + **kwargs: standard arguments to forward on + """ + outs = [] + src_files = [] + for src in srcs: + outs.append(src + "3") + src_files.append("$(rootpath %s)" % src); + + native.genrule( + name = name, + srcs = srcs, + exec_tools = [ + "//:protoc", + "//benchmarks/util:protoc-gen-proto2_to_proto3", + ], + outs = outs, + cmd = """ + $(execpath //:protoc) \ + --plugin=$(execpath //benchmarks/util:protoc-gen-proto2_to_proto3) \ + --proto_path=. \ + --proto_path=$(GENDIR) \ + --proto2_to_proto3_out=$(GENDIR) \ + %s + """ % (" ".join(src_files)), + **kwargs, + ) + +def php_proto3_from_proto2_library( + name, + src, + outs = [], + **kwargs): + """Create a proto3 php library from a proto2 source. + + Args: + name: the name of the target representing the generated proto files. + src: the source proto2 file. + outs: the expected php outputs. + **kwargs: standard arguments to forward on + """ + _proto3_from_proto2_library( + name = name + "_genrule", + srcs = [src], + ) + + internal_php_proto_library( + name = name, + srcs = [name + "_genrule"], + outs = outs, + **kwargs, + ) diff --git a/benchmarks/util/gogo_data_scrubber.cc b/benchmarks/util/gogo_data_scrubber.cc deleted file mode 100644 index 9ef57b0da0..0000000000 --- a/benchmarks/util/gogo_data_scrubber.cc +++ /dev/null @@ -1,74 +0,0 @@ -#include "benchmarks.pb.h" -#include "datasets/google_message1/proto2/benchmark_message1_proto2.pb.h" -#include "datasets/google_message1/proto3/benchmark_message1_proto3.pb.h" -#include "datasets/google_message2/benchmark_message2.pb.h" -#include "datasets/google_message3/benchmark_message3.pb.h" -#include "datasets/google_message4/benchmark_message4.pb.h" -#include "data_proto2_to_proto3_util.h" - -#include - -using google::protobuf::util::GogoDataStripper; - -std::string ReadFile(const std::string& name) { - std::ifstream file(name.c_str()); - GOOGLE_CHECK(file.is_open()) << "Couldn't find file '" - << name - << "', please make sure you are running this command from the benchmarks" - << " directory.\n"; - return std::string((std::istreambuf_iterator(file)), - std::istreambuf_iterator()); -} - -int main(int argc, char *argv[]) { - if (argc % 2 == 0 || argc == 1) { - std::cerr << "Usage: [input_files] [output_file_names] where " << - "input_files are one to one mapping to output_file_names." << - std::endl; - return 1; - } - - for (int i = argc / 2; i > 0; i--) { - const std::string &input_file = argv[i]; - const std::string &output_file = argv[i + argc / 2]; - - std::cerr << "Generating " << input_file - << " to " << output_file << std::endl; - benchmarks::BenchmarkDataset dataset; - Message* message; - std::string dataset_payload = ReadFile(input_file); - GOOGLE_CHECK(dataset.ParseFromString(dataset_payload)) - << "Can' t parse data file " << input_file; - - if (dataset.message_name() == "benchmarks.proto3.GoogleMessage1") { - message = new benchmarks::proto3::GoogleMessage1; - } else if (dataset.message_name() == "benchmarks.proto2.GoogleMessage1") { - message = new benchmarks::proto2::GoogleMessage1; - } else if (dataset.message_name() == "benchmarks.proto2.GoogleMessage2") { - message = new benchmarks::proto2::GoogleMessage2; - } else if (dataset.message_name() == - "benchmarks.google_message3.GoogleMessage3") { - message = new benchmarks::google_message3::GoogleMessage3; - } else if (dataset.message_name() == - "benchmarks.google_message4.GoogleMessage4") { - message = new benchmarks::google_message4::GoogleMessage4; - } else { - std::cerr << "Unknown message type: " << dataset.message_name(); - exit(1); - } - - for (int i = 0; i < dataset.payload_size(); i++) { - message->ParseFromString(dataset.payload(i)); - GogoDataStripper stripper; - stripper.StripMessage(message); - dataset.set_payload(i, message->SerializeAsString()); - } - - std::ofstream ofs(output_file); - ofs << dataset.SerializeAsString(); - ofs.close(); - } - - - return 0; -} diff --git a/benchmarks/util/proto3_data_stripper.cc b/benchmarks/util/proto3_data_stripper.cc index 3096c4c115..68f49054d4 100644 --- a/benchmarks/util/proto3_data_stripper.cc +++ b/benchmarks/util/proto3_data_stripper.cc @@ -1,9 +1,9 @@ #include "benchmarks.pb.h" -#include "datasets/google_message1/proto2/benchmark_message1_proto2.pb.h" -#include "datasets/google_message1/proto3/benchmark_message1_proto3.pb.h" -#include "datasets/google_message2/benchmark_message2.pb.h" -#include "datasets/google_message3/benchmark_message3.pb.h" -#include "datasets/google_message4/benchmark_message4.pb.h" +#include "benchmarks/datasets/google_message1/proto2/benchmark_message1_proto2.pb.h" +#include "benchmarks/datasets/google_message1/proto3/benchmark_message1_proto3.pb.h" +#include "benchmarks/datasets/google_message2/benchmark_message2.pb.h" +#include "benchmarks/datasets/google_message3/benchmark_message3.pb.h" +#include "benchmarks/datasets/google_message4/benchmark_message4.pb.h" #include "data_proto2_to_proto3_util.h" #include diff --git a/benchmarks/util/protoc-gen-gogoproto.cc b/benchmarks/util/protoc-gen-gogoproto.cc deleted file mode 100644 index 9c1b3d04e8..0000000000 --- a/benchmarks/util/protoc-gen-gogoproto.cc +++ /dev/null @@ -1,103 +0,0 @@ -#include "google/protobuf/compiler/code_generator.h" -#include "google/protobuf/io/zero_copy_stream.h" -#include "google/protobuf/io/printer.h" -#include "google/protobuf/descriptor.h" -#include "google/protobuf/descriptor.pb.h" -#include "schema_proto2_to_proto3_util.h" - -#include "google/protobuf/compiler/plugin.h" - -using google::protobuf::FileDescriptorProto; -using google::protobuf::FileDescriptor; -using google::protobuf::DescriptorPool; -using google::protobuf::io::Printer; -using google::protobuf::util::SchemaGroupStripper; -using google::protobuf::util::EnumScrubber; - -namespace google { -namespace protobuf { -namespace compiler { - -namespace { - -string StripProto(string filename) { - if (filename.substr(filename.size() - 11) == ".protodevel") { - // .protodevel - return filename.substr(0, filename.size() - 11); - } else { - // .proto - return filename.substr(0, filename.size() - 6); - } -} - -DescriptorPool new_pool_; - -} // namespace - -class GoGoProtoGenerator : public CodeGenerator { - public: - virtual bool GenerateAll(const std::vector& files, - const string& parameter, - GeneratorContext* context, - string* error) const { - for (int i = 0; i < files.size(); i++) { - for (auto file : files) { - bool can_generate = - (new_pool_.FindFileByName(file->name()) == nullptr); - for (int j = 0; j < file->dependency_count(); j++) { - can_generate &= (new_pool_.FindFileByName( - file->dependency(j)->name()) != nullptr); - } - for (int j = 0; j < file->public_dependency_count(); j++) { - can_generate &= (new_pool_.FindFileByName( - file->public_dependency(j)->name()) != nullptr); - } - for (int j = 0; j < file->weak_dependency_count(); j++) { - can_generate &= (new_pool_.FindFileByName( - file->weak_dependency(j)->name()) != nullptr); - } - if (can_generate) { - Generate(file, parameter, context, error); - break; - } - } - } - - return true; - } - - virtual bool Generate(const FileDescriptor* file, - const string& parameter, - GeneratorContext* context, - string* error) const { - FileDescriptorProto new_file; - file->CopyTo(&new_file); - SchemaGroupStripper::StripFile(file, &new_file); - - EnumScrubber enum_scrubber; - enum_scrubber.ScrubFile(&new_file); - - string filename = file->name(); - string basename = StripProto(filename); - - std::vector> option_pairs; - ParseGeneratorParameter(parameter, &option_pairs); - - std::unique_ptr output( - context->Open(basename + ".proto")); - string content = new_pool_.BuildFile(new_file)->DebugString(); - Printer printer(output.get(), '$'); - printer.WriteRaw(content.c_str(), content.size()); - - return true; - } -}; - -} // namespace compiler -} // namespace protobuf -} // namespace google - -int main(int argc, char* argv[]) { - google::protobuf::compiler::GoGoProtoGenerator generator; - return google::protobuf::compiler::PluginMain(argc, argv, &generator); -} diff --git a/benchmarks/util/protoc-gen-proto2_to_proto3.cc b/benchmarks/util/protoc-gen-proto2_to_proto3.cc index d0a8902347..3073e0f02f 100644 --- a/benchmarks/util/protoc-gen-proto2_to_proto3.cc +++ b/benchmarks/util/protoc-gen-proto2_to_proto3.cc @@ -15,6 +15,7 @@ using google::protobuf::util::SchemaGroupStripper; using google::protobuf::util::EnumScrubber; using google::protobuf::util::ExtensionStripper; using google::protobuf::util::FieldScrubber; +using google::protobuf::util::ImportScrubber; namespace google { namespace protobuf { @@ -22,7 +23,7 @@ namespace compiler { namespace { -string StripProto(string filename) { +std::string StripProtoExt(const std::string& filename) { return filename.substr(0, filename.rfind(".proto")); } @@ -36,9 +37,9 @@ DescriptorPool* GetPool() { class Proto2ToProto3Generator final : public CodeGenerator { public: bool GenerateAll(const std::vector& files, - const string& parameter, + const std::string& parameter, GeneratorContext* context, - string* error) const { + std::string* error) const { for (int i = 0; i < files.size(); i++) { for (auto file : files) { if (CanGenerate(file)) { @@ -52,28 +53,30 @@ class Proto2ToProto3Generator final : public CodeGenerator { } bool Generate(const FileDescriptor* file, - const string& parameter, + const std::string& parameter, GeneratorContext* context, - string* error) const { + std::string* error) const { FileDescriptorProto new_file; file->CopyTo(&new_file); + new_file.set_name(ImportScrubber::ScrubFilename(file->name())); SchemaGroupStripper::StripFile(file, &new_file); EnumScrubber enum_scrubber; enum_scrubber.ScrubFile(&new_file); ExtensionStripper::StripFile(&new_file); FieldScrubber::ScrubFile(&new_file); + ImportScrubber::ScrubFile(&new_file); new_file.set_syntax("proto3"); - string filename = file->name(); - string basename = StripProto(filename); + std::string filename = file->name(); + std::string basename = StripProtoExt(filename); - std::vector> option_pairs; + std::vector> option_pairs; ParseGeneratorParameter(parameter, &option_pairs); std::unique_ptr output( - context->Open(basename + ".proto")); - string content = GetPool()->BuildFile(new_file)->DebugString(); + context->Open(basename + ".proto3")); + std::string content = GetPool()->BuildFile(new_file)->DebugString(); Printer printer(output.get(), '$'); printer.WriteRaw(content.c_str(), content.size()); @@ -81,11 +84,12 @@ class Proto2ToProto3Generator final : public CodeGenerator { } private: bool CanGenerate(const FileDescriptor* file) const { - if (GetPool()->FindFileByName(file->name()) != nullptr) { + if (GetPool()->FindFileByName(ImportScrubber::ScrubFilename(file->name())) != nullptr) { return false; } for (int j = 0; j < file->dependency_count(); j++) { - if (GetPool()->FindFileByName(file->dependency(j)->name()) == nullptr) { + if (GetPool()->FindFileByName(ImportScrubber::ScrubFilename( + file->dependency(j)->name())) == nullptr) { return false; } } diff --git a/benchmarks/util/result_parser.py b/benchmarks/util/result_parser.py index d3251a8b26..a35c1dbbb2 100644 --- a/benchmarks/util/result_parser.py +++ b/benchmarks/util/result_parser.py @@ -1,5 +1,3 @@ -# This import depends on the automake rule protoc_middleman, please make sure -# protoc_middleman has been built before run this file. import argparse import json import re @@ -8,7 +6,7 @@ import os.path import sys sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)) # END OPENSOURCE -import tmp.benchmarks_pb2 as benchmarks_pb2 +from benchmarks import benchmarks_pb2 __file_size_map = {} diff --git a/benchmarks/util/schema_proto2_to_proto3_util.h b/benchmarks/util/schema_proto2_to_proto3_util.h index 0079f6f145..ea7b796560 100644 --- a/benchmarks/util/schema_proto2_to_proto3_util.h +++ b/benchmarks/util/schema_proto2_to_proto3_util.h @@ -187,6 +187,18 @@ class FieldScrubber { } }; +class ImportScrubber { + public: + static std::string ScrubFilename(const std::string& filename) { + return filename + "3"; + } + static void ScrubFile(FileDescriptorProto *file) { + for(std::string& import: *file->mutable_dependency()) { + import += "3"; + } + } +}; + } // namespace util } // namespace protobuf } // namespace google diff --git a/build_defs/BUILD.bazel b/build_defs/BUILD.bazel index a5d831c9a8..4ac09c8298 100644 --- a/build_defs/BUILD.bazel +++ b/build_defs/BUILD.bazel @@ -17,6 +17,16 @@ create_compiler_config_setting( value = "msvc-cl", ) +config_setting( + name = "aarch64", + values = {"cpu": "linux-aarch_64"}, +) + +config_setting( + name = "x86_64", + values = {"cpu": "linux-x86_64"}, +) + # Android NDK builds can specify different crosstool_top flags to choose which # STL they use for C++. We need these multiple variants to catch all of those # versions of crosstool_top and reliably detect Android. diff --git a/build_defs/arch_tests.bzl b/build_defs/arch_tests.bzl new file mode 100644 index 0000000000..7f8a6af515 --- /dev/null +++ b/build_defs/arch_tests.bzl @@ -0,0 +1,56 @@ +"""Generated unittests to verify that a binary is built for the expected architecture.""" + +load("//build_defs:internal_shell.bzl", "inline_sh_test") + +def _arch_test_impl( + name, + platform, + file_platform, + bazel_binaries = [], + system_binaries = [], + **kwargs): + """ + Bazel rule to verify that a Bazel or system binary is built for the + aarch64 architecture. + + Args: + name: the name of the test. + platform: a diagnostic name for this architecture. + file_platform: the expected output of `file`. + bazel_binaries: a set of binary targets to inspect. + system_binaries: a set of paths to system executables to inspect. + **kargs: other keyword arguments that are passed to the test. + """ + + inline_sh_test( + name = name, + tools = bazel_binaries, + cmd = """ + for binary in "$(rootpaths %s) %s"; do + (file -L $$binary | grep -q "%s") \ + || (echo "Test binary is not an %s binary: "; file -L $$binary; exit 1) + done + """ % (" ".join(bazel_binaries), + " ".join(system_binaries), + file_platform, + platform), + target_compatible_with = select({ + "//build_defs:"+platform: [], + "//conditions:default": ["@platforms//:incompatible"], + }), + ) + + +def aarch64_test(**kwargs): + _arch_test_impl( + platform = "aarch64", + file_platform = "ELF 64-bit LSB executable, ARM aarch64", + **kwargs, + ) + +def x86_64_test(**kwargs): + _arch_test_impl( + platform = "x86_64", + file_platform = "ELF 64-bit LSB executable, ARM x86_64", + **kwargs, + ) diff --git a/build_defs/internal_shell.bzl b/build_defs/internal_shell.bzl new file mode 100644 index 0000000000..0dda1464a5 --- /dev/null +++ b/build_defs/internal_shell.bzl @@ -0,0 +1,85 @@ +def inline_sh_binary( + name, + srcs = [], + tools = [], + deps = [], + cmd = "", + testonly = None, + **kwargs): + """Bazel rule to wrap up an inline bash script in a binary. This is most + useful as a stop-gap solution for migrating off Autotools. These binaries + are likely to be non-hermetic, with implicit system dependencies. + + NOTE: the rule is only an internal workaround. The interface may change and + the rule may be removed when everything is properly "Bazelified". + + Args: + name: the name of the inline_sh_binary. + srcs: the files used directly by the script. + tools: the executable tools used directly by the script. Any target used + with rootpath/execpath/location must be declared here or in `srcs`. + deps: a list of dependency labels that are required to run this binary. + **kargs: other keyword arguments that are passed to sh_binary. + testonly: common rule attribute (see: + https://bazel.build/reference/be/common-definitions#common-attributes) + """ + + + native.genrule( + name = name + "_genrule", + srcs = srcs, + exec_tools = tools, + outs = [name + ".sh"], + cmd = "cat <<'EOF' >$(OUTS)\n#!/bin/bash -exu\n%s\nEOF\n" % cmd, + testonly = testonly, + visibility = ["//visibility:private"], + ) + + native.sh_binary( + name = name, + srcs = [name + "_genrule"], + data = srcs + tools + deps, + testonly = testonly, + **kwargs + ) + +def inline_sh_test( + name, + srcs = [], + tools = [], + deps = [], + cmd = "", + **kwargs): + """Bazel rule to wrap up an inline bash script in a test. This is most + useful as a stop-gap solution for migrating off Autotools. These tests + are likely to be non-hermetic, with implicit system dependencies. + + NOTE: the rule is only an internal workaround. The interface may change and + the rule may be removed when everything is properly "Bazelified". + + Args: + name: the name of the inline_sh_binary. + srcs: the files used directly by the script. + tools: the executable tools used directly by the script. Any target used + with rootpath/execpath/location must be declared here or in `srcs`. + deps: a list of dependency labels that are required to run this binary. + **kargs: other keyword arguments that are passed to sh_binary. + https://bazel.build/reference/be/common-definitions#common-attributes) + """ + + + native.genrule( + name = name + "_genrule", + srcs = srcs, + exec_tools = tools, + outs = [name + ".sh"], + cmd = "cat <<'EOF' >$(OUTS)\n#!/bin/bash -exu\n%s\nEOF\n" % cmd, + visibility = ["//visibility:private"], + ) + + native.sh_test( + name = name, + srcs = [name + "_genrule"], + data = srcs + tools + deps, + **kwargs + ) diff --git a/cmake/conformance.cmake b/cmake/conformance.cmake index 338b2757a5..3397fa3851 100644 --- a/cmake/conformance.cmake +++ b/cmake/conformance.cmake @@ -42,11 +42,11 @@ add_executable(conformance_cpp target_include_directories( conformance_test_runner - PUBLIC ${protobuf_SOURCE_DIR}/conformance) + PUBLIC ${protobuf_SOURCE_DIR} ${protobuf_SOURCE_DIR}/conformance) target_include_directories( conformance_cpp - PUBLIC ${protobuf_SOURCE_DIR}/conformance) + PUBLIC ${protobuf_SOURCE_DIR}) target_link_libraries(conformance_test_runner ${protobuf_LIB_PROTOBUF}) target_link_libraries(conformance_cpp ${protobuf_LIB_PROTOBUF}) diff --git a/cmake/install.cmake b/cmake/install.cmake index cf24e307c1..9379aa77a6 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -62,43 +62,6 @@ foreach(_header ${protobuf_HEADERS}) RENAME "${_extract_name}") endforeach() -# Internal function for parsing auto tools scripts -function(_protobuf_auto_list FILE_NAME VARIABLE) - file(STRINGS ${FILE_NAME} _strings) - set(_list) - foreach(_string ${_strings}) - set(_found) - string(REGEX MATCH "^[ \t]*${VARIABLE}[ \t]*=[ \t]*" _found "${_string}") - if(_found) - string(LENGTH "${_found}" _length) - string(SUBSTRING "${_string}" ${_length} -1 _draft_list) - foreach(_item ${_draft_list}) - string(STRIP "${_item}" _item) - list(APPEND _list "${_item}") - endforeach() - endif() - endforeach() - set(${VARIABLE} ${_list} PARENT_SCOPE) -endfunction() - -# Install well-known type proto files -_protobuf_auto_list("${protobuf_SOURCE_DIR}/src/Makefile.am" nobase_dist_proto_DATA) -foreach(_file ${nobase_dist_proto_DATA}) - get_filename_component(_file_from "${protobuf_SOURCE_DIR}/src/${_file}" ABSOLUTE) - get_filename_component(_file_name ${_file} NAME) - get_filename_component(_dir ${_file} DIRECTORY) - if(EXISTS "${_file_from}") - install(FILES "${_file_from}" - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${_dir}" - COMPONENT protobuf-protos - RENAME "${_file_name}") - else() - message(AUTHOR_WARNING "The file \"${_file_from}\" is listed in " - "\"${protobuf_SOURCE_DIR}/src/Makefile.am\" as nobase_dist_proto_DATA " - "but there not exists. The file will not be installed.") - endif() -endforeach() - # Install configuration set(_install_cmakedir_desc "Directory relative to CMAKE_INSTALL to install the cmake configuration files") set(_build_cmakedir_desc "Directory relative to CMAKE_CURRENT_BINARY_DIR for cmake configuration files") diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 375a79d93a..0000000000 --- a/configure.ac +++ /dev/null @@ -1,247 +0,0 @@ -## Process this file with autoconf to produce configure. -## In general, the safest way to proceed is to run ./autogen.sh - -AC_PREREQ(2.59) - -# Note: If you change the version, you must also update it in: -# * Protobuf.podspec -# * csharp/Google.Protobuf.Tools.nuspec -# * csharp/src/*/AssemblyInfo.cs -# * csharp/src/Google.Protobuf/Google.Protobuf.nuspec -# * java/*/pom.xml -# * python/google/protobuf/__init__.py -# * protoc-artifacts/pom.xml -# * src/google/protobuf/stubs/common.h -# * src/Makefile.am (Update -version-info for LDFLAGS if needed) -# -# In the SVN trunk, the version should always be the next anticipated release -# version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed -# the size of one file name in the dist tarfile over the 99-char limit.) -AC_INIT([Protocol Buffers],[3.21.5],[protobuf@googlegroups.com],[protobuf]) - -AM_MAINTAINER_MODE([enable]) - -AC_CONFIG_SRCDIR(src/google/protobuf/message.cc) -# The config file is generated but not used by the source code, since we only -# need very few of them, e.g. HAVE_PTHREAD and HAVE_ZLIB. Those macros are -# passed down in CXXFLAGS manually in src/Makefile.am -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_MACRO_DIR([m4]) - -AC_ARG_VAR(DIST_LANG, [language to include in the distribution package (i.e., make dist)]) -case "$DIST_LANG" in - "") DIST_LANG=all ;; - all | cpp | csharp | java | python | javanano | objectivec | ruby | php) ;; - *) AC_MSG_FAILURE([unknown language: $DIST_LANG]) ;; -esac -AC_SUBST(DIST_LANG) - -# autoconf's default CXXFLAGS are usually "-g -O2". These aren't necessarily -# the best choice for libprotobuf. -AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"], - [CFLAGS=""]) -AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"], - [CXXFLAGS=""]) - -AC_CANONICAL_TARGET - -AM_INIT_AUTOMAKE([1.9 tar-ustar subdir-objects]) - -# Silent rules enabled: the output is minimal but informative. -# In particular, the warnings from the compiler stick out very clearly. -# To see all logs, use the --disable-silent-rules on configure or via make V=1 -AM_SILENT_RULES([yes]) - -AC_ARG_WITH([zlib], - [AS_HELP_STRING([--with-zlib], - [include classes for streaming compressed data in and out @<:@default=check@:>@])], - [],[with_zlib=check]) - -AC_ARG_WITH([zlib-include], - [AS_HELP_STRING([--with-zlib-include=PATH], - [zlib include directory])], - [CPPFLAGS="-I$withval $CPPFLAGS"]) - -AC_ARG_WITH([zlib-lib], - [AS_HELP_STRING([--with-zlib-lib=PATH], - [zlib lib directory])], - [LDFLAGS="-L$withval $LDFLAGS"]) - -AC_ARG_WITH([protoc], - [AS_HELP_STRING([--with-protoc=COMMAND], - [use the given protoc command instead of building a new one when building tests (useful for cross-compiling)])], - [],[with_protoc=no]) - -# Checks for programs. -AC_PROG_CC -AC_PROG_CXX -AC_PROG_CXX_FOR_BUILD -AC_LANG([C++]) -ACX_USE_SYSTEM_EXTENSIONS -m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) -AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc -AS_CASE([$target_os], [darwin*], [AC_PROG_OBJC], [AM_CONDITIONAL([am__fastdepOBJC], [false])]) - -# test_util.cc takes forever to compile with GCC and optimization turned on. -AC_MSG_CHECKING([C++ compiler flags...]) -AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],[ - AS_IF([test "$GCC" = "yes"],[ - PROTOBUF_OPT_FLAG="-O2" - CXXFLAGS="${CXXFLAGS} -g" - ]) - - # Protocol Buffers contains several checks that are intended to be used only - # for debugging and which might hurt performance. Most users are probably - # end users who don't want these checks, so add -DNDEBUG by default. - CXXFLAGS="$CXXFLAGS -std=c++11 -DNDEBUG" - - AC_MSG_RESULT([use default: $PROTOBUF_OPT_FLAG $CXXFLAGS]) -],[ - AC_MSG_RESULT([use user-supplied: $CXXFLAGS]) -]) - -AC_SUBST(PROTOBUF_OPT_FLAG) - -ACX_CHECK_SUNCC - -# Have to do libtool after SUNCC, other wise it "helpfully" adds Crun Cstd -# to the link -AC_PROG_LIBTOOL - -# Check whether the linker supports version scripts -AC_MSG_CHECKING([whether the linker supports version scripts]) -save_LDFLAGS=$LDFLAGS -LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" -cat > conftest.map < - #if !defined(ZLIB_VERNUM) || (ZLIB_VERNUM < 0x1204) - # error zlib version too old - #endif - ]], [])], [ - AC_MSG_RESULT([ok (1.2.0.4 or later)]) - - # Also need to add -lz to the linker flags and make sure this succeeds. - AC_SEARCH_LIBS([zlibVersion], [z], [ - AC_DEFINE([HAVE_ZLIB], [1], [Enable classes using zlib compression.]) - HAVE_ZLIB=1 - ], [ - AS_IF([test "$with_zlib" != check], [ - AC_MSG_FAILURE([--with-zlib was given, but no working zlib library was found]) - ]) - ]) - ], [ - AS_IF([test "$with_zlib" = check], [ - AC_MSG_RESULT([headers missing or too old (requires 1.2.0.4)]) - ], [ - AC_MSG_FAILURE([--with-zlib was given, but zlib headers were not present or were too old (requires 1.2.0.4)]) - ]) - ]) -]) -AM_CONDITIONAL([HAVE_ZLIB], [test $HAVE_ZLIB = 1]) - -# Add -std=c++11 if necesssary. It is important for us to do this before the -# libatomic check below, since that also depends on C++11. -AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory]) - -dnl On some platforms, std::atomic needs a helper library -AC_MSG_CHECKING(whether -latomic is needed) -AC_LINK_IFELSE([AC_LANG_SOURCE([[ - #include - #include - std::atomic v; - int main() { - return v; - } -]])], STD_ATOMIC_NEED_LIBATOMIC=no, STD_ATOMIC_NEED_LIBATOMIC=yes) -AC_MSG_RESULT($STD_ATOMIC_NEED_LIBATOMIC) -if test "x$STD_ATOMIC_NEED_LIBATOMIC" = xyes; then - LIBATOMIC_LIBS="-latomic" -fi -AC_SUBST([LIBATOMIC_LIBS]) - -AS_IF([test "$with_protoc" != "no"], [ - PROTOC=$with_protoc - AS_IF([test "$with_protoc" = "yes"], [ - # No argument given. Use system protoc. - PROTOC=protoc - ]) - AS_IF([echo "$PROTOC" | grep -q '^@<:@^/@:>@.*/'], [ - # Does not start with a slash, but contains a slash. So, it's a relative - # path (as opposed to an absolute path or an executable in $PATH). - # Since it will actually be executed from the src directory, prefix with - # the current directory. We also insert $ac_top_build_prefix in case this - # is a nested package and --with-protoc was actually given on the outer - # package's configure script. - PROTOC=`pwd`/${ac_top_build_prefix}$PROTOC - ]) - AC_SUBST([PROTOC]) -]) -AM_CONDITIONAL([USE_EXTERNAL_PROTOC], [test "$with_protoc" != "no"]) - -AX_PTHREAD -AM_CONDITIONAL([HAVE_PTHREAD], [test "x$ax_pthread_ok" = "xyes"]) -# We still keep this for improving pbconfig.h for unsupported platforms. -AC_CXX_STL_HASH - -# Enable ObjC support for conformance directory on OS X. -OBJC_CONFORMANCE_TEST=0 -case "$target_os" in - darwin*) - OBJC_CONFORMANCE_TEST=1 - ;; -esac -AM_CONDITIONAL([OBJC_CONFORMANCE_TEST], [test $OBJC_CONFORMANCE_TEST = 1]) - -AC_MSG_CHECKING(whether -llog is needed) -ANDROID_TEST=no -case "$target_os" in - *android*) - ANDROID_TEST=yes - ;; -esac -AC_MSG_RESULT($ANDROID_TEST) -if test "x$ANDROID_TEST" = xyes; then - LIBLOG_LIBS="-llog" -fi -AC_SUBST([LIBLOG_LIBS]) - -# HACK: Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS, -# since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock -# too. -export CFLAGS -export CXXFLAGS -AC_CONFIG_SUBDIRS([third_party/googletest]) - -AC_CONFIG_FILES([Makefile src/Makefile benchmarks/Makefile conformance/Makefile protobuf.pc protobuf-lite.pc]) -AC_OUTPUT diff --git a/conformance/BUILD.bazel b/conformance/BUILD.bazel index fef0366001..0e7ad5929b 100644 --- a/conformance/BUILD.bazel +++ b/conformance/BUILD.bazel @@ -1,6 +1,9 @@ # Conformance testing for Protobuf. -load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_proto_library") +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_proto_library", "objc_library") +load("@rules_python//python:defs.bzl", "py_library") +load("//:protobuf.bzl", "internal_py_proto_library", "internal_php_proto_library", "internal_csharp_proto_library", "internal_ruby_proto_library", "internal_objc_proto_library") +load("//build_defs:internal_shell.bzl", "inline_sh_binary") load( "@rules_pkg//:mappings.bzl", "pkg_attributes", @@ -11,20 +14,37 @@ load( exports_files([ "conformance_test_runner.sh", + "failure_list_cpp.txt", + "failure_list_csharp.txt", "failure_list_java.txt", "failure_list_java_lite.txt", + "failure_list_objc.txt", + "failure_list_php.txt", + "failure_list_php_c.txt", + "failure_list_python.txt", + "failure_list_python_cpp.txt", + "failure_list_ruby.txt", + "failure_list_jruby.txt", + "text_format_failure_list_cpp.txt", + "text_format_failure_list_csharp.txt", "text_format_failure_list_java.txt", "text_format_failure_list_java_lite.txt", + "text_format_failure_list_php.txt", + "text_format_failure_list_php_c.txt", + "text_format_failure_list_python.txt", + "text_format_failure_list_python_cpp.txt", + "text_format_failure_list_ruby.txt", + "text_format_failure_list_jruby.txt", ]) cc_proto_library( name = "test_messages_proto2_proto_cc", - deps = ["//:test_messages_proto2_proto"], + deps = ["//src/google/protobuf:test_messages_proto2_proto"], ) cc_proto_library( name = "test_messages_proto3_proto_cc", - deps = ["//:test_messages_proto3_proto"], + deps = ["//src/google/protobuf:test_messages_proto3_proto"], ) proto_library( @@ -34,10 +54,18 @@ proto_library( ) cc_proto_library( - name = "conformance_proto_cc", + name = "conformance_cc_proto", deps = [":conformance_proto"], ) +internal_csharp_proto_library( + name = "conformance_csharp_proto", + srcs = ["conformance.proto"], + visibility = [ + "//csharp:__subpackages__", + ], +) + java_proto_library( name = "conformance_java_proto", visibility = [ @@ -54,6 +82,51 @@ java_lite_proto_library( deps = [":conformance_proto"], ) +internal_objc_proto_library( + name = "conformance_objc_proto", + srcs = ["conformance.proto"], + visibility = [ + "//conformance:__pkg__", + "//objc:__pkg__", + ], +) + +internal_py_proto_library( + name = "conformance_py_proto", + srcs = ["conformance.proto"], + visibility = [ + "//python:__subpackages__", + ], + srcs_version = "PY2AND3", +) + +internal_php_proto_library( + name = "conformance_php_proto", + srcs = ["conformance.proto"], + outs = [ + "Conformance/ConformanceRequest.php", + "Conformance/ConformanceResponse.php", + "Conformance/FailureSet.php", + "Conformance/JspbEncodingConfig.php", + "Conformance/TestCategory.php", + "Conformance/WireFormat.php", + "GPBMetadata/Conformance.php", + ], + visibility = [ + "//conformance:__pkg__", + "//php:__pkg__", + ], +) + +internal_ruby_proto_library( + name = "conformance_ruby_proto", + srcs = ["conformance.proto"], + visibility = [ + "//conformance:__pkg__", + "//ruby:__pkg__", + ], +) + cc_library( name = "jsoncpp", srcs = ["third_party/jsoncpp/jsoncpp.cpp"], @@ -71,7 +144,7 @@ cc_library( "conformance_test.h", ], includes = ["."], - deps = [":conformance_proto_cc"], + deps = [":conformance_cc_proto"], ) cc_library( @@ -108,13 +181,23 @@ cc_binary( ], ) +cc_binary( + name = "conformance_cpp", + srcs = ["conformance_cpp.cc"], + deps = [ + ":conformance_cc_proto", + "//:protobuf", + "//:test_messages_proto2_cc_proto", + "//:test_messages_proto3_cc_proto", + ], + testonly = 1, + visibility = ["//src:__subpackages__"], +) + java_binary( name = "conformance_java", srcs = ["ConformanceJava.java"], main_class = "ConformanceJava", - visibility = [ - "//java:__subpackages__", - ], deps = [ ":conformance_java_proto", "//:protobuf_java", @@ -122,11 +205,14 @@ java_binary( "//:test_messages_proto2_java_proto", "//:test_messages_proto3_java_proto", ], + testonly = 1, + visibility = [ + "//java:__subpackages__", + ], ) java_binary( name = "conformance_java_lite", - srcs = ["ConformanceJavaLite.java"], main_class = "ConformanceJavaLite", visibility = [ "//java:__subpackages__", @@ -138,8 +224,116 @@ java_binary( "//:test_messages_proto2_java_proto_lite", "//:test_messages_proto3_java_proto_lite", ], + testonly = 1, + srcs = ["ConformanceJavaLite.java"], ) +py_binary( + name = "conformance_python", + srcs = ["conformance_python.py"], + deps = [ + ":conformance_py_proto", + "//:protobuf_python", + "//python:test_messages_proto2_py_proto", + "//python:test_messages_proto3_py_proto", + ], + imports = [".", "../python"], + srcs_version = "PY2AND3", + testonly = 1, + visibility = ["//python:__subpackages__"], +) + +inline_sh_binary( + name = "conformance_php", + srcs = [ + "conformance_php.php", + "autoload.php", + ], + deps = [ + ":conformance_php_proto", + "//php:source_files", + "//:test_messages_proto3_php_proto", + ], + cmd = """ + php -d include_path=conformance:src/google/protobuf \\ + -d auto_prepend_file=$(rootpath autoload.php) \\ + $(rootpath conformance_php.php) + """, + testonly = 1, + visibility = ["//php:__subpackages__"], +) + +inline_sh_binary( + name = "conformance_php_c", + srcs = [ + "conformance_php.php", + "//php:extension", + ], + deps = [ + ":conformance_php_proto", + "//:test_messages_proto3_php_proto", + ], + cmd = """ + php -dextension=$(rootpath //php:extension) \\ + -d include_path=conformance:src/google/protobuf \\ + $(rootpath conformance_php.php) + """, + testonly = 1, + visibility = ["//php:__subpackages__"], +) + +inline_sh_binary( + name = "conformance_csharp", + srcs = ["//csharp/src/Google.Protobuf.Conformance:conformance_dll"], + deps = [ + "//csharp/src/Google.Protobuf.Conformance:conformance_runfiles", + ], + cmd = "dotnet $(rootpath //csharp/src/Google.Protobuf.Conformance:conformance_dll)", + testonly = 1, + visibility = ["//csharp:__subpackages__"], +) + +objc_library( + name = "conformance_objc_lib", + non_arc_srcs = ["conformance_objc.m"], + deps = [ + ":conformance_objc_proto", + "//:test_messages_proto2_objc_proto", + "//:test_messages_proto3_objc_proto", + ], + testonly = 1, + # See https://github.com/bazelbuild/bazel/issues/12897. + tags = ["manual"], +) + +cc_binary( + name = "conformance_objc", + deps = [":conformance_objc_lib"], + testonly = 1, + # See https://github.com/bazelbuild/bazel/issues/12897. + tags = ["manual"], + visibility = ["//objectivec:__subpackages__"], +) + +inline_sh_binary( + name = "conformance_ruby", + srcs = ["conformance_ruby.rb"], + deps = [ + ":conformance_ruby_proto", + "//:well_known_ruby_protos", + "//:test_messages_proto2_ruby_proto", + "//:test_messages_proto3_ruby_proto", + "//ruby:protobuf", + ], + cmd = "RUBYLIB=ruby/lib:conformance:src $(rootpath conformance_ruby.rb)", + testonly = 1, + visibility = ["//ruby:__subpackages__"], +) + +################################################################################ +# Distribution files +################################################################################ + filegroup( name = "all_files", srcs = glob(["**/*"]), @@ -156,7 +350,6 @@ pkg_files( # The following are not in autotools dist: "autoload.php", - "conformance_nodejs.js", "failure_list_jruby.txt", "update_failure_list.py", ], diff --git a/conformance/Makefile.am b/conformance/Makefile.am deleted file mode 100644 index 415412bcae..0000000000 --- a/conformance/Makefile.am +++ /dev/null @@ -1,372 +0,0 @@ -## Process this file with automake to produce Makefile.in - -conformance_protoc_inputs = \ - conformance.proto \ - $(top_srcdir)/src/google/protobuf/test_messages_proto3.proto - -# proto2 input files, should be separated with proto3, as we -# can't generate proto2 files for php. -conformance_proto2_protoc_inputs = \ - $(top_srcdir)/src/google/protobuf/test_messages_proto2.proto - -well_known_type_protoc_inputs = \ - $(top_srcdir)/src/google/protobuf/any.proto \ - $(top_srcdir)/src/google/protobuf/duration.proto \ - $(top_srcdir)/src/google/protobuf/field_mask.proto \ - $(top_srcdir)/src/google/protobuf/struct.proto \ - $(top_srcdir)/src/google/protobuf/timestamp.proto \ - $(top_srcdir)/src/google/protobuf/wrappers.proto - - -protoc_outputs = \ - conformance.pb.cc \ - conformance.pb.h - -other_language_protoc_outputs = \ - conformance_pb2.py \ - Conformance.pbobjc.h \ - Conformance.pbobjc.m \ - conformance_pb.js \ - conformance_pb.rb \ - com/google/protobuf/Any.java \ - com/google/protobuf/AnyOrBuilder.java \ - com/google/protobuf/AnyProto.java \ - com/google/protobuf/BoolValue.java \ - com/google/protobuf/BoolValueOrBuilder.java \ - com/google/protobuf/BytesValue.java \ - com/google/protobuf/BytesValueOrBuilder.java \ - com/google/protobuf/conformance/Conformance.java \ - com/google/protobuf/DoubleValue.java \ - com/google/protobuf/DoubleValueOrBuilder.java \ - com/google/protobuf/Duration.java \ - com/google/protobuf/DurationOrBuilder.java \ - com/google/protobuf/DurationProto.java \ - com/google/protobuf/FieldMask.java \ - com/google/protobuf/FieldMaskOrBuilder.java \ - com/google/protobuf/FieldMaskProto.java \ - com/google/protobuf/FloatValue.java \ - com/google/protobuf/FloatValueOrBuilder.java \ - com/google/protobuf/Int32Value.java \ - com/google/protobuf/Int32ValueOrBuilder.java \ - com/google/protobuf/Int64Value.java \ - com/google/protobuf/Int64ValueOrBuilder.java \ - com/google/protobuf/ListValue.java \ - com/google/protobuf/ListValueOrBuilder.java \ - com/google/protobuf/NullValue.java \ - com/google/protobuf/StringValue.java \ - com/google/protobuf/StringValueOrBuilder.java \ - com/google/protobuf/Struct.java \ - com/google/protobuf/StructOrBuilder.java \ - com/google/protobuf/StructProto.java \ - com/google/protobuf/Timestamp.java \ - com/google/protobuf/TimestampOrBuilder.java \ - com/google/protobuf/TimestampProto.java \ - com/google/protobuf/UInt32Value.java \ - com/google/protobuf/UInt32ValueOrBuilder.java \ - com/google/protobuf/UInt64Value.java \ - com/google/protobuf/UInt64ValueOrBuilder.java \ - com/google/protobuf/Value.java \ - com/google/protobuf/ValueOrBuilder.java \ - com/google/protobuf/WrappersProto.java \ - com/google/protobuf_test_messages/proto3/TestMessagesProto3.java \ - com/google/protobuf_test_messages/proto2/TestMessagesProto2.java \ - google/protobuf/any.pb.cc \ - google/protobuf/any.pb.h \ - google/protobuf/any.rb \ - google/protobuf/any_pb2.py \ - google/protobuf/duration.pb.cc \ - google/protobuf/duration.pb.h \ - google/protobuf/duration.rb \ - google/protobuf/duration_pb2.py \ - google/protobuf/field_mask.pb.cc \ - google/protobuf/field_mask.pb.h \ - google/protobuf/field_mask.rb \ - google/protobuf/field_mask_pb2.py \ - google/protobuf/struct.pb.cc \ - google/protobuf/struct.pb.h \ - google/protobuf/struct.rb \ - google/protobuf/struct_pb2.py \ - google/protobuf/TestMessagesProto2.pbobjc.h \ - google/protobuf/TestMessagesProto2.pbobjc.m \ - google/protobuf/TestMessagesProto3.pbobjc.h \ - google/protobuf/TestMessagesProto3.pbobjc.m \ - google/protobuf/test_messages_proto3.pb.cc \ - google/protobuf/test_messages_proto3.pb.h \ - google/protobuf/test_messages_proto2.pb.cc \ - google/protobuf/test_messages_proto2.pb.h \ - google/protobuf/test_messages_proto3_pb.rb \ - google/protobuf/test_messages_proto3_pb2.py \ - google/protobuf/test_messages_proto2_pb2.py \ - google/protobuf/timestamp.pb.cc \ - google/protobuf/timestamp.pb.h \ - google/protobuf/timestamp.rb \ - google/protobuf/timestamp_pb2.py \ - google/protobuf/wrappers.pb.cc \ - google/protobuf/wrappers.pb.h \ - google/protobuf/wrappers.rb \ - google/protobuf/wrappers_pb2.py \ - Conformance/ConformanceRequest.php \ - Conformance/ConformanceResponse.php \ - Conformance/FailureSet.php \ - Conformance/WireFormat.php \ - GPBMetadata/Conformance.php \ - GPBMetadata/Google/Protobuf/Any.php \ - GPBMetadata/Google/Protobuf/Duration.php \ - GPBMetadata/Google/Protobuf/FieldMask.php \ - GPBMetadata/Google/Protobuf/Struct.php \ - GPBMetadata/Google/Protobuf/TestMessagesProto3.php \ - GPBMetadata/Google/Protobuf/Timestamp.php \ - GPBMetadata/Google/Protobuf/Wrappers.php \ - Google/Protobuf/Any.php \ - Google/Protobuf/BoolValue.php \ - Google/Protobuf/BytesValue.php \ - Google/Protobuf/DoubleValue.php \ - Google/Protobuf/Duration.php \ - Google/Protobuf/FieldMask.php \ - Google/Protobuf/FloatValue.php \ - Google/Protobuf/Int32Value.php \ - Google/Protobuf/Int64Value.php \ - Google/Protobuf/ListValue.php \ - Google/Protobuf/NullValue.php \ - Google/Protobuf/StringValue.php \ - Google/Protobuf/Struct.php \ - Google/Protobuf/Timestamp.php \ - Google/Protobuf/UInt32Value.php \ - Google/Protobuf/UInt64Value.php \ - Google/Protobuf/Value.php \ - Protobuf_test_messages/Proto3/ForeignEnum.php \ - Protobuf_test_messages/Proto3/ForeignMessage.php \ - Protobuf_test_messages/Proto3/TestAllTypes_NestedEnum.php \ - Protobuf_test_messages/Proto3/TestAllTypes_NestedMessage.php \ - Protobuf_test_messages/Proto3/TestAllTypes.php - # lite/com/google/protobuf/Any.java \ - # lite/com/google/protobuf/AnyOrBuilder.java \ - # lite/com/google/protobuf/AnyProto.java \ - # lite/com/google/protobuf/BoolValue.java \ - # lite/com/google/protobuf/BoolValueOrBuilder.java \ - # lite/com/google/protobuf/BytesValue.java \ - # lite/com/google/protobuf/BytesValueOrBuilder.java \ - # lite/com/google/protobuf/conformance/Conformance.java \ - # lite/com/google/protobuf/DoubleValue.java \ - # lite/com/google/protobuf/DoubleValueOrBuilder.java \ - # lite/com/google/protobuf/Duration.java \ - # lite/com/google/protobuf/DurationOrBuilder.java \ - # lite/com/google/protobuf/DurationProto.java \ - # lite/com/google/protobuf/FieldMask.java \ - # lite/com/google/protobuf/FieldMaskOrBuilder.java \ - # lite/com/google/protobuf/FieldMaskProto.java \ - # lite/com/google/protobuf/FloatValue.java \ - # lite/com/google/protobuf/FloatValueOrBuilder.java \ - # lite/com/google/protobuf/Int32Value.java \ - # lite/com/google/protobuf/Int32ValueOrBuilder.java \ - # lite/com/google/protobuf/Int64Value.java \ - # lite/com/google/protobuf/Int64ValueOrBuilder.java \ - # lite/com/google/protobuf/ListValue.java \ - # lite/com/google/protobuf/ListValueOrBuilder.java \ - # lite/com/google/protobuf/NullValue.java \ - # lite/com/google/protobuf/StringValue.java \ - # lite/com/google/protobuf/StringValueOrBuilder.java \ - # lite/com/google/protobuf/Struct.java \ - # lite/com/google/protobuf/StructOrBuilder.java \ - # lite/com/google/protobuf/StructProto.java \ - # lite/com/google/protobuf/Timestamp.java \ - # lite/com/google/protobuf/TimestampOrBuilder.java \ - # lite/com/google/protobuf/TimestampProto.java \ - # lite/com/google/protobuf/UInt32Value.java \ - # lite/com/google/protobuf/UInt32ValueOrBuilder.java \ - # lite/com/google/protobuf/UInt64Value.java \ - # lite/com/google/protobuf/UInt64ValueOrBuilder.java \ - # lite/com/google/protobuf/Value.java \ - # lite/com/google/protobuf/ValueOrBuilder.java \ - # lite/com/google/protobuf/WrappersProto.java - -bin_PROGRAMS = conformance-test-runner conformance-cpp - -# All source files excepet C++/Objective-C ones should be explicitly listed -# here because the autoconf tools don't include files of other languages -# automatically. -EXTRA_DIST = \ - ConformanceJava.java \ - ConformanceJavaLite.java \ - README.md \ - conformance.proto \ - conformance_python.py \ - conformance_ruby.rb \ - conformance_php.php \ - failure_list_cpp.txt \ - failure_list_csharp.txt \ - failure_list_java.txt \ - failure_list_js.txt \ - failure_list_objc.txt \ - failure_list_python.txt \ - failure_list_python_cpp.txt \ - failure_list_python-post26.txt \ - failure_list_ruby.txt \ - failure_list_php.txt \ - failure_list_php_c.txt - -conformance_test_runner_LDADD = $(top_srcdir)/src/libprotobuf.la -conformance_test_runner_SOURCES = conformance_test.h conformance_test.cc \ - conformance_test_main.cc \ - binary_json_conformance_suite.h \ - binary_json_conformance_suite.cc \ - text_format_conformance_suite.h \ - text_format_conformance_suite.cc \ - conformance_test_runner.cc \ - third_party/jsoncpp/json.h \ - third_party/jsoncpp/jsoncpp.cpp -nodist_conformance_test_runner_SOURCES = conformance.pb.cc google/protobuf/test_messages_proto3.pb.cc google/protobuf/test_messages_proto2.pb.cc -conformance_test_runner_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir) -conformance_test_runner_CXXFLAGS = -std=c++11 -# Explicit deps because BUILT_SOURCES are only done before a "make all/check" -# so a direct "make test_cpp" could fail if parallel enough. -conformance_test_runner-conformance_test.$(OBJEXT): conformance.pb.h -conformance_test_runner-conformance_test_runner.$(OBJEXT): conformance.pb.h - -conformance_cpp_LDADD = $(top_srcdir)/src/libprotobuf.la -conformance_cpp_SOURCES = conformance_cpp.cc -nodist_conformance_cpp_SOURCES = conformance.pb.cc google/protobuf/test_messages_proto3.pb.cc google/protobuf/test_messages_proto2.pb.cc -conformance_cpp_CPPFLAGS = -I$(top_srcdir)/src -# Explicit dep because BUILT_SOURCES are only done before a "make all/check" -# so a direct "make test_cpp" could fail if parallel enough. -conformance_cpp-conformance_cpp.$(OBJEXT): conformance.pb.h - -if OBJC_CONFORMANCE_TEST - -bin_PROGRAMS += conformance-objc - -conformance_objc_SOURCES = conformance_objc.m ../objectivec/GPBProtocolBuffers.m -nodist_conformance_objc_SOURCES = Conformance.pbobjc.m google/protobuf/TestMessagesProto2.pbobjc.m google/protobuf/TestMessagesProto3.pbobjc.m -# On travis, the build fails without the isysroot because whatever system -# headers are being found don't include generics support for -# NSArray/NSDictionary, the only guess is their image at one time had an odd -# setup for Xcode and old frameworks are being found. -conformance_objc_CPPFLAGS = -I$(top_srcdir)/objectivec -isysroot `xcrun --sdk macosx --show-sdk-path` -conformance_objc_LDFLAGS = -framework Foundation -# Explicit dep because BUILT_SOURCES are only done before a "make all/check" -# so a direct "make test_objc" could fail if parallel enough. -conformance_objc-conformance_objc.$(OBJEXT): Conformance.pbobjc.h google/protobuf/TestMessagesProto2.pbobjc.h google/protobuf/TestMessagesProto3.pbobjc.h - -endif - -# JavaScript well-known types are expected to be in a directory called -# google-protobuf, because they are usually in the google-protobuf npm -# package. But we want to use the sources from our tree, so we recreate -# that directory structure here. -google-protobuf: - mkdir google-protobuf - -if USE_EXTERNAL_PROTOC - -# Some implementations include pre-generated versions of well-known types. -protoc_middleman: $(conformance_protoc_inputs) $(conformance_proto2_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf - $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --objc_out=. --python_out=. --php_out=. $(conformance_protoc_inputs) - $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --objc_out=. --python_out=. $(conformance_proto2_protoc_inputs) - $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --python_out=. $(well_known_type_protoc_inputs) - ## $(PROTOC) -I$(srcdir) -I$(top_srcdir) --java_out=lite:lite $(conformance_protoc_inputs) $(well_known_type_protoc_inputs) - touch protoc_middleman - -else - -# We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is -# relative to srcdir, which may not be the same as the current directory when -# building out-of-tree. -protoc_middleman: $(top_srcdir)/src/protoc$(EXEEXT) $(conformance_protoc_inputs) $(conformance_proto2_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf - oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --ruby_out=$$oldpwd --objc_out=$$oldpwd --python_out=$$oldpwd --php_out=$$oldpwd $(conformance_protoc_inputs) ) - oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --ruby_out=$$oldpwd --objc_out=$$oldpwd --python_out=$$oldpwd $(conformance_proto2_protoc_inputs) ) - oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --ruby_out=$$oldpwd --python_out=$$oldpwd $(well_known_type_protoc_inputs) ) - ## @mkdir -p lite - ## oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --java_out=lite:$$oldpwd/lite $(conformance_protoc_inputs) $(well_known_type_protoc_inputs) ) - touch protoc_middleman - -endif - -$(protoc_outputs): protoc_middleman - -$(other_language_protoc_outputs): protoc_middleman - -CLEANFILES = $(protoc_outputs) protoc_middleman javac_middleman conformance-java javac_middleman_lite conformance-java-lite conformance-csharp conformance-php conformance-php-c $(other_language_protoc_outputs) - -MAINTAINERCLEANFILES = \ - Makefile.in - -javac_middleman: ConformanceJava.java protoc_middleman $(other_language_protoc_outputs) - jar=`ls ../java/util/target/*jar-with-dependencies.jar` && javac -classpath ../java/target/classes:$$jar ConformanceJava.java com/google/protobuf/conformance/Conformance.java com/google/protobuf_test_messages/proto3/TestMessagesProto3.java com/google/protobuf_test_messages/proto2/TestMessagesProto2.java - @touch javac_middleman - -conformance-java: javac_middleman - @echo "Writing shortcut script conformance-java..." - @echo '#! /bin/sh' > conformance-java - @jar=`ls ../java/util/target/*jar-with-dependencies.jar` && echo java -classpath .:../java/target/classes:$$jar ConformanceJava '$$@' >> conformance-java - @chmod +x conformance-java - -javac_middleman_lite: ConformanceJavaLite.java protoc_middleman $(other_language_protoc_outputs) - javac -classpath ../java/lite/target/classes:lite ConformanceJavaLite.java lite/com/google/protobuf/conformance/Conformance.java - @touch javac_middleman_lite - -conformance-java-lite: javac_middleman_lite - @echo "Writing shortcut script conformance-java-lite..." - @echo '#! /bin/sh' > conformance-java-lite - @echo java -classpath .:../java/lite/target/classes:lite ConformanceJavaLite '$$@' >> conformance-java-lite - @chmod +x conformance-java-lite - -# Currently the conformance code is alongside the rest of the C# -# source, as it's easier to maintain there. We assume we've already -# built that, so we just need a script to run it. -conformance-csharp: $(other_language_protoc_outputs) - @echo "Writing shortcut script conformance-csharp..." - @echo '#! /bin/sh' > conformance-csharp - @echo 'dotnet ../csharp/src/Google.Protobuf.Conformance/bin/Release/netcoreapp3.1/Google.Protobuf.Conformance.dll "$$@"' >> conformance-csharp - @chmod +x conformance-csharp - -conformance-php: - @echo "Writing shortcut script conformance-php..." - @echo '#! /bin/sh' > conformance-php - @echo 'php -d auto_prepend_file=autoload.php ./conformance_php.php' >> conformance-php - @chmod +x conformance-php - -conformance-php-c: - @echo "Writing shortcut script conformance-php-c..." - @echo '#! /bin/sh' > conformance-php-c - @echo 'php -dextension=../php/ext/google/protobuf/modules/protobuf.so ./conformance_php.php' >> conformance-php-c - @chmod +x conformance-php-c - -# Targets for actually running tests. -test_cpp: protoc_middleman conformance-test-runner conformance-cpp - ./conformance-test-runner --enforce_recommended --failure_list failure_list_cpp.txt --text_format_failure_list text_format_failure_list_cpp.txt ./conformance-cpp - -test_java: protoc_middleman conformance-test-runner conformance-java - ./conformance-test-runner --enforce_recommended --failure_list failure_list_java.txt --text_format_failure_list text_format_failure_list_java.txt ./conformance-java - -test_java_lite: protoc_middleman conformance-test-runner conformance-java-lite - ./conformance-test-runner --enforce_recommended ./conformance-java-lite - -test_csharp: protoc_middleman conformance-test-runner conformance-csharp - ./conformance-test-runner --enforce_recommended --failure_list failure_list_csharp.txt --text_format_failure_list text_format_failure_list_csharp.txt ./conformance-csharp - -test_ruby: protoc_middleman conformance-test-runner $(other_language_protoc_outputs) - RUBYLIB=../ruby/lib:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_ruby.txt --text_format_failure_list text_format_failure_list_ruby.txt ./conformance_ruby.rb - -test_jruby: protoc_middleman conformance-test-runner $(other_language_protoc_outputs) - RUBYLIB=../ruby/lib:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_jruby.txt --text_format_failure_list text_format_failure_list_jruby.txt ./conformance_ruby.rb - -test_php: protoc_middleman conformance-test-runner conformance-php $(other_language_protoc_outputs) - ./conformance-test-runner --enforce_recommended --failure_list failure_list_php.txt --text_format_failure_list text_format_failure_list_php.txt ./conformance-php - -test_php_c: protoc_middleman conformance-test-runner conformance-php-c $(other_language_protoc_outputs) - ./conformance-test-runner --enforce_recommended --failure_list failure_list_php_c.txt --text_format_failure_list text_format_failure_list_php.txt ./conformance-php-c - -# These depend on library paths being properly set up. The easiest way to -# run them is to just use "tox" from the python dir. -test_python: protoc_middleman conformance-test-runner - ./conformance-test-runner --enforce_recommended --failure_list failure_list_python.txt --text_format_failure_list text_format_failure_list_python.txt ./conformance_python.py - -test_python_cpp: protoc_middleman conformance-test-runner - ./conformance-test-runner --enforce_recommended --failure_list failure_list_python_cpp.txt --text_format_failure_list text_format_failure_list_python_cpp.txt ./conformance_python.py - -if OBJC_CONFORMANCE_TEST - -test_objc: protoc_middleman conformance-test-runner conformance-objc - ./conformance-test-runner --enforce_recommended --failure_list failure_list_objc.txt ./conformance-objc - -endif diff --git a/conformance/autoload.php b/conformance/autoload.php index 0f49aecb16..7f04cc008c 100644 --- a/conformance/autoload.php +++ b/conformance/autoload.php @@ -7,7 +7,7 @@ define("GOOGLE_GPBMETADATA_NAMESPACE", "GPBMetadata\\Google\\Protobuf\\"); function protobuf_autoloader_impl($class, $prefix) { $length = strlen($prefix); if ((substr($class, 0, $length) === $prefix)) { - $path = '../php/src/' . implode('/', array_map('ucwords', explode('\\', $class))) . '.php'; + $path = 'php/src/' . implode('/', array_map('ucwords', explode('\\', $class))) . '.php'; include_once $path; } } diff --git a/conformance/conformance_cpp.cc b/conformance/conformance_cpp.cc index dd753ca820..cbfd8b53bd 100644 --- a/conformance/conformance_cpp.cc +++ b/conformance/conformance_cpp.cc @@ -44,8 +44,7 @@ #include #include #include -#include "conformance.pb.h" -#include "conformance.pb.h" +#include "conformance/conformance.pb.h" #include #include #include diff --git a/conformance/conformance_nodejs.js b/conformance/conformance_nodejs.js deleted file mode 100755 index 275fac4613..0000000000 --- a/conformance/conformance_nodejs.js +++ /dev/null @@ -1,189 +0,0 @@ -#!/usr/bin/env node -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -var conformance = require('conformance_pb'); -var test_messages_proto3 = require('google/protobuf/test_messages_proto3_pb'); -var test_messages_proto2 = require('google/protobuf/test_messages_proto2_pb'); -var fs = require('fs'); - -var testCount = 0; - -function doTest(request) { - var testMessage; - var response = new conformance.ConformanceResponse(); - - try { - if (request.getRequestedOutputFormat() == conformance.WireFormat.JSON) { - response.setSkipped("JSON not supported."); - return response; - } - - if (request.getRequestedOutputFormat() == - conformance.WireFormat.TEXT_FORMAT) { - response.setSkipped('Text format is not supported as output format.'); - return response; - } - - switch (request.getPayloadCase()) { - case conformance.ConformanceRequest.PayloadCase.PROTOBUF_PAYLOAD: { - if (request.getMessageType() == "protobuf_test_messages.proto3.TestAllTypesProto3") { - try { - testMessage = test_messages_proto3.TestAllTypesProto3.deserializeBinary( - request.getProtobufPayload()); - } catch (err) { - response.setParseError(err.toString()); - return response; - } - } else if (request.getMessageType() == "protobuf_test_messages.proto2.TestAllTypesProto2"){ - try { - testMessage = test_messages_proto2.TestAllTypesProto2.deserializeBinary( - request.getProtobufPayload()); - } catch (err) { - response.setParseError(err.toString()); - return response; - } - } else { - throw "Protobuf request doesn\'t have specific payload type"; - } - } break; - - case conformance.ConformanceRequest.PayloadCase.JSON_PAYLOAD: - response.setSkipped("JSON not supported."); - return response; - - case conformance.ConformanceRequest.PayloadCase.TEXT_PAYLOAD: - response.setSkipped("Text format not supported."); - return response; - - case conformance.ConformanceRequest.PayloadCase.PAYLOAD_NOT_SET: - response.setRuntimeError("Request didn't have payload"); - return response; - } - - switch (request.getRequestedOutputFormat()) { - case conformance.WireFormat.UNSPECIFIED: - response.setRuntimeError("Unspecified output format"); - return response; - - case conformance.WireFormat.PROTOBUF: - response.setProtobufPayload(testMessage.serializeBinary()); - - case conformance.WireFormat.JSON: - response.setSkipped("JSON not supported."); - return response; - - default: - throw "Request didn't have requested output format"; - } - } catch (err) { - response.setRuntimeError(err.toString()); - } - - return response; -} - -function onEof(totalRead) { - if (totalRead == 0) { - return undefined; - } else { - throw "conformance_nodejs: premature EOF on stdin."; - } -} - -// Utility function to read a buffer of N bytes. -function readBuffer(bytes) { - var buf = new Buffer(bytes); - var totalRead = 0; - while (totalRead < bytes) { - var read = 0; - try { - read = fs.readSync(process.stdin.fd, buf, totalRead, bytes - totalRead); - } catch (e) { - if (e.code == 'EOF') { - return onEof(totalRead) - } else if (e.code == 'EAGAIN') { - } else { - throw "conformance_nodejs: Error reading from stdin." + e; - } - } - - totalRead += read; - } - - return buf; -} - -function writeBuffer(buffer) { - var totalWritten = 0; - while (totalWritten < buffer.length) { - totalWritten += fs.writeSync( - process.stdout.fd, buffer, totalWritten, buffer.length - totalWritten); - } -} - -// Returns true if the test ran successfully, false on legitimate EOF. -// If EOF is encountered in an unexpected place, raises IOError. -function doTestIo() { - var lengthBuf = readBuffer(4); - if (!lengthBuf) { - return false; - } - - var length = lengthBuf.readInt32LE(0); - var serializedRequest = readBuffer(length); - if (!serializedRequest) { - throw "conformance_nodejs: Failed to read request."; - } - - serializedRequest = new Uint8Array(serializedRequest); - var request = - conformance.ConformanceRequest.deserializeBinary(serializedRequest); - var response = doTest(request); - - var serializedResponse = response.serializeBinary(); - - lengthBuf = new Buffer(4); - lengthBuf.writeInt32LE(serializedResponse.length, 0); - writeBuffer(lengthBuf); - writeBuffer(new Buffer(serializedResponse)); - - testCount += 1 - - return true; -} - -while (true) { - if (!doTestIo()) { - console.error('conformance_nodejs: received EOF from test runner ' + - "after " + testCount + " tests, exiting") - break; - } -} diff --git a/conformance/conformance_php.php b/conformance/conformance_php.php index 9eef0c5a4a..f250ebf138 100644 --- a/conformance/conformance_php.php +++ b/conformance/conformance_php.php @@ -14,7 +14,7 @@ require_once("Protobuf_test_messages/Proto3/TestAllTypesProto3/NestedMessage.php require_once("Protobuf_test_messages/Proto3/TestAllTypesProto3/NestedEnum.php"); require_once("GPBMetadata/Conformance.php"); -require_once("GPBMetadata/Google/Protobuf/TestMessagesProto3.php"); +require_once("GPBMetadata/TestMessagesProto3.php"); use \Conformance\TestCategory; use \Conformance\WireFormat; @@ -113,7 +113,7 @@ function doTestIO() while(true){ if (!doTestIO()) { fprintf(STDERR, - "conformance_php: received EOF from test runner " + + "conformance_php: received EOF from test runner " . "after %d tests, exiting\n", $test_count); exit; } diff --git a/conformance/conformance_test_runner.sh b/conformance/conformance_test_runner.sh index 3149f82fbb..0492d9d15d 100755 --- a/conformance/conformance_test_runner.sh +++ b/conformance/conformance_test_runner.sh @@ -44,13 +44,13 @@ conformance_test_runner=$(rlocation com_google_protobuf/conformance/conformance_ conformance_testee=$(rlocation $TESTEE) args=(--enforce_recommended) -failure_list=$(rlocation $FAILURE_LIST) -if [ "$failure_list" != "1" ] ; then +failure_list=$(rlocation $FAILURE_LIST) || unset +if [ -n "$failure_list" ] ; then args+=(--failure_list $failure_list) fi -text_format_failure_list=$(rlocation $TEXT_FORMAT_FAILURE_LIST) -if [ "$text_format_failure_list" != "1" ]; then +text_format_failure_list=$(rlocation $TEXT_FORMAT_FAILURE_LIST) || unset +if [ -n "$text_format_failure_list" ]; then args+=(--text_format_failure_list $text_format_failure_list) fi diff --git a/conformance/defs.bzl b/conformance/defs.bzl index cd36ab43af..e6eceb8a1f 100644 --- a/conformance/defs.bzl +++ b/conformance/defs.bzl @@ -7,7 +7,8 @@ def conformance_test( name, testee, failure_list = None, - text_format_failure_list = None): + text_format_failure_list = None, + **kwargs): """Conformance test runner. Args: @@ -16,6 +17,7 @@ def conformance_test( failure_list: a text file with known failures, one per line. text_format_failure_list: a text file with known failures (one per line) for the text format conformance suite. + **kwargs: common arguments to pass to sh_test. """ args = ["--testee %s" % _strip_bazel(testee)] failure_lists = [] @@ -36,6 +38,8 @@ def conformance_test( deps = [ "@bazel_tools//tools/bash/runfiles", ], + tags = ["conformance"], + **kwargs, ) def _strip_bazel(testee): diff --git a/conformance/failure_list_js.txt b/conformance/failure_list_js.txt deleted file mode 100644 index b7d36b6dd0..0000000000 --- a/conformance/failure_list_js.txt +++ /dev/null @@ -1,162 +0,0 @@ -Recommended.Proto2.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.ENUM[4].ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.ENUM[5].ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.FIXED64[2].ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.INT32[7].ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.INT64[2].ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.SFIXED64[2].ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.SINT64[2].ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.UINT32[8].ProtobufOutput -Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.UINT64[2].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.DefaultOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.UnpackedOutput.ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[4].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[5].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FIXED64[2].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[7].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT64[2].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED64[2].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT64[2].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[8].ProtobufOutput -Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT64[2].ProtobufOutput -Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.ENUM.ProtobufOutput -Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.FIXED64.ProtobufOutput -Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.UINT64.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.INT32.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.INT64.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataScalar.ENUM[4].ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataScalar.ENUM[5].ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataScalar.FIXED64[2].ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataScalar.INT32[7].ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataScalar.INT64[2].ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataScalar.SFIXED64[2].ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataScalar.SINT64[2].ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataScalar.UINT32[8].ProtobufOutput -Required.Proto2.ProtobufInput.ValidDataScalar.UINT64[2].ProtobufOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.ENUM.ProtobufOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED64.ProtobufOutput -Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT64.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[4].ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[5].ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.FIXED64[2].ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.INT32[7].ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.INT64[2].ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED64[2].ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.SINT64[2].ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[8].ProtobufOutput -Required.Proto3.ProtobufInput.ValidDataScalar.UINT64[2].ProtobufOutput diff --git a/csharp/BUILD.bazel b/csharp/BUILD.bazel index 4f3556647f..e2c9aef0f0 100644 --- a/csharp/BUILD.bazel +++ b/csharp/BUILD.bazel @@ -3,11 +3,49 @@ # See also code generation logic under /src/google/protobuf/compiler/csharp. load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") +load("//:protobuf.bzl", "internal_csharp_proto_library") +load("//build_defs:internal_shell.bzl", "inline_sh_test") +load("//conformance:defs.bzl", "conformance_test") + +################################################################################ +# Tests +################################################################################ + +conformance_test( + name = "conformance_test", + failure_list = "//conformance:failure_list_csharp.txt", + testee = "//conformance:conformance_csharp", + text_format_failure_list = "//conformance:text_format_failure_list_csharp.txt", +) + +################################################################################ +# CSharp Runtime +################################################################################ + +filegroup( + name = "srcs", + srcs = glob([ + "keys/*", + "protos/*", + "src/**/*.cs*", # .cs and .csproj + ], exclude = [ + # Exclude generated files. + "src/*/obj/**/*" + ]) + [ + "src/Directory.Build.props", + "src/Google.Protobuf.Benchmarks/wrapper_benchmark_messages.proto", + "src/Google.Protobuf.Test/testprotos.pb", + "src/Google.Protobuf.sln", + ], + visibility = [ + "//csharp:__subpackages__", + "//conformance:__subpackages__" + ], +) filegroup( name = "wkt_cs_srcs", - data = [ - "src/Google.Protobuf.Conformance/Conformance.cs", + srcs = [ "src/Google.Protobuf/Reflection/Descriptor.cs", "src/Google.Protobuf/WellKnownTypes/Any.cs", "src/Google.Protobuf/WellKnownTypes/Api.cs", @@ -23,13 +61,31 @@ filegroup( visibility = ["//src/google/protobuf/compiler/csharp:__pkg__"], ) +inline_sh_test( + name = "tests", + srcs = [ + ":srcs", + "src/Google.Protobuf.sln", + "//csharp/src/Google.Protobuf.Conformance:srcs", + "//benchmarks/datasets:proto3_datasets" + ], + cmd = """ + pushd `dirname $(location src/Google.Protobuf.sln)`/.. + dotnet restore src/Google.Protobuf.sln + dotnet build -c Release src/Google.Protobuf.sln + dotnet test -c Release -f netcoreapp3.1 src/Google.Protobuf.Test/Google.Protobuf.Test.csproj + popd + """, +) + +################################################################################ +# Distribution files +################################################################################ + pkg_files( name = "dist_files", - srcs = glob([ - "keys/*", - "protos/*", - "src/**/*.cs*", # .cs and .csproj - ]) + [ + srcs = [ + ":srcs", ".editorconfig", ".gitignore", "BUILD.bazel", @@ -45,9 +101,7 @@ pkg_files( "buildall.sh", "generate_protos.sh", "install_dotnet_sdk.ps1", - "src/Google.Protobuf.Benchmarks/wrapper_benchmark_messages.proto", - "src/Google.Protobuf.Test/testprotos.pb", - "src/Google.Protobuf.sln", + "//csharp/src/Google.Protobuf.Conformance:dist_files", ], strip_prefix = strip_prefix.from_root(""), visibility = ["//pkg:__pkg__"], diff --git a/csharp/compatibility_tests/v3.0.0/BUILD.bazel b/csharp/compatibility_tests/v3.0.0/BUILD.bazel new file mode 100644 index 0000000000..1f6c713cd5 --- /dev/null +++ b/csharp/compatibility_tests/v3.0.0/BUILD.bazel @@ -0,0 +1,16 @@ +load("//build_defs:internal_shell.bzl", "inline_sh_test") + +# Run csharp compatibility test between 3.0.0 and the current version. +inline_sh_test( + name = "tests", + srcs = ["test.sh"], + tools = ["//:protoc"], + deps = glob([ + "src/**/*.cs*", # .cs and .csproj + "protos/**/*.proto", + ]) + [ + "//csharp:srcs", + "//:well_known_protos", + ], + cmd = "$(location test.sh) 3.0.0 $(rootpath //:protoc)" +) diff --git a/csharp/compatibility_tests/v3.0.0/test.sh b/csharp/compatibility_tests/v3.0.0/test.sh index 459c079879..6323a6d076 100755 --- a/csharp/compatibility_tests/v3.0.0/test.sh +++ b/csharp/compatibility_tests/v3.0.0/test.sh @@ -27,6 +27,8 @@ function run_test() { set -ex +PROTOC=$(realpath ${2:-../../../bazel-bin/protoc}) + # Change to the script's directory. cd $(dirname $0) @@ -45,7 +47,7 @@ OLD_VERSION_PROTOC=https://repo1.maven.org/maven2/com/google/protobuf/protoc/$OL echo "Running compatibility tests with $OLD_VERSION" # Check protoc -[ -f ../../../src/protoc ] || { +[ -f $PROTOC ] || { echo "[ERROR]: Please build protoc first." exit 1 } @@ -68,12 +70,12 @@ run_test "./old_protoc" "./old_protoc" # Test A.2: # proto set 1: use new version # proto set 2 which may import protos in set 1: use old version -run_test "../../../src/protoc" "./old_protoc" +run_test "$PROTOC" "./old_protoc" # Test A.3: # proto set 1: use old version # proto set 2 which may import protos in set 1: use new version -run_test "./old_protoc" "../../../src/protoc" +run_test "./old_protoc" "$PROTOC" rm old_protoc rm keys -r diff --git a/csharp/generate_protos.sh b/csharp/generate_protos.sh index 62ba1a1994..d809aa979d 100755 --- a/csharp/generate_protos.sh +++ b/csharp/generate_protos.sh @@ -11,17 +11,19 @@ pushd $(dirname $0)/.. # Protocol buffer compiler to use. If the PROTOC variable is set, # use that. Otherwise, probe for expected locations under both # Windows and Unix. +PROTOC_LOCATIONS=( + "bazel-bin/protoc" + "solution/Debug/protoc.exe" + "cmake/build/Debug/protoc.exe" + "cmake/build/Release/protoc.exe" +) if [ -z "$PROTOC" ]; then - # TODO(jonskeet): Use an array and a for loop instead? - if [ -x solution/Debug/protoc.exe ]; then - PROTOC=solution/Debug/protoc.exe - elif [ -x cmake/build/Debug/protoc.exe ]; then - PROTOC=cmake/build/Debug/protoc.exe - elif [ -x cmake/build/Release/protoc.exe ]; then - PROTOC=cmake/build/Release/protoc.exe - elif [ -x src/protoc ]; then - PROTOC=src/protoc - else + for protoc in "${PROTOC_LOCATIONS[@]}"; do + if [ -x "$protoc" ]; then + PROTOC="$protoc" + fi + done + if [ -z "$PROTOC" ]; then echo "Unable to find protocol buffer compiler." exit 1 fi @@ -75,9 +77,6 @@ $PROTOC -Isrc -Icsharp/protos \ $PROTOC -Iexamples -Isrc --csharp_out=csharp/src/AddressBook \ examples/addressbook.proto -$PROTOC -Iconformance -Isrc --csharp_out=csharp/src/Google.Protobuf.Conformance \ - conformance/conformance.proto - # Benchmark protos $PROTOC -Ibenchmarks \ benchmarks/datasets/google_message1/proto3/*.proto \ diff --git a/csharp/src/Google.Protobuf.Conformance/BUILD.bazel b/csharp/src/Google.Protobuf.Conformance/BUILD.bazel new file mode 100644 index 0000000000..12ad0f7953 --- /dev/null +++ b/csharp/src/Google.Protobuf.Conformance/BUILD.bazel @@ -0,0 +1,97 @@ +load("//build_defs:internal_shell.bzl", "inline_sh_binary") +load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") + +inline_sh_binary( + name = "build_conformance_test", + srcs = ["Google.Protobuf.Conformance.csproj"], + cmd = "dotnet build -c Release $(SRCS)", + visibility = ["//visibility:private"], +) + +CONFORMANCE_DEPS = [ + "Google.Protobuf.dll", + "Google.Protobuf.Conformance.deps.json", + "Google.Protobuf.Conformance.pdb", + "Google.Protobuf.Conformance.runtimeconfig.json", + "Google.Protobuf.Test.dll", + "Google.Protobuf.Test.TestProtos.dll", + "Microsoft.TestPlatform.CommunicationUtilities.dll", + "Microsoft.TestPlatform.CoreUtilities.dll", + "Microsoft.TestPlatform.CrossPlatEngine.dll", + "Microsoft.TestPlatform.PlatformAbstractions.dll", + "Microsoft.TestPlatform.Utilities.dll", + "Microsoft.VisualStudio.CodeCoverage.Shim.dll", + "Microsoft.VisualStudio.TestPlatform.Common.dll", + "Microsoft.VisualStudio.TestPlatform.ObjectModel.dll", + "NUnit3.TestAdapter.dll", + "Newtonsoft.Json.dll", + "NuGet.Frameworks.dll", + "nunit.engine.api.dll", + "nunit.engine.core.dll", + "nunit.engine.dll", + "nunit.framework.dll", + "testcentric.engine.metadata.dll", + "testhost.dll", +] + +filegroup( + name = "srcs", + srcs = [ + "Conformance.cs", + "Program.cs", + "Google.Protobuf.Conformance.csproj", + ], + visibility = [ + "//csharp:__subpackages__", + ], +) + +genrule( + name = "package_conformance_test", + srcs = [ + "Program.cs", + "Google.Protobuf.Conformance.csproj", + "//conformance:conformance_csharp_proto", + "//csharp:srcs", + ], + visibility = ["//visibility:private"], + tools = [":build_conformance_test"], + outs = CONFORMANCE_DEPS + ["Google.Protobuf.Conformance.dll"], + cmd = """ + SRCDIR=$$(dirname $(location :Program.cs)) + cp $(location //conformance:conformance_csharp_proto) $$SRCDIR + DOTNET_CLI_HOME=/tmp ./$(location :build_conformance_test) + cp -r $$SRCDIR/bin/Release/netcoreapp3.1/* $(RULEDIR) + """, +) + +filegroup( + name = "conformance_dll", + srcs = ["Google.Protobuf.Conformance.dll"], + data = [":package_conformance_test"], + visibility = ["//conformance:__subpackages__"], +) + +filegroup( + name = "conformance_runfiles", + srcs = CONFORMANCE_DEPS, + data = [":package_conformance_test"], + visibility = ["//conformance:__subpackages__"], +) + +################################################################################ +# Distribution files +################################################################################ + +pkg_files( + name = "dist_files", + srcs = [ + "BUILD.bazel", + "Google.Protobuf.Conformance.csproj", + "Conformance.cs", + "Program.cs", + ], + strip_prefix = strip_prefix.from_root(""), + visibility = ["//csharp:__pkg__"], +) + diff --git a/docs/cpp_build_systems.md b/docs/cpp_build_systems.md index 812ddef22f..e093f9a2d3 100644 --- a/docs/cpp_build_systems.md +++ b/docs/cpp_build_systems.md @@ -25,9 +25,9 @@ essentially a complete copy of the same build definitions. was designed in large part to support exactly this type of rich, multi-language build. -Currently, C++ Protobuf can be built with Bazel, Autotools, and CMake. Each of -these build systems has different semantics and structure, but share in common -the list of files needed to build the runtime and compiler. +Currently, C++ Protobuf can be built with Bazel and CMake. Each of these build +systems has different semantics and structure, but share in common the list of +files needed to build the runtime and compiler. ## Design @@ -74,7 +74,7 @@ rules, a special rule, `cc_dist_library`, combines several fine-grained libraries into a single, monolithic library. For the Protobuf project, these "distribution libraries" are intended to match -the granularity of the Autotools- and CMake-based builds. Since the Bazel-built +the granularity of the CMake-based builds. Since the Bazel-built distribution library covers the rules with the source files needed by other builds, the `cc_dist_library` rule invokes the `cc_file_list_aspect` on its input libraries. The result is that a `cc_dist_library` rule not only produces @@ -163,8 +163,7 @@ detects this as two conflicting actions generating the same outputs. (For ### File list generation Lists of input files are generated by Bazel in a format that can be imported to -other build systems. Currently, Automake- and CMake-style files can be -generated. +other build systems. Currently only CMake-style files can be generated. The lists of files are derived from Bazel build targets. The sources can be: * `cc_dist_library` rules (as described above) @@ -263,11 +262,6 @@ include(source_lists.cmake) add_library(distlib ${distlib_srcs} ${buff_srcs}) ``` -In addition to `gen_cmake_file_lists`, there is also a `gen_automake_file_lists` -rule. These rules actually share most of the same implementation, but define -different file headers and different Starlark "fragment generator" functions -which format the generated list variables. - ### Protobuf usage The main C++ runtimes (lite and full) and the Protobuf compiler use their diff --git a/docs/implementing_proto3_presence.md b/docs/implementing_proto3_presence.md index 7c3e21339a..4abfbd52f9 100644 --- a/docs/implementing_proto3_presence.md +++ b/docs/implementing_proto3_presence.md @@ -131,11 +131,11 @@ These options are demonstrated below: ``` # One option: -$ ./src/protoc test.proto --cpp_out=. --experimental_allow_proto3_optional +$ protoc test.proto --cpp_out=. --experimental_allow_proto3_optional # Another option: $ cp test.proto test_proto3_optional.proto -$ ./src/protoc test_proto3_optional.proto --cpp_out=. +$ protoc test_proto3_optional.proto --cpp_out=. $ ``` @@ -152,7 +152,7 @@ If you now try to invoke your own code generator with the test proto, you will run into a different error: ``` -$ ./src/protoc test_proto3_optional.proto --my_codegen_out=. +$ protoc test_proto3_optional.proto --my_codegen_out=. test_proto3_optional.proto: is a proto3 file that contains optional fields, but code generator --my_codegen_out hasn't been updated to support optional fields in proto3. Please ask the owner of this code generator to support proto3 optional. @@ -201,7 +201,7 @@ Once you have added this, you should now be able to successfully use your code generator to generate a file containing proto3 optional fields: ``` -$ ./src/protoc test_proto3_optional.proto --my_codegen_out=. +$ protoc test_proto3_optional.proto --my_codegen_out=. ``` ### Updating Your Code Generator diff --git a/examples/README.md b/examples/README.md index a99883e066..5f492116d4 100644 --- a/examples/README.md +++ b/examples/README.md @@ -44,7 +44,7 @@ build only the language you are interested in. ### C++ You can follow instructions in [../src/README.md](../src/README.md) to install -protoc and protobuf C++ runtime from source. +protoc from source. Then run "make cpp" in this examples directory to build the C++ example. It will create two executables: add_person_cpp and list_people_cpp. These programs diff --git a/examples/WORKSPACE b/examples/WORKSPACE index 3897572a23..e9811efff2 100644 --- a/examples/WORKSPACE +++ b/examples/WORKSPACE @@ -10,9 +10,11 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # # http_archive( # name = "com_google_protobuf", -# strip_prefix = "protobuf-main", -# urls = ["https://github.com/protocolbuffers/protobuf/archive/main.zip"], +# sha256 = "c29d8b4b79389463c546f98b15aa4391d4ed7ec459340c47bffe15db63eb9126", +# strip_prefix = "protobuf-3.21.3", +# urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.21.3.tar.gz"], # ) + local_repository( name = "com_google_protobuf", path = "..", diff --git a/generate_descriptor_proto.sh b/generate_descriptor_proto.sh index dc03fee019..d1b13d122c 100755 --- a/generate_descriptor_proto.sh +++ b/generate_descriptor_proto.sh @@ -7,7 +7,7 @@ # generate. # # HINT: Flags passed to generate_descriptor_proto.sh will be passed directly -# to make when building protoc. This is particularly useful for passing +# to bazel when building protoc. This is particularly useful for passing # -j4 to run 4 jobs simultaneously. if test ! -e src/google/protobuf/stubs/common.h; then @@ -62,12 +62,12 @@ do PROTOC=$BOOTSTRAP_PROTOC BOOTSTRAP_PROTOC="" else - make -j$(nproc) $@ protoc + bazel build -j$(nproc) $@ //:protoc if test $? -ne 0; then echo "Failed to build protoc." exit 1 fi - PROTOC="./protoc" + PROTOC="../bazel-bin/protoc" fi $PROTOC --cpp_out=dllexport_decl=PROTOBUF_EXPORT:$TMP ${RUNTIME_PROTO_FILES[@]} && \ diff --git a/java/internal/BUILD.bazel b/java/internal/BUILD.bazel index 662dabd562..598b8b562f 100644 --- a/java/internal/BUILD.bazel +++ b/java/internal/BUILD.bazel @@ -6,8 +6,19 @@ pkg_files( name = "dist_files", srcs = [ "BUILD.bazel", + "JavaVersionTest.java", "testing.bzl", ], strip_prefix = strip_prefix.from_root(""), visibility = ["//java:__pkg__"], ) + +java_test( + name = "java_version", + test_class = "JavaVersionTest", + srcs = ["JavaVersionTest.java"], + deps = [ + "@maven//:com_google_truth_truth", + "@maven//:junit_junit", + ], +) diff --git a/java/internal/JavaVersionTest.java b/java/internal/JavaVersionTest.java new file mode 100644 index 0000000000..eb004d5bd9 --- /dev/null +++ b/java/internal/JavaVersionTest.java @@ -0,0 +1,22 @@ +// Test that Kokoro is using the expected version of Java. +import static com.google.common.truth.Truth.assertWithMessage; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class JavaVersionTest { + @Test + public void testJavaVersion() throws Exception { + String exp = System.getenv("KOKORO_JAVA_VERSION"); + if(exp == null || exp.isEmpty()) { + System.err.println("No kokoro java version found, skipping check"); + return; + } + String version = System.getProperty("java.version"); + assertWithMessage("Expected Python " + exp + " but found Python " + version) + .that(version.startsWith(exp)) + .isTrue(); + } +} diff --git a/java/pom.xml b/java/pom.xml index c086992432..f8083c430a 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -33,7 +33,7 @@ ${project.basedir}/../.. ${protobuf.basedir}/src - ${protobuf.source.dir}/protoc + ${protobuf.basedir}/protoc src/test/proto ${project.build.directory}/generated-sources ${project.build.directory}/generated-test-sources diff --git a/kokoro/common/check_missing_dist_files.sh b/kokoro/common/check_missing_dist_files.sh deleted file mode 100755 index db4d92fc11..0000000000 --- a/kokoro/common/check_missing_dist_files.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# -# Script to compare a distribution archive for expected files based on git. -# -# Usage: -# check_missing_dist_files.sh path/to/dist_archive.tar.gz - -set -eux -set -o pipefail - -# By default, look for a git repo based on this script's path. -: ${SOURCE_DIR:=$(cd $(dirname $0)/../.. ; pwd)} - -# Use a temporary directory for intermediate files. -# Note that pipelines below use subshells to avoid multiple trap executions. -_workdir=$(mktemp -d) -function cleanup_workdir() { rm -r ${_workdir}; } -trap cleanup_workdir EXIT - -# List all the files in the archive. -( - tar -atf $1 | \ - cut -d/ -f2- | \ - sort -) > ${_workdir}/archive.lst - -# List all files in the git repo that should be in the archive. -( - git -C ${SOURCE_DIR} ls-files | \ - grep "^\(java\|python\|objectivec\|csharp\|ruby\|php\|cmake\|examples\|src/google/protobuf/.*\.proto\)" |\ - grep -v ".gitignore" | \ - grep -v "java/lite/proguard.pgcfg" | \ - grep -v "python/compatibility_tests" | \ - grep -v "python/docs" | \ - grep -v "python/.repo-metadata.json" | \ - grep -v "python/protobuf_distutils" | \ - grep -v "csharp/compatibility_tests" | \ - sort -) > ${_workdir}/expected.lst - -# Check for missing files. -MISSING_FILES=( $(cd ${_workdir} && comm -13 archive.lst expected.lst) ) -if (( ${#MISSING_FILES[@]} == 0 )); then - exit 0 -fi - -( - set +x - echo -e "\n\nMissing files from archive:" - for (( i=0 ; i < ${#MISSING_FILES[@]} ; i++ )); do - echo " ${MISSING_FILES[i]}" - done - echo -e "\nAdd them to the 'pkg_files' rule in corresponding BUILD.bazel.\n" -) >&2 -exit 1 diff --git a/kokoro/common/pyenv.sh b/kokoro/common/pyenv.sh deleted file mode 100644 index f89dc26a50..0000000000 --- a/kokoro/common/pyenv.sh +++ /dev/null @@ -1,16 +0,0 @@ -# Shared logic to choose a Python version with pyenv. -# -# This file should be `source`d. - -# Requested version of Python can be overridden by env variable. -: ${PYTHON_VERSION:=3.9.5} - -if pyenv --version >/dev/null ; then - eval "$(pyenv init -)" - if ! pyenv global ${PYTHON_VERSION}; then - echo "Python ${PYTHON_VERSION} is not available. Versions available:" >&2 - pyenv versions >&2 - exit 1 - fi -fi -echo "Using $(python --version || python3 --version)" diff --git a/kokoro/docs/publish-python.sh b/kokoro/docs/publish-python.sh index e3d53c7ded..9f8801757c 100755 --- a/kokoro/docs/publish-python.sh +++ b/kokoro/docs/publish-python.sh @@ -16,7 +16,7 @@ sudo apt-get update sudo apt-get -y install unzip wget https://github.com/protocolbuffers/protobuf/releases/download/v21.1/protoc-21.1-linux-x86_64.zip unzip protoc-21.1-linux-x86_64.zip bin/protoc -mv bin/protoc ../src/protoc +mv bin/protoc ../protoc python3 -m venv venv source venv/bin/activate python setup.py install diff --git a/kokoro/linux/32-bit/Dockerfile b/kokoro/linux/32-bit/Dockerfile deleted file mode 100644 index 1278889f91..0000000000 --- a/kokoro/linux/32-bit/Dockerfile +++ /dev/null @@ -1,143 +0,0 @@ -# This Dockerfile specifies the recipe for creating an image for the tests -# to run in. -# -# We install as many test dependencies here as we can, because these setup -# steps can be cached. They do *not* run every time we run the build. -# The Docker image is only rebuilt when the Dockerfile (ie. this file) -# changes. - -# Base Dockerfile for gRPC dev images -FROM 32bit/debian:latest - -# Apt source for php -RUN echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu trusty main" | tee /etc/apt/sources.list.d/various-php.list && \ - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F4FCBB07 - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get clean && apt-get update && apt-get install -y --force-yes \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - unzip \ - # -- For python -- - python-setuptools \ - python-pip \ - python-dev \ - # -- For C++ benchmarks -- - cmake \ - # -- For PHP -- - php5.5 \ - php5.5-dev \ - php5.5-xml \ - php5.6 \ - php5.6-dev \ - php5.6-xml \ - php7.0 \ - php7.0-dev \ - php7.0-xml \ - phpunit \ - valgrind \ - libxml2-dev \ - && apt-get clean - -################## -# PHP dependencies. -RUN wget http://am1.php.net/get/php-5.5.38.tar.bz2/from/this/mirror -RUN mv mirror php-5.5.38.tar.bz2 -RUN tar -xvf php-5.5.38.tar.bz2 -RUN cd php-5.5.38 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-5.5-zts && \ - make && make install && make clean && cd .. -RUN cd php-5.5.38 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-5.5 && \ - make && make install && make clean && cd .. - -RUN wget http://am1.php.net/get/php-5.6.30.tar.bz2/from/this/mirror -RUN mv mirror php-5.6.30.tar.bz2 -RUN tar -xvf php-5.6.30.tar.bz2 -RUN cd php-5.6.30 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-5.6-zts && \ - make && make install && cd .. -RUN cd php-5.6.30 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-5.6 && \ - make && make install && cd .. - -RUN wget http://am1.php.net/get/php-7.0.18.tar.bz2/from/this/mirror -RUN mv mirror php-7.0.18.tar.bz2 -RUN tar -xvf php-7.0.18.tar.bz2 -RUN cd php-7.0.18 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-7.0-zts && \ - make && make install && cd .. -RUN cd php-7.0.18 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-7.0 && \ - make && make install && cd .. - -RUN wget http://am1.php.net/get/php-7.1.4.tar.bz2/from/this/mirror -RUN mv mirror php-7.1.4.tar.bz2 -RUN tar -xvf php-7.1.4.tar.bz2 -RUN cd php-7.1.4 && ./configure --enable-maintainer-zts --prefix=/usr/local/php-7.1-zts && \ - make && make install && cd .. -RUN cd php-7.1.4 && make clean && ./configure --enable-bcmath --prefix=/usr/local/php-7.1 && \ - make && make install && cd .. - -RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" -RUN php composer-setup.php -RUN mv composer.phar /usr/bin/composer -RUN php -r "unlink('composer-setup.php');" -RUN composer config -g -- disable-tls true -RUN composer config -g -- secure-http false -RUN cd /tmp && \ - git clone https://github.com/google/protobuf.git && \ - cd protobuf/php && \ - git reset --hard 49b44bff2b6257a119f9c6a342d6151c736586b8 && \ - ln -sfn /usr/local/php-5.5/bin/php /usr/bin/php && \ - ln -sfn /usr/local/php-5.5/bin/php-config /usr/bin/php-config && \ - ln -sfn /usr/local/php-5.5/bin/phpize /usr/bin/phpize && \ - composer install && \ - mv vendor /usr/local/vendor-5.5 && \ - ln -sfn /usr/local/php-5.6/bin/php /usr/bin/php && \ - ln -sfn /usr/local/php-5.6/bin/php-config /usr/bin/php-config && \ - ln -sfn /usr/local/php-5.6/bin/phpize /usr/bin/phpize && \ - composer install && \ - mv vendor /usr/local/vendor-5.6 && \ - ln -sfn /usr/local/php-7.0/bin/php /usr/bin/php && \ - ln -sfn /usr/local/php-7.0/bin/php-config /usr/bin/php-config && \ - ln -sfn /usr/local/php-7.0/bin/phpize /usr/bin/phpize && \ - composer install && \ - mv vendor /usr/local/vendor-7.0 && \ - ln -sfn /usr/local/php-7.1/bin/php /usr/bin/php && \ - ln -sfn /usr/local/php-7.1/bin/php-config /usr/bin/php-config && \ - ln -sfn /usr/local/php-7.1/bin/phpize /usr/bin/phpize && \ - composer install && \ - mv vendor /usr/local/vendor-7.1 - -################## -# Python dependencies - -# These packages exist in apt-get, but their versions are too old, so we have -# to get updates from pip. - -RUN pip install pip --upgrade -RUN pip install virtualenv tox yattag - -################## -# Prepare ccache - -RUN ln -s /usr/bin/ccache /usr/local/bin/gcc -RUN ln -s /usr/bin/ccache /usr/local/bin/g++ -RUN ln -s /usr/bin/ccache /usr/local/bin/cc -RUN ln -s /usr/bin/ccache /usr/local/bin/c++ -RUN ln -s /usr/bin/ccache /usr/local/bin/clang -RUN ln -s /usr/bin/ccache /usr/local/bin/clang++ - -# Define the default command. -CMD ["bash"] diff --git a/kokoro/linux/32-bit/build.sh b/kokoro/linux/32-bit/build.sh index 8c0a41ea2e..85dd81daa4 100755 --- a/kokoro/linux/32-bit/build.sh +++ b/kokoro/linux/32-bit/build.sh @@ -4,15 +4,20 @@ # running the "pull request 32" project: # # This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. +# a script to run inside that image. + +set -ex # Change to repo root cd $(dirname $0)/../../.. +GIT_REPO_ROOT=$(pwd) -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/php_32bit -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="php_all_32" -./kokoro/linux/build_and_run_docker.sh +CONTAINER_IMAGE=gcr.io/protobuf-build/php/32bit@sha256:824cbdff02ee543eb69ee4b02c8c58cc7887f70f49e41725a35765d92a898b4f + +git submodule update --init --recursive + +docker run \ + "$@" \ + -v $GIT_REPO_ROOT:/workspace \ + $CONTAINER_IMAGE \ + bash -l "/workspace/kokoro/linux/32-bit/test_php.sh" diff --git a/kokoro/linux/32-bit/test_php.sh b/kokoro/linux/32-bit/test_php.sh new file mode 100644 index 0000000000..3770b84af3 --- /dev/null +++ b/kokoro/linux/32-bit/test_php.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +set -eux + +# Change to repo root +cd $(dirname $0)/../../.. + +use_php() { + VERSION=$1 + export PATH=/usr/local/php-${VERSION}/bin:$PATH +} + +build_php() { + use_php $1 + pushd php + rm -rf vendor + php -v + php -m + composer update + composer test + popd +} + +test_php_c() { + pushd php + rm -rf vendor + php -v + php -m + composer update + composer test_c + popd +} + +build_php_c() { + use_php $1 + test_php_c +} + +cmake . +cmake --build . --target protoc -- -j20 +export PROTOC=$(pwd)/protoc + +build_php 7.0 +build_php 7.1 +build_php 7.4 +build_php_c 7.0 +build_php_c 7.1 +build_php_c 7.4 +build_php_c 7.1-zts +build_php_c 7.2-zts +build_php_c 7.5-zts diff --git a/kokoro/linux/aarch64/protoc_crosscompile_aarch64.sh b/kokoro/linux/aarch64/protoc_crosscompile_aarch64.sh index d116c2f4a1..2880507539 100755 --- a/kokoro/linux/aarch64/protoc_crosscompile_aarch64.sh +++ b/kokoro/linux/aarch64/protoc_crosscompile_aarch64.sh @@ -6,6 +6,3 @@ set -ex cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_WITH_ZLIB=0 . make -j8 - -# The Java build setup expects the protoc binary to be in the src/ directory. -ln -s $PWD/protoc ./src/protoc diff --git a/kokoro/linux/aarch64/python_crosscompile_aarch64.sh b/kokoro/linux/aarch64/python_crosscompile_aarch64.sh index 03cf44f9c6..97d0a2403a 100755 --- a/kokoro/linux/aarch64/python_crosscompile_aarch64.sh +++ b/kokoro/linux/aarch64/python_crosscompile_aarch64.sh @@ -15,10 +15,6 @@ git submodule update --init --recursive cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_WITH_ZLIB=0 . make -j8 -# Copy lib files to the expected location. -mkdir -p src/.libs -ln -f *.a src/.libs/ - # create a simple shell wrapper that runs crosscompiled protoc under qemu echo '#!/bin/bash' >protoc_qemu_wrapper.sh echo 'exec qemu-aarch64 "../protoc" "$@"' >>protoc_qemu_wrapper.sh diff --git a/kokoro/linux/bazel.sh b/kokoro/linux/bazel.sh new file mode 100755 index 0000000000..b7c8000dc1 --- /dev/null +++ b/kokoro/linux/bazel.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +set -ex + +if [[ -z "${CONTAINER_IMAGE}" ]]; then + CONTAINER_IMAGE=gcr.io/protobuf-build/bazel/linux@sha256:2bfd061284eff8234f2fcca16d71d43c69ccf3a22206628b54c204a6a9aac277 +fi + +cd $(dirname $0)/../.. +GIT_REPO_ROOT=`pwd` +rm -rf $GIT_REPO_ROOT/logs + +ENVS=() + +# Check for specific versions pinned to the docker image. In these cases we +# want to forward the environment variable to tests, so that they can verify +# that the correct version is being picked up by Bazel. +ENVS+=("--test_env=KOKORO_JAVA_VERSION") +ENVS+=("--test_env=KOKORO_PYTHON_VERSION") +ENVS+=("--test_env=KOKORO_RUBY_VERSION") + +if [ -n "$BAZEL_ENV" ]; then + for env in $BAZEL_ENV; do + ENVS+="--action_env=${env}" + done +fi + +tmpfile=$(mktemp -u) + +docker run \ + --cidfile $tmpfile \ + -v $GIT_REPO_ROOT:/workspace \ + $CONTAINER_IMAGE \ + test \ + --keep_going \ + --test_output=streamed \ + ${ENVS[@]} \ + $PLATFORM_CONFIG \ + $BAZEL_EXTRA_FLAGS \ + $BAZEL_TARGETS + +# Save logs for Kokoro +docker cp \ + `cat $tmpfile`:/workspace/logs $KOKORO_ARTIFACTS_DIR diff --git a/kokoro/linux/bazel/build.sh b/kokoro/linux/bazel/build.sh deleted file mode 100755 index bc8fdcb05d..0000000000 --- a/kokoro/linux/bazel/build.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests -set -eu - -# Install Bazel 4.0.0. -use_bazel.sh 4.0.0 -bazel version - -# Change to repo root -cd $(dirname $0)/../../.. - -# Get kokoro scripts from repo root by default. -: ${SCRIPT_ROOT:=$(pwd)} -source ${SCRIPT_ROOT}/kokoro/common/pyenv.sh - -# Disabled for now, re-enable if appropriate. -# //:build_files_updated_unittest \ - -bazel_args=( - test - --keep_going - --copt=-Werror - --host_copt=-Werror - --test_output=errors - -- - //... - -//objectivec/... # only works on macOS - @com_google_protobuf_examples//... -) - -${SCRIPT_ROOT}/kokoro/common/bazel_wrapper.sh "${bazel_args[@]}" - -# Verify that we can build successfully from generated tar files. -( - pyenv versions - pyenv shell 2.7.9 # python2 required for old googletest autotools support - git submodule update --init --recursive - ./autogen.sh && ./configure && make -j$(nproc) dist -) -DIST=`ls *.tar.gz` -tar -xf $DIST -cd ${DIST//.tar.gz} -${SCRIPT_ROOT}/kokoro/common/bazel_wrapper.sh build //:protobuf //:protobuf_java diff --git a/kokoro/linux/bazel/common.cfg b/kokoro/linux/bazel/common.cfg deleted file mode 100644 index 6b1848816d..0000000000 --- a/kokoro/linux/bazel/common.cfg +++ /dev/null @@ -1,9 +0,0 @@ -# Common config shared by presubmit and continuous. - -bazel_setting: { - project_id: "protobuf-build" - bes_backend_address: "buildeventservice.googleapis.com" - foundry_backend_address: "remotebuildexecution.googleapis.com" - upsalite_frontend_address: "https://source.cloud.google.com" - local_execution: true -} diff --git a/kokoro/linux/bazel/continuous.cfg b/kokoro/linux/bazel/continuous.cfg index 13cfef1583..21fe759f6e 100644 --- a/kokoro/linux/bazel/continuous.cfg +++ b/kokoro/linux/bazel/continuous.cfg @@ -1,5 +1,16 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 15 + +env_vars { + key: "BAZEL_TARGETS" + value: "//src/..." +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/bazel/presubmit.cfg b/kokoro/linux/bazel/presubmit.cfg index 13cfef1583..103128b98d 100644 --- a/kokoro/linux/bazel/presubmit.cfg +++ b/kokoro/linux/bazel/presubmit.cfg @@ -1,5 +1,16 @@ -# Config file for running tests in Kokoro +# Config file for running C++ Bazel tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/bazel/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 15 + +env_vars { + key: "BAZEL_TARGETS" + value: "//src/..." +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/benchmark/build.sh b/kokoro/linux/benchmark/build.sh deleted file mode 100755 index f470989394..0000000000 --- a/kokoro/linux/benchmark/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/java_stretch -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="benchmark" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/benchmark/continuous.cfg b/kokoro/linux/benchmark/continuous.cfg index 8cc8f96bfa..ddab7d2bc3 100644 --- a/kokoro/linux/benchmark/continuous.cfg +++ b/kokoro/linux/benchmark/continuous.cfg @@ -1,7 +1,7 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/benchmark/build.sh" +build_file: "protobuf/kokoro/linux/benchmark/run.sh" timeout_mins: 240 action { diff --git a/kokoro/linux/benchmark/run.sh b/kokoro/linux/benchmark/run.sh index 963f7796ab..efe09ca1cc 100755 --- a/kokoro/linux/benchmark/run.sh +++ b/kokoro/linux/benchmark/run.sh @@ -1,7 +1,11 @@ #!/bin/bash # +# Install Bazel 4.0.0. +use_bazel.sh 4.0.0 + # Change to repo root cd $(dirname $0)/../../.. +SCRIPT_ROOT=$(pwd) set -ex @@ -18,82 +22,37 @@ datasets=$(for file in $(find . -type f -name "dataset.*.pb" -not -path "./tmp/* echo $datasets popd -# build Python protobuf -./autogen.sh -./configure CXXFLAGS="-fPIC -O2" -make -j8 -pushd python -python3 -m venv env -source env/bin/activate -python3 setup.py build --cpp_implementation -pip3 install --install-option="--cpp_implementation" . -popd - # build and run Python benchmark -# We do this before building protobuf C++ since C++ build -# will rewrite some libraries used by protobuf python. -pushd benchmarks -make python-pure-python-benchmark -make python-cpp-reflection-benchmark -make -j8 python-cpp-generated-code-benchmark -echo "[" > tmp/python_result.json echo "benchmarking pure python..." -./python-pure-python-benchmark --json --behavior_prefix="pure-python-benchmark" $datasets >> tmp/python_result.json -echo "," >> "tmp/python_result.json" +${SCRIPT_ROOT}/kokoro/common/bazel_wrapper.sh run //benchmarks/python:python_benchmark -- \ + --json --behavior_prefix="pure-python-benchmark" $datasets > /tmp/python1.json echo "benchmarking python cpp reflection..." -env LD_LIBRARY_PATH="${repo_root}/src/.libs" ./python-cpp-reflection-benchmark --json --behavior_prefix="cpp-reflection-benchmark" $datasets >> tmp/python_result.json -echo "," >> "tmp/python_result.json" +${SCRIPT_ROOT}/kokoro/common/bazel_wrapper.sh run //benchmarks/python:python_benchmark --define=use_fast_cpp_protos=true -- \ + --json --behavior_prefix="cpp-reflection-benchmark" $datasets > /tmp/python2.json echo "benchmarking python cpp generated code..." -env LD_LIBRARY_PATH="${repo_root}/src/.libs" ./python-cpp-generated-code-benchmark --json --behavior_prefix="cpp-generated-code-benchmark" $datasets >> tmp/python_result.json -echo "]" >> "tmp/python_result.json" -popd +${SCRIPT_ROOT}/kokoro/common/bazel_wrapper.sh run //benchmarks/python:python_benchmark --define=use_fast_cpp_protos=true -- \ + --json --cpp_generated --behavior_prefix="cpp-generated-code-benchmark" $datasets >> /tmp/python3.json -# build CPP protobuf -./configure -make clean && make -j8 - -pushd java -mvn package -B -Dmaven.test.skip=true -popd - -pushd benchmarks +jq -s . /tmp/python1.json /tmp/python2.json /tmp/python3.json > python_result.json # build and run C++ benchmark -# "make clean" deletes the contents of the tmp/ directory, so we move it elsewhere and then restore it once build is done. -# TODO(jtattermusch): find a less clumsy way of protecting python_result.json contents -mv tmp/python_result.json . && make clean && make -j8 cpp-benchmark && mv python_result.json tmp echo "benchmarking cpp..." -env ./cpp-benchmark --benchmark_min_time=5.0 --benchmark_out_format=json --benchmark_out="tmp/cpp_result.json" $datasets - -# TODO(jtattermusch): add benchmarks for https://github.com/protocolbuffers/protobuf-go. -# The original benchmarks for https://github.com/golang/protobuf were removed -# because: -# * they were broken and haven't been producing results for a long time -# * the https://github.com/golang/protobuf implementation has been superseded by -# https://github.com/protocolbuffers/protobuf-go +${SCRIPT_ROOT}/kokoro/common/bazel_wrapper.sh run //benchmarks/cpp:cpp_benchmark -- \ + --benchmark_min_time=5.0 --benchmark_out_format=json --benchmark_out="${repo_root}/cpp_result.json" $datasets # build and run java benchmark (java 11 is required) -make java-benchmark echo "benchmarking java..." -./java-benchmark -Cresults.file.options.file="tmp/java_result.json" $datasets - -# TODO(jtattermusch): re-enable JS benchmarks once https://github.com/protocolbuffers/protobuf/issues/8747 is fixed. -# build and run js benchmark -# make js-benchmark -# echo "benchmarking js..." -# ./js-benchmark $datasets --json_output=$(pwd)/tmp/node_result.json - -# TODO(jtattermusch): add php-c-benchmark. Currently its build is broken. +${SCRIPT_ROOT}/kokoro/common/bazel_wrapper.sh run //benchmarks/java:java_benchmark -- \ + -Cresults.file.options.file="${repo_root}/java_result.json" $datasets # persist raw the results in the build job log (for better debuggability) -cat tmp/cpp_result.json -cat tmp/java_result.json -cat tmp/python_result.json +cat cpp_result.json +cat java_result.json +cat python_result.json # print the postprocessed results to the build job log # TODO(jtattermusch): re-enable uploading results to bigquery (it is currently broken) -make python_add_init -env LD_LIBRARY_PATH="${repo_root}/src/.libs" python3 -m util.result_parser \ - -cpp="../tmp/cpp_result.json" -java="../tmp/java_result.json" -python="../tmp/python_result.json" -popd - +bazel run //benchmarks/util:result_parser -- \ + -cpp="${repo_root}/cpp_result.json" \ + -java="${repo_root}/java_result.json" \ + -python="${repo_root}/python_result.json" diff --git a/kokoro/linux/build_and_run_docker.sh b/kokoro/linux/build_and_run_docker.sh deleted file mode 100755 index cdbd6e29b0..0000000000 --- a/kokoro/linux/build_and_run_docker.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -# -# Builds docker image and runs a command under it. -# This is a generic script that is configured with the following variables: -# -# DOCKERHUB_ORGANIZATION - The organization on docker hub storing the -# Dockerfile. -# DOCKERFILE_DIR - Directory in which Dockerfile file is located. -# DOCKER_RUN_SCRIPT - Script to run under docker (relative to protobuf repo root) -# OUTPUT_DIR - Directory that will be copied from inside docker after finishing. -# $@ - Extra args to pass to docker run - -set -ex - -cd $(dirname $0)/../.. -git_root=$(pwd) -cd - - -# Use image name based on Dockerfile sha1 -if [ -z "$DOCKERHUB_ORGANIZATION" ] -then - DOCKERHUB_ORGANIZATION=grpctesting/protobuf - DOCKER_IMAGE_NAME=${DOCKERHUB_ORGANIZATION}_$(sha1sum $DOCKERFILE_DIR/Dockerfile | cut -f1 -d\ ) -else - # TODO(teboring): Remove this when all tests have been migrated to separate - # docker images. - DOCKERFILE_PREFIX=$(basename $DOCKERFILE_DIR) - DOCKER_IMAGE_NAME=${DOCKERHUB_ORGANIZATION}/${DOCKERFILE_PREFIX}_$(sha1sum $DOCKERFILE_DIR/Dockerfile | cut -f1 -d\ ) -fi - -# Pull dockerimage from Dockerhub. This sometimes fails intermittently, so we -# keep trying until we succeed. -until docker pull $DOCKER_IMAGE_NAME; do sleep 10; done - -# Ensure existence of ccache directory -CCACHE_DIR=/tmp/protobuf-ccache -mkdir -p $CCACHE_DIR - -# Choose random name for docker container -CONTAINER_NAME="build_and_run_docker_$(uuidgen)" - -echo $git_root - -# Run command inside docker -docker run \ - "$@" \ - -e CCACHE_DIR=$CCACHE_DIR \ - -e KOKORO_BUILD_NUMBER=$KOKORO_BUILD_NUMBER \ - -e KOKORO_BUILD_ID=$KOKORO_BUILD_ID \ - -e EXTERNAL_GIT_ROOT="/var/local/kokoro/protobuf" \ - -e TEST_SET="$TEST_SET" \ - -v "$git_root:/var/local/kokoro/protobuf:ro" \ - -v $CCACHE_DIR:$CCACHE_DIR \ - -w /var/local/git/protobuf \ - --name=$CONTAINER_NAME \ - $DOCKER_IMAGE_NAME \ - bash -l "/var/local/kokoro/protobuf/$DOCKER_RUN_SCRIPT" || FAILED="true" - -# remove the container, possibly killing it first -docker rm -f $CONTAINER_NAME || true - -[ -z "$FAILED" ] || { - exit 1 -} diff --git a/kokoro/linux/cpp_aarch64/build.sh b/kokoro/linux/cpp_aarch64/build.sh deleted file mode 100755 index a43ab1c71e..0000000000 --- a/kokoro/linux/cpp_aarch64/build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "continuous" and "presubmit" jobs. - -set -ex - -# Change to repo root -cd $(dirname $0)/../../.. - -kokoro/linux/aarch64/test_cpp_aarch64.sh diff --git a/kokoro/linux/cpp_aarch64/continuous.cfg b/kokoro/linux/cpp_aarch64/continuous.cfg index 0f1be4a224..f77f73b928 100644 --- a/kokoro/linux/cpp_aarch64/continuous.cfg +++ b/kokoro/linux/cpp_aarch64/continuous.cfg @@ -1,5 +1,21 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/cpp_aarch64/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/emulation/linux:aarch64-4e847d7a01c1792471b6dd985ab0bf2677332e6f" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//src/..." +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/cpp_aarch64/presubmit.cfg b/kokoro/linux/cpp_aarch64/presubmit.cfg index 0f1be4a224..f77f73b928 100644 --- a/kokoro/linux/cpp_aarch64/presubmit.cfg +++ b/kokoro/linux/cpp_aarch64/presubmit.cfg @@ -1,5 +1,21 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/cpp_aarch64/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/emulation/linux:aarch64-4e847d7a01c1792471b6dd985ab0bf2677332e6f" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//src/..." +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/cpp_tcmalloc/build.sh b/kokoro/linux/cpp_tcmalloc/build.sh deleted file mode 100755 index 3c77b11e70..0000000000 --- a/kokoro/linux/cpp_tcmalloc/build.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Build file to set up and run tests - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/cpp_tcmalloc -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="cpp_tcmalloc" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/cpp_tcmalloc/continuous.cfg b/kokoro/linux/cpp_tcmalloc/continuous.cfg index 46312a9be2..fb76204e90 100644 --- a/kokoro/linux/cpp_tcmalloc/continuous.cfg +++ b/kokoro/linux/cpp_tcmalloc/continuous.cfg @@ -1,5 +1,21 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/cpp_tcmalloc/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 1440 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/tcmalloc/linux:64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//src/..." +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/cpp_tcmalloc/presubmit.cfg b/kokoro/linux/cpp_tcmalloc/presubmit.cfg index 46312a9be2..fb76204e90 100644 --- a/kokoro/linux/cpp_tcmalloc/presubmit.cfg +++ b/kokoro/linux/cpp_tcmalloc/presubmit.cfg @@ -1,5 +1,21 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/cpp_tcmalloc/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 1440 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/tcmalloc/linux:64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//src/..." +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/csharp/build.sh b/kokoro/linux/csharp/build.sh deleted file mode 100755 index 9a2eb48621..0000000000 --- a/kokoro/linux/csharp/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/csharp -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="csharp" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/csharp/continuous.cfg b/kokoro/linux/csharp/continuous.cfg index 3d177670a9..2332c00dce 100644 --- a/kokoro/linux/csharp/continuous.cfg +++ b/kokoro/linux/csharp/continuous.cfg @@ -1,5 +1,27 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/csharp/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 1440 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/csharp/linux:3.1.415-6.0.100-6bbe70439ba5b0404bb12662cebc0296909389fa" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//csharp/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--action_env=DOTNET_CLI_TELEMETRY_OPTOUT=1 " + "--test_env=DOTNET_CLI_HOME=/home/bazel" +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/csharp/presubmit.cfg b/kokoro/linux/csharp/presubmit.cfg index 3d177670a9..2332c00dce 100644 --- a/kokoro/linux/csharp/presubmit.cfg +++ b/kokoro/linux/csharp/presubmit.cfg @@ -1,5 +1,27 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/csharp/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 1440 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/csharp/linux:3.1.415-6.0.100-6bbe70439ba5b0404bb12662cebc0296909389fa" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//csharp/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--action_env=DOTNET_CLI_TELEMETRY_OPTOUT=1 " + "--test_env=DOTNET_CLI_HOME=/home/bazel" +} + +action { + define_artifacts { + regex: "**/sponge_log.*" + } +} diff --git a/kokoro/linux/dockerfile/push_testing_images.sh b/kokoro/linux/dockerfile/push_testing_images.sh deleted file mode 100755 index 2d82babba4..0000000000 --- a/kokoro/linux/dockerfile/push_testing_images.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -set -ex - -cd $(dirname $0)/../../.. -git_root=$(pwd) -cd kokoro/linux/dockerfile - -DOCKERHUB_ORGANIZATION=protobuftesting - -for DOCKERFILE_DIR in test/* -do - # Generate image name based on Dockerfile checksum. That works well as long - # as can count on dockerfiles being written in a way that changing the logical - # contents of the docker image always changes the SHA (e.g. using "ADD file" - # cmd in the dockerfile in not ok as contents of the added file will not be - # reflected in the SHA). - DOCKER_IMAGE_NAME=$(basename $DOCKERFILE_DIR)_$(sha1sum $DOCKERFILE_DIR/Dockerfile | cut -f1 -d\ ) - - echo $DOCKER_IMAGE_NAME - # skip the image if it already exists in the repo - curl --silent -f -lSL https://registry.hub.docker.com/v2/repositories/${DOCKERHUB_ORGANIZATION}/${DOCKER_IMAGE_NAME}/tags/latest > /dev/null \ - && continue - - docker build -t ${DOCKERHUB_ORGANIZATION}/${DOCKER_IMAGE_NAME} ${DOCKERFILE_DIR} - - # "docker login" needs to be run in advance - docker push ${DOCKERHUB_ORGANIZATION}/${DOCKER_IMAGE_NAME} -done diff --git a/kokoro/linux/dockerfile/test/cpp_tcmalloc/Dockerfile b/kokoro/linux/dockerfile/test/cpp_tcmalloc/Dockerfile deleted file mode 100644 index 0ce9982ad4..0000000000 --- a/kokoro/linux/dockerfile/test/cpp_tcmalloc/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -FROM debian:jessie - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - && apt-get clean - -# Install dependencies for TC malloc -RUN apt-get install -y \ - google-perftools \ - libgoogle-perftools4 \ - libgoogle-perftools-dev diff --git a/kokoro/linux/dockerfile/test/csharp/Dockerfile b/kokoro/linux/dockerfile/test/csharp/Dockerfile deleted file mode 100644 index c07fcbcef1..0000000000 --- a/kokoro/linux/dockerfile/test/csharp/Dockerfile +++ /dev/null @@ -1,41 +0,0 @@ -FROM debian:buster - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - && apt-get clean - -# Update ca-certificates to fix known buster + .NET 5 issue -# https://github.com/NuGet/Announcements/issues/49 -RUN apt-get update && apt-get install -y ca-certificates && apt-get clean - -# dotnet SDK prerequisites -RUN apt-get update && apt-get install -y libunwind8 libicu63 && apt-get clean - -# Install dotnet SDK via install script -RUN wget -q https://dot.net/v1/dotnet-install.sh && \ - chmod u+x dotnet-install.sh && \ - ./dotnet-install.sh --version 3.1.415 && \ - ./dotnet-install.sh --version 6.0.100 && \ - ln -s /root/.dotnet/dotnet /usr/local/bin - -RUN wget -q www.nuget.org/NuGet.exe -O /usr/local/bin/nuget.exe - -ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE true diff --git a/kokoro/linux/dockerfile/test/java_stretch/Dockerfile b/kokoro/linux/dockerfile/test/java_stretch/Dockerfile deleted file mode 100644 index 0716927637..0000000000 --- a/kokoro/linux/dockerfile/test/java_stretch/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -# Despite the name of this image, we are no longer on stretch. -# We should consider renaming this image, and/or evaluating what -# software versions we actually need. -FROM debian:bullseye - -# Install dependencies. We start with the basic ones required to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - cmake \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - pkg-config \ - time \ - wget \ - # Java dependencies - maven \ - openjdk-11-jdk \ - openjdk-17-jdk \ - # Required for the gtest build. - python2 \ - # Python dependencies - python3-dev \ - python3-setuptools \ - python3-pip \ - python3-venv \ - && apt-get clean diff --git a/kokoro/linux/dockerfile/test/php/Dockerfile b/kokoro/linux/dockerfile/test/php/Dockerfile deleted file mode 100644 index 4c9d69d181..0000000000 --- a/kokoro/linux/dockerfile/test/php/Dockerfile +++ /dev/null @@ -1,255 +0,0 @@ -FROM debian:jessie - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - re2c \ - sqlite3 \ - libsqlite3-dev \ - && apt-get clean - -# Install php dependencies -RUN apt-get clean && apt-get update && apt-get install -y --force-yes \ - php5 \ - libcurl4-openssl-dev \ - libgmp-dev \ - libgmp3-dev \ - libssl-dev \ - libxml2-dev \ - unzip \ - zlib1g-dev \ - pkg-config \ - && apt-get clean - -# Install other dependencies -RUN ln -sf /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h -RUN wget http://ftp.gnu.org/gnu/bison/bison-2.6.4.tar.gz -O /var/local/bison-2.6.4.tar.gz -RUN cd /var/local \ - && tar -zxvf bison-2.6.4.tar.gz \ - && cd /var/local/bison-2.6.4 \ - && ./configure \ - && make \ - && make install - -# Install composer -RUN curl -sS https://getcomposer.org/installer | php -RUN mv composer.phar /usr/local/bin/composer - -# Download php source code -RUN git clone https://github.com/php/php-src - -# php 5.6 -RUN cd php-src \ - && git checkout PHP-5.6.39 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --enable-mbstring \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-5.6 \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-5.phar \ - && chmod +x phpunit \ - && mv phpunit /usr/local/php-5.6/bin - -# php 7.0 -RUN cd php-src \ - && git checkout PHP-7.0.33 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --enable-mbstring \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.0 \ - && make \ - && make install \ - && make clean -RUN cd php-src \ - && ./configure \ - --enable-maintainer-zts \ - --enable-mbstring \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.0-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-6.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.0/bin \ - && mv phpunit /usr/local/php-7.0-zts/bin - -# php 7.1 -RUN cd php-src \ - && git checkout PHP-7.1.25 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --enable-mbstring \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.1 \ - && make \ - && make install \ - && make clean -RUN cd php-src \ - && ./configure \ - --enable-maintainer-zts \ - --enable-mbstring \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.1-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-7.5.0.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.1/bin \ - && mv phpunit /usr/local/php-7.1-zts/bin - -# php 7.2 -RUN cd php-src \ - && git checkout PHP-7.2.13 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --enable-mbstring \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.2 \ - && make \ - && make install \ - && make clean -RUN cd php-src \ - && ./configure \ - --enable-maintainer-zts \ - --enable-mbstring \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.2-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-7.5.0.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.2/bin \ - && mv phpunit /usr/local/php-7.2-zts/bin - -# php 7.3 -RUN cd php-src \ - && git checkout PHP-7.3.0 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --enable-mbstring \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.3 \ - && make \ - && make install \ - && make clean -RUN cd php-src \ - && ./configure \ - --enable-maintainer-zts \ - --enable-mbstring \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.3-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-7.5.0.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.3/bin \ - && mv phpunit /usr/local/php-7.3-zts/bin - -# php 7.4 -RUN wget https://ftp.gnu.org/gnu/bison/bison-3.0.1.tar.gz -O /var/local/bison-3.0.1.tar.gz -RUN cd /var/local \ - && tar -zxvf bison-3.0.1.tar.gz \ - && cd /var/local/bison-3.0.1 \ - && ./configure \ - && make \ - && make install - -RUN wget https://github.com/php/php-src/archive/php-7.4.0.tar.gz -O /var/local/php-7.4.0.tar.gz - -RUN cd /var/local \ - && tar -zxvf php-7.4.0.tar.gz - -RUN cd /var/local/php-src-php-7.4.0 \ - && ./buildconf --force \ - && ./configure \ - --enable-bcmath \ - --enable-mbstring \ - --disable-mbregex \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.4 \ - && make \ - && make install \ - && make clean -RUN cd /var/local/php-src-php-7.4.0 \ - && ./buildconf --force \ - && ./configure \ - --enable-maintainer-zts \ - --enable-mbstring \ - --disable-mbregex \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.4-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-8.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.4/bin \ - && mv phpunit /usr/local/php-7.4-zts/bin - -# Install php dependencies -RUN apt-get clean && apt-get update && apt-get install -y --force-yes \ - valgrind \ - && apt-get clean diff --git a/kokoro/linux/dockerfile/test/php80/Dockerfile b/kokoro/linux/dockerfile/test/php80/Dockerfile deleted file mode 100644 index 5b382d0a10..0000000000 --- a/kokoro/linux/dockerfile/test/php80/Dockerfile +++ /dev/null @@ -1,124 +0,0 @@ -FROM debian:stretch - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - re2c \ - sqlite3 \ - vim \ - libonig-dev \ - libsqlite3-dev \ - && apt-get clean - -# Install php dependencies -RUN apt-get clean && apt-get update && apt-get install -y --force-yes \ - php \ - libcurl4-openssl-dev \ - libgmp-dev \ - libgmp3-dev \ - libssl-dev \ - libxml2-dev \ - unzip \ - zlib1g-dev \ - pkg-config \ - && apt-get clean - -# Install other dependencies -RUN ln -sf /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h -RUN wget https://ftp.gnu.org/gnu/bison/bison-3.0.1.tar.gz -O /var/local/bison-3.0.1.tar.gz -RUN cd /var/local \ - && tar -zxvf bison-3.0.1.tar.gz \ - && cd /var/local/bison-3.0.1 \ - && ./configure \ - && make \ - && make install - -# Install composer -RUN curl -sS https://getcomposer.org/installer | php -RUN mv composer.phar /usr/local/bin/composer - -# Download php source code -RUN git clone https://github.com/php/php-src - -# php 8.0 -RUN cd php-src \ - && git checkout php-8.0.0 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --enable-mbstring \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-8.0 \ - && make \ - && make install \ - && make clean -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --enable-mbstring \ - --enable-maintainer-zts \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-8.0-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-9.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-8.0/bin \ - && mv phpunit /usr/local/php-8.0-zts/bin - -# php 8.1 -RUN cd php-src \ - && git checkout php-8.1.2 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --enable-mbstring \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-8.1 \ - && make \ - && make install \ - && make clean -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --enable-mbstring \ - --enable-maintainer-zts \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-8.1-zts \ - && make \ - && make install \ - && make clean - -# Install php dependencies -RUN apt-get clean && apt-get update && apt-get install -y --force-yes \ - valgrind \ - && apt-get clean diff --git a/kokoro/linux/dockerfile/test/php_32bit/Dockerfile b/kokoro/linux/dockerfile/test/php_32bit/Dockerfile deleted file mode 100644 index 2fd620e1b2..0000000000 --- a/kokoro/linux/dockerfile/test/php_32bit/Dockerfile +++ /dev/null @@ -1,260 +0,0 @@ -FROM i386/debian:jessie - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - re2c \ - sqlite3 \ - libsqlite3-dev \ - && apt-get clean - -# Install php dependencies -RUN apt-get clean && apt-get update && apt-get install -y --force-yes \ - bison \ - php5 \ - libcurl4-openssl-dev \ - libssl-dev \ - libxml2-dev \ - unzip \ - zlib1g-dev \ - pkg-config \ - && apt-get clean - -# Install other dependencies -RUN wget http://ftp.gnu.org/gnu/bison/bison-2.6.4.tar.gz -O /var/local/bison-2.6.4.tar.gz -RUN cd /var/local \ - && tar -zxvf bison-2.6.4.tar.gz \ - && cd /var/local/bison-2.6.4 \ - && ./configure \ - && make \ - && make install - -# Install composer -RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" -RUN php composer-setup.php -RUN mv composer.phar /usr/bin/composer -RUN php -r "unlink('composer-setup.php');" - -# Download php source code -RUN git clone https://github.com/php/php-src - -# php 5.6 -RUN cd php-src \ - && git checkout PHP-5.6.39 \ - && ./buildconf --force -RUN cd php-src \ - && ./configure \ - --enable-bcmath \ - --enable-mbstring \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-5.6 \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-5.phar \ - && chmod +x phpunit \ - && mv phpunit /usr/local/php-5.6/bin - -# php 7.0 -RUN wget https://github.com/php/php-src/archive/php-7.0.33.tar.gz -O /var/local/php-7.0.33.tar.gz - -RUN cd /var/local \ - && tar -zxvf php-7.0.33.tar.gz - -RUN cd /var/local/php-src-php-7.0.33 \ - && ./buildconf --force \ - && ./configure \ - --enable-bcmath \ - --enable-mbstring \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.0 \ - && make \ - && make install \ - && make clean -RUN cd /var/local/php-src-php-7.0.33 \ - && ./buildconf --force \ - && ./configure \ - --enable-maintainer-zts \ - --enable-mbstring \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.0-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-6.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.0/bin \ - && mv phpunit /usr/local/php-7.0-zts/bin - -# php 7.1 -RUN wget https://github.com/php/php-src/archive/php-7.1.25.tar.gz -O /var/local/php-7.1.25.tar.gz - -RUN cd /var/local \ - && tar -zxvf php-7.1.25.tar.gz - -RUN cd /var/local/php-src-php-7.1.25 \ - && ./buildconf --force \ - && ./configure \ - --enable-bcmath \ - --enable-mbstring \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.1 \ - && make \ - && make install \ - && make clean -RUN cd /var/local/php-src-php-7.1.25 \ - && ./buildconf --force \ - && ./configure \ - --enable-maintainer-zts \ - --enable-mbstring \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.1-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-7.5.0.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.1/bin \ - && mv phpunit /usr/local/php-7.1-zts/bin - -# php 7.2 -RUN wget https://github.com/php/php-src/archive/php-7.2.13.tar.gz -O /var/local/php-7.2.13.tar.gz - -RUN cd /var/local \ - && tar -zxvf php-7.2.13.tar.gz - -RUN cd /var/local/php-src-php-7.2.13 \ - && ./buildconf --force \ - && ./configure \ - --enable-bcmath \ - --enable-mbstring \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.2 \ - && make \ - && make install \ - && make clean -RUN cd /var/local/php-src-php-7.2.13 \ - && ./buildconf --force \ - && ./configure \ - --enable-maintainer-zts \ - --enable-mbstring \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.2-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-7.5.0.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.2/bin \ - && mv phpunit /usr/local/php-7.2-zts/bin - -# php 7.3 -RUN wget https://github.com/php/php-src/archive/php-7.3.0.tar.gz -O /var/local/php-7.3.0.tar.gz - -RUN cd /var/local \ - && tar -zxvf php-7.3.0.tar.gz - -RUN cd /var/local/php-src-php-7.3.0 \ - && ./buildconf --force \ - && ./configure \ - --enable-bcmath \ - --enable-mbstring \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.3 \ - && make \ - && make install \ - && make clean -RUN cd /var/local/php-src-php-7.3.0 \ - && ./buildconf --force \ - && ./configure \ - --enable-maintainer-zts \ - --enable-mbstring \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.3-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-7.5.0.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.3/bin \ - && mv phpunit /usr/local/php-7.3-zts/bin - -# php 7.4 -RUN wget https://ftp.gnu.org/gnu/bison/bison-3.0.1.tar.gz -O /var/local/bison-3.0.1.tar.gz -RUN cd /var/local \ - && tar -zxvf bison-3.0.1.tar.gz \ - && cd /var/local/bison-3.0.1 \ - && ./configure \ - && make \ - && make install - -RUN wget https://github.com/php/php-src/archive/php-7.4.0.tar.gz -O /var/local/php-7.4.0.tar.gz - -RUN cd /var/local \ - && tar -zxvf php-7.4.0.tar.gz - -RUN cd /var/local/php-src-php-7.4.0 \ - && ./buildconf --force \ - && ./configure \ - --enable-bcmath \ - --enable-mbstring \ - --disable-mbregex \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.4 \ - && make \ - && make install \ - && make clean -RUN cd /var/local/php-src-php-7.4.0 \ - && ./buildconf --force \ - && ./configure \ - --enable-maintainer-zts \ - --enable-mbstring \ - --disable-mbregex \ - --with-openssl \ - --with-zlib \ - --prefix=/usr/local/php-7.4-zts \ - && make \ - && make install \ - && make clean - -RUN wget -O phpunit https://phar.phpunit.de/phpunit-8.phar \ - && chmod +x phpunit \ - && cp phpunit /usr/local/php-7.4/bin \ - && mv phpunit /usr/local/php-7.4-zts/bin - -# Install php dependencies -RUN apt-get clean && apt-get update && apt-get install -y --force-yes \ - valgrind \ - && apt-get clean diff --git a/kokoro/linux/dockerfile/test/python310/Dockerfile b/kokoro/linux/dockerfile/test/python310/Dockerfile deleted file mode 100644 index e16e93b3b2..0000000000 --- a/kokoro/linux/dockerfile/test/python310/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -FROM python:3.10-buster - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# Install Python libraries. -RUN python -m pip install --no-cache-dir --upgrade \ - pip \ - setuptools \ - tox \ - wheel diff --git a/kokoro/linux/dockerfile/test/python37/Dockerfile b/kokoro/linux/dockerfile/test/python37/Dockerfile deleted file mode 100644 index ee108dd030..0000000000 --- a/kokoro/linux/dockerfile/test/python37/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -FROM python:3.7-buster - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# Install Python libraries. -RUN python -m pip install --no-cache-dir --upgrade \ - pip \ - setuptools \ - tox \ - wheel diff --git a/kokoro/linux/dockerfile/test/python38/Dockerfile b/kokoro/linux/dockerfile/test/python38/Dockerfile deleted file mode 100644 index 56efc9d6bf..0000000000 --- a/kokoro/linux/dockerfile/test/python38/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -FROM python:3.8-buster - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# Install Python libraries. -RUN python -m pip install --no-cache-dir --upgrade \ - pip \ - setuptools \ - tox \ - wheel diff --git a/kokoro/linux/dockerfile/test/python39/Dockerfile b/kokoro/linux/dockerfile/test/python39/Dockerfile deleted file mode 100644 index ee7554dd64..0000000000 --- a/kokoro/linux/dockerfile/test/python39/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -FROM python:3.9-buster - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# Install Python libraries. -RUN python -m pip install --no-cache-dir --upgrade \ - pip \ - setuptools \ - tox \ - wheel diff --git a/kokoro/linux/dockerfile/test/ruby/Dockerfile b/kokoro/linux/dockerfile/test/ruby/Dockerfile deleted file mode 100644 index 0e34fe55b9..0000000000 --- a/kokoro/linux/dockerfile/test/ruby/Dockerfile +++ /dev/null @@ -1,44 +0,0 @@ -FROM debian:stretch - -# Install dependencies. We start with the basic ones require to build protoc -# and the C++ build -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - gcc \ - git \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - parallel \ - time \ - wget \ - # Java dependencies - maven \ - openjdk-8-jdk \ - && apt-get clean - -# Install rvm -RUN gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys \ - 409B6B1796C275462A1703113804BB82D39DC0E3 \ - 7D2BAF1CF37B13E2069D6956105BD0E739499BDB -RUN \curl -sSL https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer | bash -s master - -RUN /bin/bash -l -c "rvm install 2.5.1" -RUN /bin/bash -l -c "rvm install 2.6.0" -RUN /bin/bash -l -c "rvm install 2.7.0" -RUN /bin/bash -l -c "rvm install 3.0.0" -RUN /bin/bash -l -c "rvm install 3.1.0" -RUN /bin/bash -l -c "rvm install jruby-9.2.20.1" -RUN /bin/bash -l -c "rvm install jruby-9.3.3.0" -RUN /bin/bash -l -c "rvm install jruby-9.3.4.0" - -RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc" -RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" diff --git a/kokoro/linux/java_aarch64/build.sh b/kokoro/linux/java_aarch64/build.sh deleted file mode 100755 index ed5ad5395c..0000000000 --- a/kokoro/linux/java_aarch64/build.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "continuous" and "presubmit" jobs. - -set -ex - -# Change to repo root -cd $(dirname $0)/../../.. - -# Initialize any submodules. -git submodule update --init --recursive - -kokoro/linux/aarch64/qemu_helpers/prepare_qemu.sh - -kokoro/linux/aarch64/test_java_aarch64.sh diff --git a/kokoro/linux/java_aarch64/continuous.cfg b/kokoro/linux/java_aarch64/continuous.cfg index 5db46d48ce..75e3f0bddb 100644 --- a/kokoro/linux/java_aarch64/continuous.cfg +++ b/kokoro/linux/java_aarch64/continuous.cfg @@ -1,11 +1,21 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/java_aarch64/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/emulation/linux:aarch64-4e847d7a01c1792471b6dd985ab0bf2677332e6f" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//java/..." +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/java_aarch64/presubmit.cfg b/kokoro/linux/java_aarch64/presubmit.cfg index 5db46d48ce..bca25d1ea5 100644 --- a/kokoro/linux/java_aarch64/presubmit.cfg +++ b/kokoro/linux/java_aarch64/presubmit.cfg @@ -1,11 +1,20 @@ # Config file for running tests in Kokoro -# Location of the build script in repository -build_file: "protobuf/kokoro/linux/java_aarch64/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/emulation/linux:aarch64-4e847d7a01c1792471b6dd985ab0bf2677332e6f" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//java/..." +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/java_jdk11/build.sh b/kokoro/linux/java_jdk11/build.sh deleted file mode 100755 index d73aa7c7dd..0000000000 --- a/kokoro/linux/java_jdk11/build.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# fail on error -set -e - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -# The image of the Dockerfile sha1 is fetched from the organization -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/java_stretch -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="java_jdk11" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/java_jdk11/continuous.cfg b/kokoro/linux/java_jdk11/continuous.cfg index f8af54d4eb..3db5cd0fd4 100644 --- a/kokoro/linux/java_jdk11/continuous.cfg +++ b/kokoro/linux/java_jdk11/continuous.cfg @@ -1,11 +1,16 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/java_jdk11/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "BAZEL_TARGETS" + value: "//java/..." +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/java_jdk11/presubmit.cfg b/kokoro/linux/java_jdk11/presubmit.cfg index 366048c920..04d8214b67 100644 --- a/kokoro/linux/java_jdk11/presubmit.cfg +++ b/kokoro/linux/java_jdk11/presubmit.cfg @@ -1,12 +1,16 @@ # Config file for running Linkage Monitor in Kokoro -# https://github.com/GoogleCloudPlatform/cloud-opensource-java/tree/master/linkage-monitor # Location of the build script in repository -build_file: "protobuf/kokoro/linux/java_jdk11/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "BAZEL_TARGETS" + value: "//java/..." +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/java_jdk17/build.sh b/kokoro/linux/java_jdk17/build.sh deleted file mode 100755 index 677245ab51..0000000000 --- a/kokoro/linux/java_jdk17/build.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Fail on error -set -e - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -# The image of the Dockerfile sha1 is fetched from the organization -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/java_stretch -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="java_jdk17" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/java_jdk17/continuous.cfg b/kokoro/linux/java_jdk17/continuous.cfg index 6bac25c128..cd31eda405 100644 --- a/kokoro/linux/java_jdk17/continuous.cfg +++ b/kokoro/linux/java_jdk17/continuous.cfg @@ -1,11 +1,21 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/java_jdk17/build.sh" -timeout_mins: 60 +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/java/linux:17-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//java/..." +} action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/java_jdk17/presubmit.cfg b/kokoro/linux/java_jdk17/presubmit.cfg index ee80517904..4574a0fd1c 100644 --- a/kokoro/linux/java_jdk17/presubmit.cfg +++ b/kokoro/linux/java_jdk17/presubmit.cfg @@ -1,12 +1,21 @@ # Config file for running Linkage Monitor in Kokoro -# https://github.com/GoogleCloudPlatform/cloud-opensource-java/tree/master/linkage-monitor # Location of the build script in repository -build_file: "protobuf/kokoro/linux/java_jdk17/build.sh" -timeout_mins: 60 +build_file: "protobuf/kokoro/linux/bazel.sh" +timeout_mins: 120 + +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/java/linux:17-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//java/..." +} action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/java_linkage_monitor/build.sh b/kokoro/linux/java_linkage_monitor/build.sh index c447453f60..fd1c5c7fa9 100755 --- a/kokoro/linux/java_linkage_monitor/build.sh +++ b/kokoro/linux/java_linkage_monitor/build.sh @@ -4,16 +4,24 @@ # running the "pull request" project: # # This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. +# a script to run inside that image. + +use_bazel.sh 5.1.1 # Change to repo root cd $(dirname $0)/../../.. -export DOCKERHUB_ORGANIZATION=protobuftesting -# The image of the Dockerfile sha1 is fetched from the organization -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/java_stretch -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="java_linkage_monitor" -./kokoro/linux/build_and_run_docker.sh +bazel build //:protoc + +# The java build setup expects protoc in the root directory. +cp bazel-bin/protoc . + +cd java +# Installs the snapshot version locally +mvn -e -B -Dhttps.protocols=TLSv1.2 install -Dmaven.test.skip=true + +# Linkage Monitor uses the snapshot versions installed in $HOME/.m2 to verify compatibility +JAR=linkage-monitor-latest-all-deps.jar +curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/${JAR}" +# Fails if there's new linkage errors compared with baseline +java -jar $JAR com.google.cloud:libraries-bom diff --git a/kokoro/linux/jruby92/build.sh b/kokoro/linux/jruby92/build.sh deleted file mode 100755 index 5820115759..0000000000 --- a/kokoro/linux/jruby92/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/ruby -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="jruby92" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/jruby92/continuous.cfg b/kokoro/linux/jruby92/continuous.cfg index 3339584149..9db8f50637 100644 --- a/kokoro/linux/jruby92/continuous.cfg +++ b/kokoro/linux/jruby92/continuous.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/jruby92/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:jruby-9.2.20.1-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=java" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/jruby92/presubmit.cfg b/kokoro/linux/jruby92/presubmit.cfg index 3339584149..9db8f50637 100644 --- a/kokoro/linux/jruby92/presubmit.cfg +++ b/kokoro/linux/jruby92/presubmit.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/jruby92/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:jruby-9.2.20.1-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=java" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/jruby93/build.sh b/kokoro/linux/jruby93/build.sh deleted file mode 100755 index 24c54d0b20..0000000000 --- a/kokoro/linux/jruby93/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/ruby -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="jruby93" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/jruby93/continuous.cfg b/kokoro/linux/jruby93/continuous.cfg index 706d8488f7..a5a9bd2374 100644 --- a/kokoro/linux/jruby93/continuous.cfg +++ b/kokoro/linux/jruby93/continuous.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/jruby93/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:jruby-9.3.4.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=java" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/jruby93/presubmit.cfg b/kokoro/linux/jruby93/presubmit.cfg index 706d8488f7..a5a9bd2374 100644 --- a/kokoro/linux/jruby93/presubmit.cfg +++ b/kokoro/linux/jruby93/presubmit.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/jruby93/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:jruby-9.3.4.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=java" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/make_test_output.py b/kokoro/linux/make_test_output.py deleted file mode 100644 index 985368534c..0000000000 --- a/kokoro/linux/make_test_output.py +++ /dev/null @@ -1,94 +0,0 @@ -"""Gathers output from test runs and create an XML file in JUnit format. - -The output files from the individual tests have been written in a directory -structure like: - - $DIR/joblog (output from "parallel --joblog joblog") - $DIR/logs/1/cpp/stdout - $DIR/logs/1/cpp/stderr - $DIR/logs/1/csharp/stdout - $DIR/logs/1/csharp/stderr - $DIR/logs/1/java_jdk7/stdout - $DIR/logs/1/java_jdk7/stderr - etc. - -This script bundles them into a single output XML file so Jenkins can show -detailed test results. It runs as the last step before the Jenkins build -finishes. -""" - -import os -import sys -from yattag import Doc -from collections import defaultdict - - -def readtests(basedir): - tests = defaultdict(dict) - - # Sample input (note: separators are tabs). - # - # Seq Host Starttime Runtime Send Receive Exitval Signal Command - # 1 : 1456263838.313 0.005 0 0 0 0 echo A - with open(basedir + "/joblog") as jobs: - firstline = next(jobs) - for line in jobs: - values = line.split("\t") - - name = values[8].split()[-1] - test = tests[name] - test["name"] = name - test["time"] = values[3] - - exitval = values[6] - if int(exitval): - # We don't have a more specific message. User should look at stderr. - test["failure"] = "TEST FAILURE" - else: - test["failure"] = False - - for testname in os.listdir(basedir + "/logs/1"): - test = tests[testname] - - with open(basedir + "/logs/1/" + testname + "/stdout") as f: - test["stdout"] = f.read() - - with open(basedir + "/logs/1/" + testname + "/stderr") as f: - test["stderr"] = f.read() - - # The cpp test is special since it doesn't run under parallel so doesn't show - # up in the job log. - tests["cpp"]["name"] = "cpp" - - with open(basedir + '/logs/1/cpp/build_time', 'r') as f: - tests["cpp"]["time"] = f.read().strip() - tests["cpp"]["failure"] = False - - ret = tests.values() - ret.sort(key=lambda x: x["name"]) - - return ret - - -def genxml(tests): - doc, tag, text = Doc().tagtext() - - with tag("testsuites"): - with tag("testsuite", name="Protobuf Tests"): - for test in tests: - with tag("testcase", name=test["name"], classname=test["name"], - time=test["time"]): - with tag("system-out"): - text(test["stdout"]) - with tag("system-err"): - text(test["stderr"]) - if test["failure"]: - with tag("failure"): - text(test["failure"]) - - return doc.getvalue() - - -sys.stderr.write("make_test_output.py: writing XML from directory: " + - sys.argv[1] + "\n") -print(genxml(readtests(sys.argv[1]))) diff --git a/kokoro/linux/pull_request_in_docker.sh b/kokoro/linux/pull_request_in_docker.sh deleted file mode 100755 index a048c47031..0000000000 --- a/kokoro/linux/pull_request_in_docker.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# -# This is the script that runs inside Docker, once the image has been built, -# to execute all tests for the "pull request" project. - -WORKSPACE_BASE=`pwd` -MY_DIR="$(dirname "$0")" -TEST_SCRIPT=./tests.sh -BUILD_DIR=/tmp/protobuf - -set -e # exit immediately on error -set -x # display all commands - -# The protobuf repository is mounted into our Docker image, but read-only. -# We clone into a directory inside Docker (this is faster than cp). -rm -rf $BUILD_DIR -mkdir -p $BUILD_DIR -cd $BUILD_DIR -git clone /var/local/kokoro/protobuf -cd protobuf - -# Initialize any submodules: -git submodule update --init --recursive - -$TEST_SCRIPT $TEST_SET diff --git a/kokoro/linux/python310/build.sh b/kokoro/linux/python310/build.sh deleted file mode 100755 index 0d8a2c9c6d..0000000000 --- a/kokoro/linux/python310/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python310 -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python310" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python310/continuous.cfg b/kokoro/linux/python310/continuous.cfg index 6ec74d8597..7e4a798ddd 100644 --- a/kokoro/linux/python310/continuous.cfg +++ b/kokoro/linux/python310/continuous.cfg @@ -1,11 +1,21 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/python310/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.10-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/... @upb//python/..." +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/python310/presubmit.cfg b/kokoro/linux/python310/presubmit.cfg index 6ec74d8597..7e4a798ddd 100644 --- a/kokoro/linux/python310/presubmit.cfg +++ b/kokoro/linux/python310/presubmit.cfg @@ -1,11 +1,21 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/python310/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.10-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/... @upb//python/..." +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/python310_cpp/build.sh b/kokoro/linux/python310_cpp/build.sh deleted file mode 100755 index 2903a2d9c2..0000000000 --- a/kokoro/linux/python310_cpp/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python310 -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python310_cpp" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python310_cpp/continuous.cfg b/kokoro/linux/python310_cpp/continuous.cfg index 7ec844196e..1f91c26713 100644 --- a/kokoro/linux/python310_cpp/continuous.cfg +++ b/kokoro/linux/python310_cpp/continuous.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/python310_cpp/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.10-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/... @upb//python/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=use_fast_cpp_protos=true" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/python310_cpp/presubmit.cfg b/kokoro/linux/python310_cpp/presubmit.cfg index 7ec844196e..1c4cfeebc8 100644 --- a/kokoro/linux/python310_cpp/presubmit.cfg +++ b/kokoro/linux/python310_cpp/presubmit.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/python310_cpp/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.10-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=use_fast_cpp_protos=true" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/python37/build.sh b/kokoro/linux/python37/build.sh deleted file mode 100755 index 2117a271ce..0000000000 --- a/kokoro/linux/python37/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python37 -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python37" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python37/continuous.cfg b/kokoro/linux/python37/continuous.cfg index 9fa20c1975..3ae100cb00 100644 --- a/kokoro/linux/python37/continuous.cfg +++ b/kokoro/linux/python37/continuous.cfg @@ -1,11 +1,21 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/python37/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.7-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/... @upb//python/..." +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/python37/presubmit.cfg b/kokoro/linux/python37/presubmit.cfg index 9fa20c1975..3ae100cb00 100644 --- a/kokoro/linux/python37/presubmit.cfg +++ b/kokoro/linux/python37/presubmit.cfg @@ -1,11 +1,21 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/python37/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.7-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/... @upb//python/..." +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/python37_cpp/build.sh b/kokoro/linux/python37_cpp/build.sh deleted file mode 100755 index 3126b481e3..0000000000 --- a/kokoro/linux/python37_cpp/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python37 -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python37_cpp" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python37_cpp/continuous.cfg b/kokoro/linux/python37_cpp/continuous.cfg index 49c441ffe8..44f6606a9f 100644 --- a/kokoro/linux/python37_cpp/continuous.cfg +++ b/kokoro/linux/python37_cpp/continuous.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/python37_cpp/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.7-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/... @upb//python/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=use_fast_cpp_protos=true" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/python37_cpp/presubmit.cfg b/kokoro/linux/python37_cpp/presubmit.cfg index 49c441ffe8..54b2de47e1 100644 --- a/kokoro/linux/python37_cpp/presubmit.cfg +++ b/kokoro/linux/python37_cpp/presubmit.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/python37_cpp/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.7-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=use_fast_cpp_protos=true" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/python38/build.sh b/kokoro/linux/python38/build.sh deleted file mode 100755 index 299c7ba6f3..0000000000 --- a/kokoro/linux/python38/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python38 -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python38" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python38/continuous.cfg b/kokoro/linux/python38/continuous.cfg index 76425d2f19..7d9e7aaadb 100644 --- a/kokoro/linux/python38/continuous.cfg +++ b/kokoro/linux/python38/continuous.cfg @@ -1,11 +1,21 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/python38/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.8-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/... @upb//python/..." +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/python38/presubmit.cfg b/kokoro/linux/python38/presubmit.cfg index 76425d2f19..7d9e7aaadb 100644 --- a/kokoro/linux/python38/presubmit.cfg +++ b/kokoro/linux/python38/presubmit.cfg @@ -1,11 +1,21 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/python38/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.8-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/... @upb//python/..." +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/python38_cpp/build.sh b/kokoro/linux/python38_cpp/build.sh deleted file mode 100755 index b43859b988..0000000000 --- a/kokoro/linux/python38_cpp/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python38 -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python38_cpp" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python38_cpp/continuous.cfg b/kokoro/linux/python38_cpp/continuous.cfg index 1e8888cc5d..dc24fd2a3d 100644 --- a/kokoro/linux/python38_cpp/continuous.cfg +++ b/kokoro/linux/python38_cpp/continuous.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/python38_cpp/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.8-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/... @upb//python/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=use_fast_cpp_protos=true" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/python38_cpp/presubmit.cfg b/kokoro/linux/python38_cpp/presubmit.cfg index 1e8888cc5d..f9d025a3af 100644 --- a/kokoro/linux/python38_cpp/presubmit.cfg +++ b/kokoro/linux/python38_cpp/presubmit.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/python38_cpp/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.8-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=use_fast_cpp_protos=true" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/python39/build.sh b/kokoro/linux/python39/build.sh deleted file mode 100755 index 497dc66e7c..0000000000 --- a/kokoro/linux/python39/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python39 -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python39" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python39/continuous.cfg b/kokoro/linux/python39/continuous.cfg index b03bc908df..5133ab5629 100644 --- a/kokoro/linux/python39/continuous.cfg +++ b/kokoro/linux/python39/continuous.cfg @@ -1,11 +1,21 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/python39/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.9-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/... @upb//python/..." +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/python39/presubmit.cfg b/kokoro/linux/python39/presubmit.cfg index b03bc908df..5133ab5629 100644 --- a/kokoro/linux/python39/presubmit.cfg +++ b/kokoro/linux/python39/presubmit.cfg @@ -1,11 +1,21 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/python39/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.9-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/... @upb//python/..." +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/python39_cpp/build.sh b/kokoro/linux/python39_cpp/build.sh deleted file mode 100755 index f45d2ec7c3..0000000000 --- a/kokoro/linux/python39_cpp/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python39 -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="python39_cpp" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python39_cpp/continuous.cfg b/kokoro/linux/python39_cpp/continuous.cfg index dd84fbe86b..f11d73ed89 100644 --- a/kokoro/linux/python39_cpp/continuous.cfg +++ b/kokoro/linux/python39_cpp/continuous.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/python39_cpp/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.9-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/... @upb//python/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=use_fast_cpp_protos=true" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/python39_cpp/presubmit.cfg b/kokoro/linux/python39_cpp/presubmit.cfg index dd84fbe86b..d7deef5b69 100644 --- a/kokoro/linux/python39_cpp/presubmit.cfg +++ b/kokoro/linux/python39_cpp/presubmit.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/python39_cpp/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/python/linux:3.9-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//python/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=use_fast_cpp_protos=true" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/ruby25/build.sh b/kokoro/linux/ruby25/build.sh deleted file mode 100755 index 1e82ec5f4c..0000000000 --- a/kokoro/linux/ruby25/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/ruby -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="ruby25" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/ruby25/continuous.cfg b/kokoro/linux/ruby25/continuous.cfg index dee2db033f..ec975cd7d2 100644 --- a/kokoro/linux/ruby25/continuous.cfg +++ b/kokoro/linux/ruby25/continuous.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby25/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:ruby-2.5.1-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=c" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/ruby25/presubmit.cfg b/kokoro/linux/ruby25/presubmit.cfg index dee2db033f..ec975cd7d2 100644 --- a/kokoro/linux/ruby25/presubmit.cfg +++ b/kokoro/linux/ruby25/presubmit.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby25/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:ruby-2.5.1-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=c" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/ruby26/build.sh b/kokoro/linux/ruby26/build.sh deleted file mode 100755 index 72d2d45669..0000000000 --- a/kokoro/linux/ruby26/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/ruby -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="ruby26" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/ruby26/continuous.cfg b/kokoro/linux/ruby26/continuous.cfg index 4779065670..d09a405d8c 100644 --- a/kokoro/linux/ruby26/continuous.cfg +++ b/kokoro/linux/ruby26/continuous.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby26/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:ruby-2.6.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=c" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/ruby26/presubmit.cfg b/kokoro/linux/ruby26/presubmit.cfg index 4779065670..d09a405d8c 100644 --- a/kokoro/linux/ruby26/presubmit.cfg +++ b/kokoro/linux/ruby26/presubmit.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby26/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:ruby-2.6.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=c" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/ruby27/build.sh b/kokoro/linux/ruby27/build.sh deleted file mode 100755 index c38ee36e58..0000000000 --- a/kokoro/linux/ruby27/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/ruby -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="ruby27" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/ruby27/continuous.cfg b/kokoro/linux/ruby27/continuous.cfg index 9cce8c90e1..51afa75d27 100644 --- a/kokoro/linux/ruby27/continuous.cfg +++ b/kokoro/linux/ruby27/continuous.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby27/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:ruby-2.7.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=c" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/ruby27/presubmit.cfg b/kokoro/linux/ruby27/presubmit.cfg index 9cce8c90e1..51afa75d27 100644 --- a/kokoro/linux/ruby27/presubmit.cfg +++ b/kokoro/linux/ruby27/presubmit.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby27/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:ruby-2.7.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=c" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/ruby30/build.sh b/kokoro/linux/ruby30/build.sh deleted file mode 100755 index 9e44575652..0000000000 --- a/kokoro/linux/ruby30/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/ruby -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="ruby30" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/ruby30/continuous.cfg b/kokoro/linux/ruby30/continuous.cfg index b03a3352f4..338505e57e 100644 --- a/kokoro/linux/ruby30/continuous.cfg +++ b/kokoro/linux/ruby30/continuous.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby30/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:ruby-3.0.2-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=c" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/ruby30/presubmit.cfg b/kokoro/linux/ruby30/presubmit.cfg index b03a3352f4..338505e57e 100644 --- a/kokoro/linux/ruby30/presubmit.cfg +++ b/kokoro/linux/ruby30/presubmit.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby30/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:ruby-3.0.2-2f706fd1ab49f4e97af769388be486069b63efee" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=c" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/ruby31/build.sh b/kokoro/linux/ruby31/build.sh deleted file mode 100644 index c22bdae2ef..0000000000 --- a/kokoro/linux/ruby31/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "pull request" project: -# -# This script selects a specific Dockerfile (for building a Docker image) and -# a script to run inside that image. Then we delegate to the general -# build_and_run_docker.sh script. - -# Change to repo root -cd $(dirname $0)/../../.. - -export DOCKERHUB_ORGANIZATION=protobuftesting -export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/ruby -export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh -export OUTPUT_DIR=testoutput -export TEST_SET="ruby31" -./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/ruby31/continuous.cfg b/kokoro/linux/ruby31/continuous.cfg index 0477912b8c..588fe13637 100644 --- a/kokoro/linux/ruby31/continuous.cfg +++ b/kokoro/linux/ruby31/continuous.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby31/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:ruby-3.1.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=c" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/ruby31/presubmit.cfg b/kokoro/linux/ruby31/presubmit.cfg index 0477912b8c..588fe13637 100644 --- a/kokoro/linux/ruby31/presubmit.cfg +++ b/kokoro/linux/ruby31/presubmit.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby31/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/ruby/linux:ruby-3.1.0-64e8944e4f18d7d6c9649112a8a93be57e693cd8" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=c" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/ruby_aarch64/build.sh b/kokoro/linux/ruby_aarch64/build.sh deleted file mode 100755 index 6473e0d222..0000000000 --- a/kokoro/linux/ruby_aarch64/build.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# -# This is the top-level script we give to Kokoro as the entry point for -# running the "continuous" and "presubmit" jobs. - -set -ex - -# Change to repo root -cd $(dirname $0)/../../.. - -# Initialize any submodules. -git submodule update --init --recursive - -kokoro/linux/aarch64/qemu_helpers/prepare_qemu.sh - -kokoro/linux/aarch64/test_ruby_aarch64.sh diff --git a/kokoro/linux/ruby_aarch64/continuous.cfg b/kokoro/linux/ruby_aarch64/continuous.cfg index ae82696404..044e8267af 100644 --- a/kokoro/linux/ruby_aarch64/continuous.cfg +++ b/kokoro/linux/ruby_aarch64/continuous.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby_aarch64/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/emulation/linux:aarch64-4e847d7a01c1792471b6dd985ab0bf2677332e6f" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=c" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/linux/ruby_aarch64/presubmit.cfg b/kokoro/linux/ruby_aarch64/presubmit.cfg index ae82696404..044e8267af 100644 --- a/kokoro/linux/ruby_aarch64/presubmit.cfg +++ b/kokoro/linux/ruby_aarch64/presubmit.cfg @@ -1,11 +1,26 @@ # Config file for running tests in Kokoro # Location of the build script in repository -build_file: "protobuf/kokoro/linux/ruby_aarch64/build.sh" +build_file: "protobuf/kokoro/linux/bazel.sh" timeout_mins: 120 +env_vars { + key: "CONTAINER_IMAGE" + value: "gcr.io/protobuf-build/emulation/linux:aarch64-4e847d7a01c1792471b6dd985ab0bf2677332e6f" +} + +env_vars { + key: "BAZEL_TARGETS" + value: "//ruby/..." +} + +env_vars { + key: "BAZEL_EXTRA_FLAGS" + value: "--define=ruby_platform=c" +} + action { define_artifacts { - regex: "**/sponge_log.xml" + regex: "**/sponge_log.*" } } diff --git a/kokoro/macos/cpp/build.sh b/kokoro/macos/cpp/build.sh index fae3b3012a..7c21d4856d 100755 --- a/kokoro/macos/cpp/build.sh +++ b/kokoro/macos/cpp/build.sh @@ -5,26 +5,13 @@ set -eux set -o pipefail -if [[ -h /tmpfs ]] && [[ ${PWD} == /tmpfs/src ]]; then - # Workaround for internal Kokoro bug: b/227401944 - cd /Volumes/BuildData/tmpfs/src -fi - -# Default environment variables used by cmake build: -: ${CMAKE_CONFIG_TYPE:=Debug} -export CMAKE_CONFIG_TYPE -: ${CTEST_PARALLEL_LEVEL:=4} -export CTEST_PARALLEL_LEVEL - # Run from the project root directory. cd $(dirname $0)/../../.. -# -# Update submodules -# -git submodule update --init --recursive +# Prepare worker environment to run tests +source kokoro/macos/prepare_build_macos_rc # # Run build # -kokoro/common/cmake.sh +bazel test //src/... -k --test_output=streamed diff --git a/kokoro/macos/objectivec_ios_debug/build.sh b/kokoro/macos/objectivec_ios_debug/build.sh index 1055d72ecb..77b704f196 100755 --- a/kokoro/macos/objectivec_ios_debug/build.sh +++ b/kokoro/macos/objectivec_ios_debug/build.sh @@ -8,4 +8,5 @@ cd $(dirname $0)/../../.. # Prepare worker environment to run tests source kokoro/macos/prepare_build_macos_rc -./tests.sh objectivec_ios_debug +objectivec/DevTools/full_mac_build.sh \ + --core-only --skip-xcode-osx --skip-xcode-tvos --skip-objc-conformance --skip-xcode-release diff --git a/kokoro/macos/objectivec_ios_release/build.sh b/kokoro/macos/objectivec_ios_release/build.sh index 76ce3ba0b5..adbc4f2f55 100755 --- a/kokoro/macos/objectivec_ios_release/build.sh +++ b/kokoro/macos/objectivec_ios_release/build.sh @@ -8,4 +8,5 @@ cd $(dirname $0)/../../.. # Prepare worker environment to run tests source kokoro/macos/prepare_build_macos_rc -./tests.sh objectivec_ios_release +objectivec/DevTools/full_mac_build.sh \ + --core-only --skip-xcode-osx --skip-xcode-tvos --skip-objc-conformance --skip-xcode-debug diff --git a/kokoro/macos/objectivec_osx/build.sh b/kokoro/macos/objectivec_osx/build.sh index 000be27460..7f5d561c23 100755 --- a/kokoro/macos/objectivec_osx/build.sh +++ b/kokoro/macos/objectivec_osx/build.sh @@ -8,4 +8,5 @@ cd $(dirname $0)/../../.. # Prepare worker environment to run tests source kokoro/macos/prepare_build_macos_rc -./tests.sh objectivec_osx +objectivec/DevTools/full_mac_build.sh \ + --core-only --skip-xcode-ios --skip-xcode-tvos diff --git a/kokoro/macos/php74/build.sh b/kokoro/macos/php74/build.sh index ff3965756c..2b50a0a6ee 100755 --- a/kokoro/macos/php74/build.sh +++ b/kokoro/macos/php74/build.sh @@ -17,4 +17,4 @@ test ! -z "$PHP_FOLDER" export PATH="$PHP_FOLDER/bin:$PATH" # Test -./tests.sh php_mac +kokoro/macos/test_php.sh diff --git a/kokoro/macos/php80/build.sh b/kokoro/macos/php80/build.sh index 84e2c464ef..4051822e97 100755 --- a/kokoro/macos/php80/build.sh +++ b/kokoro/macos/php80/build.sh @@ -17,4 +17,4 @@ test ! -z "$PHP_FOLDER" export PATH="$PHP_FOLDER/bin:$PATH" # Test -./tests.sh php_mac +kokoro/macos/test_php.sh diff --git a/kokoro/macos/prepare_build_macos_rc b/kokoro/macos/prepare_build_macos_rc index 7ec2832b85..fe3b6be0de 100755 --- a/kokoro/macos/prepare_build_macos_rc +++ b/kokoro/macos/prepare_build_macos_rc @@ -15,13 +15,6 @@ sudo xcode-select -s "${DEVELOPER_DIR}" # Use Python 2 by default (for googletest) pyenv global 2.7.18 -## -# Install Tox - -if [[ "${KOKORO_INSTALL_TOX:-}" == "yes" ]] ; then - sudo python3 -m pip install --upgrade pip tox -fi - ## # Setup RVM if [[ "${KOKORO_INSTALL_RVM:-}" == "yes" ]] ; then @@ -38,3 +31,11 @@ if [ ! -x "$(command -v valgrind)" ]; then chmod ug+x valgrind sudo mv valgrind /usr/local/bin/valgrind fi + +## +# Install Virtual Python Environment + +if [[ "${KOKORO_INSTALL_VENV:-}" == "yes" ]] ; then + python3 -m venv venv + source venv/bin/activate +fi diff --git a/kokoro/macos/python/build.sh b/kokoro/macos/python/build.sh index 388e24b4ac..f1ea3aaf12 100755 --- a/kokoro/macos/python/build.sh +++ b/kokoro/macos/python/build.sh @@ -6,7 +6,7 @@ cd $(dirname $0)/../../.. # Prepare worker environment to run tests -KOKORO_INSTALL_TOX=yes +KOKORO_INSTALL_VENV=yes source kokoro/macos/prepare_build_macos_rc -./tests.sh python +bazel test //python/... @upb//python/... -k --macos_minimum_os=10.9 --test_output=streamed diff --git a/kokoro/macos/python/presubmit.cfg b/kokoro/macos/python/presubmit.cfg index 0fc8b503e8..ac3cbeebf5 100644 --- a/kokoro/macos/python/presubmit.cfg +++ b/kokoro/macos/python/presubmit.cfg @@ -3,3 +3,9 @@ # Location of the build script in repository build_file: "protobuf/kokoro/macos/python/build.sh" timeout_mins: 1440 + +action { + define_artifacts { + regex: "**/*" + } +} diff --git a/kokoro/macos/python_cpp/build.sh b/kokoro/macos/python_cpp/build.sh index f86dd6f76e..ae480a5a06 100755 --- a/kokoro/macos/python_cpp/build.sh +++ b/kokoro/macos/python_cpp/build.sh @@ -6,8 +6,7 @@ cd $(dirname $0)/../../.. # Prepare worker environment to run tests -KOKORO_INSTALL_TOX=yes +KOKORO_INSTALL_VENV=yes source kokoro/macos/prepare_build_macos_rc -g++ --version -./tests.sh python_cpp +bazel test //python/... -k --macos_minimum_os=10.9 --test_output=streamed --define=use_fast_cpp_protos=true diff --git a/kokoro/macos/ruby25/build.sh b/kokoro/macos/ruby25/build.sh index 48c894081b..81ce2c36a1 100755 --- a/kokoro/macos/ruby25/build.sh +++ b/kokoro/macos/ruby25/build.sh @@ -9,4 +9,5 @@ cd $(dirname $0)/../../.. KOKORO_INSTALL_RVM=yes source kokoro/macos/prepare_build_macos_rc -./tests.sh ruby25 +cd ruby +./travis-test.sh ruby-2.5.1 diff --git a/kokoro/macos/ruby26/build.sh b/kokoro/macos/ruby26/build.sh index 1b94fe1b55..ee815b6fc1 100755 --- a/kokoro/macos/ruby26/build.sh +++ b/kokoro/macos/ruby26/build.sh @@ -9,4 +9,5 @@ cd $(dirname $0)/../../.. KOKORO_INSTALL_RVM=yes source kokoro/macos/prepare_build_macos_rc -./tests.sh ruby26 +cd ruby +./travis-test.sh ruby-2.6.0 diff --git a/kokoro/macos/ruby27/build.sh b/kokoro/macos/ruby27/build.sh index baebdb792a..ca6badb062 100755 --- a/kokoro/macos/ruby27/build.sh +++ b/kokoro/macos/ruby27/build.sh @@ -9,4 +9,5 @@ cd $(dirname $0)/../../.. KOKORO_INSTALL_RVM=yes source kokoro/macos/prepare_build_macos_rc -./tests.sh ruby27 +cd ruby +./travis-test.sh ruby-2.7.0 diff --git a/kokoro/macos/ruby30/build.sh b/kokoro/macos/ruby30/build.sh index b1e0641c96..01bdc47d51 100755 --- a/kokoro/macos/ruby30/build.sh +++ b/kokoro/macos/ruby30/build.sh @@ -9,4 +9,5 @@ cd $(dirname $0)/../../.. KOKORO_INSTALL_RVM=yes source kokoro/macos/prepare_build_macos_rc -./tests.sh ruby30 +cd ruby +./travis-test.sh ruby-3.0.2 diff --git a/kokoro/macos/ruby31/build.sh b/kokoro/macos/ruby31/build.sh index 1b5a5a5a60..57914bd060 100644 --- a/kokoro/macos/ruby31/build.sh +++ b/kokoro/macos/ruby31/build.sh @@ -9,4 +9,5 @@ cd $(dirname $0)/../../.. KOKORO_INSTALL_RVM=yes source kokoro/macos/prepare_build_macos_rc -./tests.sh ruby31 +cd ruby +./travis-test.sh ruby-3.1.0 diff --git a/kokoro/macos/test_php.sh b/kokoro/macos/test_php.sh new file mode 100755 index 0000000000..933b251101 --- /dev/null +++ b/kokoro/macos/test_php.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -eux + +pushd php +rm -rf vendor +php -v +php -m +composer update +composer test_c +popd + +git clean -fXd +bazel test //php:conformance_test_c --action_env=PATH --test_env=PATH --test_output=streamed diff --git a/kokoro/release/protoc/linux/build.sh b/kokoro/release/protoc/linux/build.sh index 44a95aab35..ca3ff2124a 100755 --- a/kokoro/release/protoc/linux/build.sh +++ b/kokoro/release/protoc/linux/build.sh @@ -1,44 +1,29 @@ #!/bin/bash -set -x +# This is not the source of truth for release protoc executables, and will soon +# be deprecated. + +set -ex # Change to repo root. cd $(dirname $0)/../../../.. +GIT_REPO_ROOT=$(pwd) # Initialize any submodules. git submodule update --init --recursive -# Generate the configure script. -./autogen.sh - # Cross-build for aarch64, ppc64le and s390x. Note: we do these builds first to avoid # file permission issues. The Docker builds will create directories owned by # root, which causes problems if we try to add new artifacts to those # directories afterward. -sudo apt install -y g++-aarch64-linux-gnu + protoc-artifacts/build-protoc.sh linux aarch_64 protoc -sudo apt install -y g++-powerpc64le-linux-gnu protoc-artifacts/build-protoc.sh linux ppcle_64 protoc -sudo apt install -y g++-s390x-linux-gnu protoc-artifacts/build-protoc.sh linux s390_64 protoc -# Use docker image to build linux artifacts. -DOCKER_IMAGE_NAME=protobuf/protoc_$(sha1sum protoc-artifacts/Dockerfile | cut -f1 -d " ") -docker pull $DOCKER_IMAGE_NAME +protoc-artifacts/build-protoc.sh linux x86_64 protoc -docker run -v $(pwd):/var/local/protobuf --rm $DOCKER_IMAGE_NAME \ - bash -l /var/local/protobuf/protoc-artifacts/build-protoc.sh \ - linux x86_64 protoc || { - echo "Failed to build protoc for linux + x86_64." - exit 1 -} - -docker run -v $(pwd):/var/local/protobuf --rm $DOCKER_IMAGE_NAME \ - bash -l /var/local/protobuf/protoc-artifacts/build-protoc.sh \ - linux x86_32 protoc || { - echo "Failed to build protoc for linux + x86_32." - exit 1 -} +protoc-artifacts/build-protoc.sh linux x86_32 protoc diff --git a/kokoro/release/protoc/macos/build.sh b/kokoro/release/protoc/macos/build.sh index 47c9bfa968..8daddf67a7 100755 --- a/kokoro/release/protoc/macos/build.sh +++ b/kokoro/release/protoc/macos/build.sh @@ -4,12 +4,7 @@ set -ex CXXFLAGS_COMMON="-std=c++14 -DNDEBUG -mmacosx-version-min=10.9" cd github/protobuf -./autogen.sh -mkdir build64 && cd build64 -export CXXFLAGS="$CXXFLAGS_COMMON -m64" -../configure --disable-shared -make -j4 -file src/protoc -otool -L src/protoc | grep dylib -cd .. +bazel build //:protoc --dynamic_mode=off +file bazel-bin/protoc +otool -L bazel-bin/protoc | grep dylib diff --git a/kokoro/release/ruby/linux/ruby/ruby_build.sh b/kokoro/release/ruby/linux/ruby/ruby_build.sh index 761b54fcaf..12d270eabd 100755 --- a/kokoro/release/ruby/linux/ruby/ruby_build.sh +++ b/kokoro/release/ruby/linux/ruby/ruby_build.sh @@ -5,8 +5,10 @@ set -ex # Build protoc use_bazel.sh 5.1.1 bazel build //:protoc -cp bazel-bin/protoc src/protoc -export PROTOC=$PWD/src/protoc + +# The java build setup expects protoc in the root directory. +cp bazel-bin/protoc . +export PROTOC=$PWD/protoc umask 0022 pushd ruby diff --git a/kokoro/windows/bazel/build.bat b/kokoro/windows/bazel/build.bat index 73eb0fdea0..b7b77a6a01 100644 --- a/kokoro/windows/bazel/build.bat +++ b/kokoro/windows/bazel/build.bat @@ -21,7 +21,10 @@ set BAZEL_FLAGS=--enable_runfiles --keep_going --test_output=streamed --verbose_ bazel %BAZEL_STARTUP% build //:protoc //:protobuf //:protobuf_lite %BAZEL_FLAGS% || goto :error @rem Run C++ tests. -bazel %BAZEL_STARTUP% test //src/... %BAZEL_FLAGS% || goto :error +@rem TODO(b/241484899) Enable conformance tests on windows. +bazel %BAZEL_STARTUP% test %BAZEL_FLAGS% ^ + --test_tag_filters=-conformance --build_tag_filters=-conformance ^ + //src/... || goto :error goto :EOF diff --git a/m4/ac_system_extensions.m4 b/m4/ac_system_extensions.m4 deleted file mode 100644 index 1ca2eeb1d8..0000000000 --- a/m4/ac_system_extensions.m4 +++ /dev/null @@ -1,37 +0,0 @@ -dnl Provide AC_USE_SYSTEM_EXTENSIONS for old autoconf machines. -AC_DEFUN([ACX_USE_SYSTEM_EXTENSIONS],[ - ifdef([AC_USE_SYSTEM_EXTENSIONS],[ - AC_USE_SYSTEM_EXTENSIONS - ],[ - AC_BEFORE([$0], [AC_COMPILE_IFELSE]) - AC_BEFORE([$0], [AC_RUN_IFELSE]) - - AC_REQUIRE([AC_GNU_SOURCE]) - AC_REQUIRE([AC_AIX]) - AC_REQUIRE([AC_MINIX]) - - AH_VERBATIM([__EXTENSIONS__], -[/* Enable extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif -#ifndef _POSIX_PTHREAD_SEMANTICS -# undef _POSIX_PTHREAD_SEMANTICS -#endif -#ifndef _TANDEM_SOURCE -# undef _TANDEM_SOURCE -#endif]) - AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], - [ac_cv_safe_to_define___extensions__], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([ -# define __EXTENSIONS__ 1 - AC_INCLUDES_DEFAULT])], - [ac_cv_safe_to_define___extensions__=yes], - [ac_cv_safe_to_define___extensions__=no])]) - test $ac_cv_safe_to_define___extensions__ = yes && - AC_DEFINE([__EXTENSIONS__]) - AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) - AC_DEFINE([_TANDEM_SOURCE]) - ]) -]) diff --git a/m4/acx_check_suncc.m4 b/m4/acx_check_suncc.m4 deleted file mode 100644 index 0a9a5770b3..0000000000 --- a/m4/acx_check_suncc.m4 +++ /dev/null @@ -1,73 +0,0 @@ -dnl Check for the presence of the Sun Studio compiler. -dnl If Sun Studio compiler is found, set appropriate flags. -dnl Additionally, Sun Studio doesn't default to 64-bit by itself, -dnl nor does it automatically look in standard Solaris places for -dnl 64-bit libs, so we must add those options and paths to the search -dnl paths. - -dnl TODO(kenton): This is pretty hacky. It sets CXXFLAGS, which the autoconf -dnl docs say should never be overridden except by the user. It also isn't -dnl cross-compile safe. We should fix these problems, but since I don't have -dnl Sun CC at my disposal for testing, someone else will have to do it. - -AC_DEFUN([ACX_CHECK_SUNCC],[ - - AC_LANG_PUSH([C++]) - AC_CHECK_DECL([__SUNPRO_CC], [SUNCC="yes"], [SUNCC="no"]) - AC_LANG_POP() - - - AC_ARG_ENABLE([64bit-solaris], - [AS_HELP_STRING([--disable-64bit-solaris], - [Build 64 bit binary on Solaris @<:@default=on@:>@])], - [ac_enable_64bit="$enableval"], - [ac_enable_64bit="yes"]) - - AS_IF([test "$SUNCC" = "yes" -a "x${ac_cv_env_CXXFLAGS_set}" = "x"],[ - dnl Sun Studio has a crashing bug with -xO4 in some cases. Keep this - dnl at -xO3 until a proper test to detect those crashes can be done. - CXXFLAGS="-g0 -xO3 -xlibmil -xdepend -xbuiltin -mt -template=no%extdef ${CXXFLAGS}" - ]) - - case $host_os in - *solaris*) - AC_CHECK_PROGS(ISAINFO, [isainfo], [no]) - AS_IF([test "x$ISAINFO" != "xno"], - [isainfo_b=`${ISAINFO} -b`], - [isainfo_b="x"]) - - AS_IF([test "$isainfo_b" != "x"],[ - - isainfo_k=`${ISAINFO} -k` - - AS_IF([test "x$ac_enable_64bit" = "xyes"],[ - - AS_IF([test "x$libdir" = "x\${exec_prefix}/lib"],[ - dnl The user hasn't overridden the default libdir, so we'll - dnl the dir suffix to match solaris 32/64-bit policy - libdir="${libdir}/${isainfo_k}" - ]) - - dnl This should just be set in CPPFLAGS and in LDFLAGS, but libtool - dnl does the wrong thing if you don't put it into CXXFLAGS. sigh. - dnl (It also needs it in CFLAGS, or it does a different wrong thing!) - CXXFLAGS="${CXXFLAGS} -m64" - ac_cv_env_CXXFLAGS_set=set - ac_cv_env_CXXFLAGS_value='-m64' - - CFLAGS="${CFLAGS} -m64" - ac_cv_env_CFLAGS_set=set - ac_cv_env_CFLAGS_value='-m64' - - AS_IF([test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes" ],[ - CXXFLAGS="-xmemalign=8s ${CXXFLAGS}" - ]) - ]) - ]) - ;; - esac - - AS_IF([test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes" ],[ - CXXFLAGS="-xregs=no%appl ${CXXFLAGS}" - ]) -]) diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/m4/ax_cxx_compile_stdcxx.m4 deleted file mode 100644 index d3288e2fb2..0000000000 --- a/m4/ax_cxx_compile_stdcxx.m4 +++ /dev/null @@ -1,1001 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) -# -# DESCRIPTION -# -# Check for baseline language coverage in the compiler for the specified -# version of the C++ standard. If necessary, add switches to CXX and -# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard) -# or '14' (for the C++14 standard). -# -# The second argument, if specified, indicates whether you insist on an -# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. -# -std=c++11). If neither is specified, you get whatever works, with -# preference for an extended mode. -# -# The third argument, if specified 'mandatory' or if left unspecified, -# indicates that baseline support for the specified C++ standard is -# required and that the macro should error out if no mode with that -# support is found. If specified 'optional', then configuration proceeds -# regardless, after defining HAVE_CXX${VERSION} if and only if a -# supporting mode is found. -# -# LICENSE -# -# Copyright (c) 2008 Benjamin Kosnik -# Copyright (c) 2012 Zack Weinberg -# Copyright (c) 2013 Roy Stogner -# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov -# Copyright (c) 2015 Paul Norman -# Copyright (c) 2015 Moritz Klammler -# Copyright (c) 2016 Krzesimir Nowak -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 6 - -dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro -dnl (serial version number 13). - -AX_REQUIRE_DEFINED([AC_MSG_WARN]) -AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl - m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], - [$1], [14], [ax_cxx_compile_alternatives="14 1y"], - [$1], [17], [ax_cxx_compile_alternatives="17 1z"], - [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl - m4_if([$2], [], [], - [$2], [ext], [], - [$2], [noext], [], - [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl - m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], - [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], - [$3], [optional], [ax_cxx_compile_cxx$1_required=false], - [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) - AC_LANG_PUSH([C++])dnl - ac_success=no - AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, - ax_cv_cxx_compile_cxx$1, - [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [ax_cv_cxx_compile_cxx$1=yes], - [ax_cv_cxx_compile_cxx$1=no])]) - if test x$ax_cv_cxx_compile_cxx$1 = xyes; then - ac_success=yes - fi - - m4_if([$2], [noext], [], [dnl - if test x$ac_success = xno; then - for alternative in ${ax_cxx_compile_alternatives}; do - switch="-std=gnu++${alternative}" - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) - AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, - $cachevar, - [ac_save_CXX="$CXX" - CXX="$CXX $switch" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [eval $cachevar=yes], - [eval $cachevar=no]) - CXX="$ac_save_CXX"]) - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - fi]) - - m4_if([$2], [ext], [], [dnl - if test x$ac_success = xno; then - dnl HP's aCC needs +std=c++11 according to: - dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf - dnl Cray's crayCC needs "-h std=c++11" - for alternative in ${ax_cxx_compile_alternatives}; do - for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) - AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, - $cachevar, - [ac_save_CXX="$CXX" - CXX="$CXX $switch" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [eval $cachevar=yes], - [eval $cachevar=no]) - CXX="$ac_save_CXX"]) - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - if test x$ac_success = xyes; then - break - fi - done - fi]) - AC_LANG_POP([C++]) - if test x$ax_cxx_compile_cxx$1_required = xtrue; then - if test x$ac_success = xno; then - AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) - fi - fi - if test x$ac_success = xno; then - HAVE_CXX$1=0 - AC_MSG_NOTICE([No compiler with C++$1 support was found]) - else - HAVE_CXX$1=1 - AC_DEFINE(HAVE_CXX$1,1, - [define if the compiler supports basic C++$1 syntax]) - fi - AC_SUBST(HAVE_CXX$1) - m4_if([$1], [17], [AC_MSG_WARN([C++17 is not yet standardized, so the checks may change in incompatible ways anytime])]) -]) - - -dnl Test body for checking C++11 support - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 -) - - -dnl Test body for checking C++14 support - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 -) - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 -) - -dnl Tests for new features in C++11 - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ - -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201103L - -#error "This is not a C++11 compiler" - -#else - -#include - -namespace cxx11 -{ - - namespace test_static_assert - { - - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - } - - namespace test_final_override - { - - struct Base - { - virtual void f() {} - }; - - struct Derived : public Base - { - virtual void f() override {} - }; - - } - - namespace test_double_right_angle_brackets - { - - template < typename T > - struct check {}; - - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; - - } - - namespace test_decltype - { - - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } - - } - - namespace test_type_deduction - { - - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; - - template < typename T > - struct is_same - { - static const bool value = true; - }; - - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } - - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } - - } - - namespace test_noexcept - { - - int f() { return 0; } - int g() noexcept { return 0; } - - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); - - } - - namespace test_constexpr - { - - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept - { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } - - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept - { - return strlen_c_r(s, 0UL); - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); - - } - - namespace test_rvalue_references - { - - template < int N > - struct answer - { - static constexpr int value = N; - }; - - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } - - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } - - } - - namespace test_uniform_initialization - { - - struct test - { - static const int zero {}; - static const int one {1}; - }; - - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); - - } - - namespace test_lambdas - { - - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } - - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } - - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } - - } - - namespace test_variadic_templates - { - - template - struct sum; - - template - struct sum - { - static constexpr auto value = N0 + sum::value; - }; - - template <> - struct sum<> - { - static constexpr auto value = 0; - }; - - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); - - } - - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { - - struct foo {}; - - template - using member = typename T::member_type; - - template - void func(...) {} - - template - void func(member*) {} - - void test(); - - void test() { func(0); } - - } - - namespace test_std_move_and_forward - { - struct message {}; - char foo(message&) { return '\0'; } - int foo(message&&) { return 0; } - - template - void check(Arg&& arg, RT rt) { - static_assert(sizeof(rt) == sizeof(foo(std::forward(arg))), ""); - } - void test() { - message a; - check(a, char()); - check(std::move(a), int()); - } - } - -} // namespace cxx11 - -#endif // __cplusplus >= 201103L - -]]) - - -dnl Tests for new features in C++14 - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ - -// If the compiler admits that it is not ready for C++14, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201402L - -#error "This is not a C++14 compiler" - -#else - -namespace cxx14 -{ - - namespace test_polymorphic_lambdas - { - - int - test() - { - const auto lambda = [](auto&&... args){ - const auto istiny = [](auto x){ - return (sizeof(x) == 1UL) ? 1 : 0; - }; - const int aretiny[] = { istiny(args)... }; - return aretiny[0]; - }; - return lambda(1, 1L, 1.0f, '1'); - } - - } - - namespace test_binary_literals - { - - constexpr auto ivii = 0b0000000000101010; - static_assert(ivii == 42, "wrong value"); - - } - - namespace test_generalized_constexpr - { - - template < typename CharT > - constexpr unsigned long - strlen_c(const CharT *const s) noexcept - { - auto length = 0UL; - for (auto p = s; *p; ++p) - ++length; - return length; - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("x") == 1UL, ""); - static_assert(strlen_c("test") == 4UL, ""); - static_assert(strlen_c("another\0test") == 7UL, ""); - - } - - namespace test_lambda_init_capture - { - - int - test() - { - auto x = 0; - const auto lambda1 = [a = x](int b){ return a + b; }; - const auto lambda2 = [a = lambda1(x)](){ return a; }; - return lambda2(); - } - - } - - namespace test_digit_separators - { - - constexpr auto ten_million = 100'000'000; - static_assert(ten_million == 100000000, ""); - - } - - namespace test_return_type_deduction - { - - auto f(int& x) { return x; } - decltype(auto) g(int& x) { return x; } - - template < typename T1, typename T2 > - struct is_same - { - static constexpr auto value = false; - }; - - template < typename T > - struct is_same - { - static constexpr auto value = true; - }; - - int - test() - { - auto x = 0; - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - return x; - } - - } - -} // namespace cxx14 - -#endif // __cplusplus >= 201402L - -]]) - - -dnl Tests for new features in C++17 - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ - -// If the compiler admits that it is not ready for C++17, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus <= 201402L - -#error "This is not a C++17 compiler" - -#else - -#if defined(__clang__) - #define REALLY_CLANG -#else - #if defined(__GNUC__) - #define REALLY_GCC - #endif -#endif - -#include -#include -#include - -namespace cxx17 -{ - -#if !defined(REALLY_CLANG) - namespace test_constexpr_lambdas - { - - // TODO: test it with clang++ from git - - constexpr int foo = [](){return 42;}(); - - } -#endif // !defined(REALLY_CLANG) - - namespace test::nested_namespace::definitions - { - - } - - namespace test_fold_expression - { - - template - int multiply(Args... args) - { - return (args * ... * 1); - } - - template - bool all(Args... args) - { - return (args && ...); - } - - } - - namespace test_extended_static_assert - { - - static_assert (true); - - } - - namespace test_auto_brace_init_list - { - - auto foo = {5}; - auto bar {5}; - - static_assert(std::is_same, decltype(foo)>::value); - static_assert(std::is_same::value); - } - - namespace test_typename_in_template_template_parameter - { - - template typename X> struct D; - - } - - namespace test_fallthrough_nodiscard_maybe_unused_attributes - { - - int f1() - { - return 42; - } - - [[nodiscard]] int f2() - { - [[maybe_unused]] auto unused = f1(); - - switch (f1()) - { - case 17: - f1(); - [[fallthrough]]; - case 42: - f1(); - } - return f1(); - } - - } - - namespace test_extended_aggregate_initialization - { - - struct base1 - { - int b1, b2 = 42; - }; - - struct base2 - { - base2() { - b3 = 42; - } - int b3; - }; - - struct derived : base1, base2 - { - int d; - }; - - derived d1 {{1, 2}, {}, 4}; // full initialization - derived d2 {{}, {}, 4}; // value-initialized bases - - } - - namespace test_general_range_based_for_loop - { - - struct iter - { - int i; - - int& operator* () - { - return i; - } - - const int& operator* () const - { - return i; - } - - iter& operator++() - { - ++i; - return *this; - } - }; - - struct sentinel - { - int i; - }; - - bool operator== (const iter& i, const sentinel& s) - { - return i.i == s.i; - } - - bool operator!= (const iter& i, const sentinel& s) - { - return !(i == s); - } - - struct range - { - iter begin() const - { - return {0}; - } - - sentinel end() const - { - return {5}; - } - }; - - void f() - { - range r {}; - - for (auto i : r) - { - [[maybe_unused]] auto v = i; - } - } - - } - - namespace test_lambda_capture_asterisk_this_by_value - { - - struct t - { - int i; - int foo() - { - return [*this]() - { - return i; - }(); - } - }; - - } - - namespace test_enum_class_construction - { - - enum class byte : unsigned char - {}; - - byte foo {42}; - - } - - namespace test_constexpr_if - { - - template - int f () - { - if constexpr(cond) - { - return 13; - } - else - { - return 42; - } - } - - } - - namespace test_selection_statement_with_initializer - { - - int f() - { - return 13; - } - - int f2() - { - if (auto i = f(); i > 0) - { - return 3; - } - - switch (auto i = f(); i + 4) - { - case 17: - return 2; - - default: - return 1; - } - } - - } - -#if !defined(REALLY_CLANG) - namespace test_template_argument_deduction_for_class_templates - { - - // TODO: test it with clang++ from git - - template - struct pair - { - pair (T1 p1, T2 p2) - : m1 {p1}, - m2 {p2} - {} - - T1 m1; - T2 m2; - }; - - void f() - { - [[maybe_unused]] auto p = pair{13, 42u}; - } - - } -#endif // !defined(REALLY_CLANG) - - namespace test_non_type_auto_template_parameters - { - - template - struct B - {}; - - B<5> b1; - B<'a'> b2; - - } - -#if !defined(REALLY_CLANG) - namespace test_structured_bindings - { - - // TODO: test it with clang++ from git - - int arr[2] = { 1, 2 }; - std::pair pr = { 1, 2 }; - - auto f1() -> int(&)[2] - { - return arr; - } - - auto f2() -> std::pair& - { - return pr; - } - - struct S - { - int x1 : 2; - volatile double y1; - }; - - S f3() - { - return {}; - } - - auto [ x1, y1 ] = f1(); - auto& [ xr1, yr1 ] = f1(); - auto [ x2, y2 ] = f2(); - auto& [ xr2, yr2 ] = f2(); - const auto [ x3, y3 ] = f3(); - - } -#endif // !defined(REALLY_CLANG) - -#if !defined(REALLY_CLANG) - namespace test_exception_spec_type_system - { - - // TODO: test it with clang++ from git - - struct Good {}; - struct Bad {}; - - void g1() noexcept; - void g2(); - - template - Bad - f(T*, T*); - - template - Good - f(T1*, T2*); - - static_assert (std::is_same_v); - - } -#endif // !defined(REALLY_CLANG) - - namespace test_inline_variables - { - - template void f(T) - {} - - template inline T g(T) - { - return T{}; - } - - template<> inline void f<>(int) - {} - - template<> int g<>(int) - { - return 5; - } - - } - -} // namespace cxx17 - -#endif // __cplusplus <= 201402L - -]]) diff --git a/m4/ax_prog_cc_for_build.m4 b/m4/ax_prog_cc_for_build.m4 deleted file mode 100644 index 77fd346a79..0000000000 --- a/m4/ax_prog_cc_for_build.m4 +++ /dev/null @@ -1,125 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_PROG_CC_FOR_BUILD -# -# DESCRIPTION -# -# This macro searches for a C compiler that generates native executables, -# that is a C compiler that surely is not a cross-compiler. This can be -# useful if you have to generate source code at compile-time like for -# example GCC does. -# -# The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything -# needed to compile or link (CC_FOR_BUILD) and preprocess (CPP_FOR_BUILD). -# The value of these variables can be overridden by the user by specifying -# a compiler with an environment variable (like you do for standard CC). -# -# It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and object -# file extensions for the build platform, and GCC_FOR_BUILD to `yes' if -# the compiler we found is GCC. All these variables but GCC_FOR_BUILD are -# substituted in the Makefile. -# -# LICENSE -# -# Copyright (c) 2008 Paolo Bonzini -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 8 - -AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD]) -AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_CPP])dnl -AC_REQUIRE([AC_EXEEXT])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl - -dnl Use the standard macros, but make them use other variable names -dnl -pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl -pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl -pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl -pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl -pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl -pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl -pushdef([ac_cv_objext], ac_cv_build_objext)dnl -pushdef([ac_exeext], ac_build_exeext)dnl -pushdef([ac_objext], ac_build_objext)dnl -pushdef([CC], CC_FOR_BUILD)dnl -pushdef([CPP], CPP_FOR_BUILD)dnl -pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl -pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl -pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl -pushdef([host], build)dnl -pushdef([host_alias], build_alias)dnl -pushdef([host_cpu], build_cpu)dnl -pushdef([host_vendor], build_vendor)dnl -pushdef([host_os], build_os)dnl -pushdef([ac_cv_host], ac_cv_build)dnl -pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl -pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl -pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl -pushdef([ac_cv_host_os], ac_cv_build_os)dnl -pushdef([ac_cpp], ac_build_cpp)dnl -pushdef([ac_compile], ac_build_compile)dnl -pushdef([ac_link], ac_build_link)dnl - -save_cross_compiling=$cross_compiling -save_ac_tool_prefix=$ac_tool_prefix -cross_compiling=no -ac_tool_prefix= - -AC_PROG_CC -AC_PROG_CPP -AC_EXEEXT - -ac_tool_prefix=$save_ac_tool_prefix -cross_compiling=$save_cross_compiling - -dnl Restore the old definitions -dnl -popdef([ac_link])dnl -popdef([ac_compile])dnl -popdef([ac_cpp])dnl -popdef([ac_cv_host_os])dnl -popdef([ac_cv_host_vendor])dnl -popdef([ac_cv_host_cpu])dnl -popdef([ac_cv_host_alias])dnl -popdef([ac_cv_host])dnl -popdef([host_os])dnl -popdef([host_vendor])dnl -popdef([host_cpu])dnl -popdef([host_alias])dnl -popdef([host])dnl -popdef([LDFLAGS])dnl -popdef([CPPFLAGS])dnl -popdef([CFLAGS])dnl -popdef([CPP])dnl -popdef([CC])dnl -popdef([ac_objext])dnl -popdef([ac_exeext])dnl -popdef([ac_cv_objext])dnl -popdef([ac_cv_exeext])dnl -popdef([ac_cv_prog_cc_g])dnl -popdef([ac_cv_prog_cc_cross])dnl -popdef([ac_cv_prog_cc_works])dnl -popdef([ac_cv_prog_gcc])dnl -popdef([ac_cv_prog_CPP])dnl - -dnl Finally, set Makefile variables -dnl -BUILD_EXEEXT=$ac_build_exeext -BUILD_OBJEXT=$ac_build_objext -AC_SUBST(BUILD_EXEEXT)dnl -AC_SUBST(BUILD_OBJEXT)dnl -AC_SUBST([CFLAGS_FOR_BUILD])dnl -AC_SUBST([CPPFLAGS_FOR_BUILD])dnl -AC_SUBST([LDFLAGS_FOR_BUILD])dnl -]) diff --git a/m4/ax_prog_cxx_for_build.m4 b/m4/ax_prog_cxx_for_build.m4 deleted file mode 100644 index 8cc0f73c0f..0000000000 --- a/m4/ax_prog_cxx_for_build.m4 +++ /dev/null @@ -1,110 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_prog_cxx_for_build.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_PROG_CXX_FOR_BUILD -# -# DESCRIPTION -# -# This macro searches for a C++ compiler that generates native -# executables, that is a C++ compiler that surely is not a cross-compiler. -# This can be useful if you have to generate source code at compile-time -# like for example GCC does. -# -# The macro sets the CXX_FOR_BUILD and CXXCPP_FOR_BUILD macros to anything -# needed to compile or link (CXX_FOR_BUILD) and preprocess -# (CXXCPP_FOR_BUILD). The value of these variables can be overridden by -# the user by specifying a compiler with an environment variable (like you -# do for standard CXX). -# -# LICENSE -# -# Copyright (c) 2008 Paolo Bonzini -# Copyright (c) 2012 Avionic Design GmbH -# -# Based on the AX_PROG_CC_FOR_BUILD macro by Paolo Bonzini. -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 2 - -AU_ALIAS([AC_PROG_CXX_FOR_BUILD], [AX_PROG_CXX_FOR_BUILD]) -AC_DEFUN([AX_PROG_CXX_FOR_BUILD], [dnl -AC_REQUIRE([AX_PROG_CC_FOR_BUILD])dnl -AC_REQUIRE([AC_PROG_CXX])dnl -AC_REQUIRE([AC_PROG_CXXCPP])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl - -dnl Use the standard macros, but make them use other variable names -dnl -pushdef([ac_cv_prog_CXXCPP], ac_cv_build_prog_CXXCPP)dnl -pushdef([ac_cv_prog_gxx], ac_cv_build_prog_gxx)dnl -pushdef([ac_cv_prog_cxx_works], ac_cv_build_prog_cxx_works)dnl -pushdef([ac_cv_prog_cxx_cross], ac_cv_build_prog_cxx_cross)dnl -pushdef([ac_cv_prog_cxx_g], ac_cv_build_prog_cxx_g)dnl -pushdef([CXX], CXX_FOR_BUILD)dnl -pushdef([CXXCPP], CXXCPP_FOR_BUILD)dnl -pushdef([CXXFLAGS], CXXFLAGS_FOR_BUILD)dnl -pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl -pushdef([CXXCPPFLAGS], CXXCPPFLAGS_FOR_BUILD)dnl -pushdef([host], build)dnl -pushdef([host_alias], build_alias)dnl -pushdef([host_cpu], build_cpu)dnl -pushdef([host_vendor], build_vendor)dnl -pushdef([host_os], build_os)dnl -pushdef([ac_cv_host], ac_cv_build)dnl -pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl -pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl -pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl -pushdef([ac_cv_host_os], ac_cv_build_os)dnl -pushdef([ac_cxxcpp], ac_build_cxxcpp)dnl -pushdef([ac_compile], ac_build_compile)dnl -pushdef([ac_link], ac_build_link)dnl - -save_cross_compiling=$cross_compiling -save_ac_tool_prefix=$ac_tool_prefix -cross_compiling=no -ac_tool_prefix= - -AC_PROG_CXX -AC_PROG_CXXCPP - -ac_tool_prefix=$save_ac_tool_prefix -cross_compiling=$save_cross_compiling - -dnl Restore the old definitions -dnl -popdef([ac_link])dnl -popdef([ac_compile])dnl -popdef([ac_cxxcpp])dnl -popdef([ac_cv_host_os])dnl -popdef([ac_cv_host_vendor])dnl -popdef([ac_cv_host_cpu])dnl -popdef([ac_cv_host_alias])dnl -popdef([ac_cv_host])dnl -popdef([host_os])dnl -popdef([host_vendor])dnl -popdef([host_cpu])dnl -popdef([host_alias])dnl -popdef([host])dnl -popdef([CXXCPPFLAGS])dnl -popdef([CPPFLAGS])dnl -popdef([CXXFLAGS])dnl -popdef([CXXCPP])dnl -popdef([CXX])dnl -popdef([ac_cv_prog_cxx_g])dnl -popdef([ac_cv_prog_cxx_cross])dnl -popdef([ac_cv_prog_cxx_works])dnl -popdef([ac_cv_prog_gxx])dnl -popdef([ac_cv_prog_CXXCPP])dnl - -dnl Finally, set Makefile variables -dnl -AC_SUBST([CXXFLAGS_FOR_BUILD])dnl -AC_SUBST([CXXCPPFLAGS_FOR_BUILD])dnl -]) diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4 deleted file mode 100644 index 1598d077ff..0000000000 --- a/m4/ax_pthread.m4 +++ /dev/null @@ -1,507 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_pthread.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -# -# DESCRIPTION -# -# This macro figures out how to build C programs using POSIX threads. It -# sets the PTHREAD_LIBS output variable to the threads library and linker -# flags, and the PTHREAD_CFLAGS output variable to any special C compiler -# flags that are needed. (The user can also force certain compiler -# flags/libs to be tested by setting these environment variables.) -# -# Also sets PTHREAD_CC to any special C compiler that is needed for -# multi-threaded programs (defaults to the value of CC otherwise). (This -# is necessary on AIX to use the special cc_r compiler alias.) -# -# NOTE: You are assumed to not only compile your program with these flags, -# but also to link with them as well. For example, you might link with -# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS -# -# If you are only building threaded programs, you may wish to use these -# variables in your default LIBS, CFLAGS, and CC: -# -# LIBS="$PTHREAD_LIBS $LIBS" -# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -# CC="$PTHREAD_CC" -# -# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant -# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to -# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). -# -# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the -# PTHREAD_PRIO_INHERIT symbol is defined when compiling with -# PTHREAD_CFLAGS. -# -# ACTION-IF-FOUND is a list of shell commands to run if a threads library -# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it -# is not found. If ACTION-IF-FOUND is not specified, the default action -# will define HAVE_PTHREAD. -# -# Please let the authors know if this macro fails on any platform, or if -# you have any other suggestions or comments. This macro was based on work -# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help -# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by -# Alejandro Forero Cuervo to the autoconf macro repository. We are also -# grateful for the helpful feedback of numerous users. -# -# Updated for Autoconf 2.68 by Daniel Richard G. -# -# LICENSE -# -# Copyright (c) 2008 Steven G. Johnson -# Copyright (c) 2011 Daniel Richard G. -# Copyright (c) 2019 Marc Stevens -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 27 - -AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) -AC_DEFUN([AX_PTHREAD], [ -AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_CC]) -AC_REQUIRE([AC_PROG_SED]) -AC_LANG_PUSH([C]) -ax_pthread_ok=no - -# We used to check for pthread.h first, but this fails if pthread.h -# requires special compiler flags (e.g. on Tru64 or Sequent). -# It gets checked for in the link test anyway. - -# First of all, check if the user has set any of the PTHREAD_LIBS, -# etcetera environment variables, and if threads linking works using -# them: -if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then - ax_pthread_save_CC="$CC" - ax_pthread_save_CFLAGS="$CFLAGS" - ax_pthread_save_LIBS="$LIBS" - AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) - AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) - AC_MSG_RESULT([$ax_pthread_ok]) - if test "x$ax_pthread_ok" = "xno"; then - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" - fi - CC="$ax_pthread_save_CC" - CFLAGS="$ax_pthread_save_CFLAGS" - LIBS="$ax_pthread_save_LIBS" -fi - -# We must check for the threads library under a number of different -# names; the ordering is very important because some systems -# (e.g. DEC) have both -lpthread and -lpthreads, where one of the -# libraries is broken (non-POSIX). - -# Create a list of thread flags to try. Items with a "," contain both -# C compiler flags (before ",") and linker flags (after ","). Other items -# starting with a "-" are C compiler flags, and remaining items are -# library names, except for "none" which indicates that we try without -# any flags at all, and "pthread-config" which is a program returning -# the flags for the Pth emulation library. - -ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" - -# The ordering *is* (sometimes) important. Some notes on the -# individual items follow: - -# pthreads: AIX (must check this before -lpthread) -# none: in case threads are in libc; should be tried before -Kthread and -# other compiler flags to prevent continual compiler warnings -# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 -# (Note: HP C rejects this with "bad form for `-t' option") -# -pthreads: Solaris/gcc (Note: HP C also rejects) -# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads and -# -D_REENTRANT too), HP C (must be checked before -lpthread, which -# is present but should not be used directly; and before -mthreads, -# because the compiler interprets this as "-mt" + "-hreads") -# -mthreads: Mingw32/gcc, Lynx/gcc -# pthread: Linux, etcetera -# --thread-safe: KAI C++ -# pthread-config: use pthread-config program (for GNU Pth library) - -case $host_os in - - freebsd*) - - # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) - # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) - - ax_pthread_flags="-kthread lthread $ax_pthread_flags" - ;; - - hpux*) - - # From the cc(1) man page: "[-mt] Sets various -D flags to enable - # multi-threading and also sets -lpthread." - - ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" - ;; - - openedition*) - - # IBM z/OS requires a feature-test macro to be defined in order to - # enable POSIX threads at all, so give the user a hint if this is - # not set. (We don't define these ourselves, as they can affect - # other portions of the system API in unpredictable ways.) - - AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING], - [ -# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) - AX_PTHREAD_ZOS_MISSING -# endif - ], - [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])]) - ;; - - solaris*) - - # On Solaris (at least, for some versions), libc contains stubbed - # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (N.B.: The stubs are missing - # pthread_cleanup_push, or rather a function called by this macro, - # so we could check for that, but who knows whether they'll stub - # that too in a future libc.) So we'll check first for the - # standard Solaris way of linking pthreads (-mt -lpthread). - - ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" - ;; -esac - -# Are we compiling with Clang? - -AC_CACHE_CHECK([whether $CC is Clang], - [ax_cv_PTHREAD_CLANG], - [ax_cv_PTHREAD_CLANG=no - # Note that Autoconf sets GCC=yes for Clang as well as GCC - if test "x$GCC" = "xyes"; then - AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], - [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ -# if defined(__clang__) && defined(__llvm__) - AX_PTHREAD_CC_IS_CLANG -# endif - ], - [ax_cv_PTHREAD_CLANG=yes]) - fi - ]) -ax_pthread_clang="$ax_cv_PTHREAD_CLANG" - - -# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) - -# Note that for GCC and Clang -pthread generally implies -lpthread, -# except when -nostdlib is passed. -# This is problematic using libtool to build C++ shared libraries with pthread: -# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 -# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 -# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 -# To solve this, first try -pthread together with -lpthread for GCC - -AS_IF([test "x$GCC" = "xyes"], - [ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"]) - -# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first - -AS_IF([test "x$ax_pthread_clang" = "xyes"], - [ax_pthread_flags="-pthread,-lpthread -pthread"]) - - -# The presence of a feature test macro requesting re-entrant function -# definitions is, on some systems, a strong hint that pthreads support is -# correctly enabled - -case $host_os in - darwin* | hpux* | linux* | osf* | solaris*) - ax_pthread_check_macro="_REENTRANT" - ;; - - aix*) - ax_pthread_check_macro="_THREAD_SAFE" - ;; - - *) - ax_pthread_check_macro="--" - ;; -esac -AS_IF([test "x$ax_pthread_check_macro" = "x--"], - [ax_pthread_check_cond=0], - [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"]) - - -if test "x$ax_pthread_ok" = "xno"; then -for ax_pthread_try_flag in $ax_pthread_flags; do - - case $ax_pthread_try_flag in - none) - AC_MSG_CHECKING([whether pthreads work without any flags]) - ;; - - *,*) - PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` - PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` - AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"]) - ;; - - -*) - AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) - PTHREAD_CFLAGS="$ax_pthread_try_flag" - ;; - - pthread-config) - AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) - AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) - PTHREAD_CFLAGS="`pthread-config --cflags`" - PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" - ;; - - *) - AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) - PTHREAD_LIBS="-l$ax_pthread_try_flag" - ;; - esac - - ax_pthread_save_CFLAGS="$CFLAGS" - ax_pthread_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - - # Check for various functions. We must include pthread.h, - # since some functions may be macros. (On the Sequent, we - # need a special flag -Kthread to make this header compile.) - # We check for pthread_join because it is in -lpthread on IRIX - # while pthread_create is in libc. We check for pthread_attr_init - # due to DEC craziness with -lpthreads. We check for - # pthread_cleanup_push because it is one of the few pthread - # functions on Solaris that doesn't have a non-functional libc stub. - # We try pthread_create on general principles. - - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include -# if $ax_pthread_check_cond -# error "$ax_pthread_check_macro must be defined" -# endif - static void *some_global = NULL; - static void routine(void *a) - { - /* To avoid any unused-parameter or - unused-but-set-parameter warning. */ - some_global = a; - } - static void *start_routine(void *a) { return a; }], - [pthread_t th; pthread_attr_t attr; - pthread_create(&th, 0, start_routine, 0); - pthread_join(th, 0); - pthread_attr_init(&attr); - pthread_cleanup_push(routine, 0); - pthread_cleanup_pop(0) /* ; */])], - [ax_pthread_ok=yes], - []) - - CFLAGS="$ax_pthread_save_CFLAGS" - LIBS="$ax_pthread_save_LIBS" - - AC_MSG_RESULT([$ax_pthread_ok]) - AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) - - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" -done -fi - - -# Clang needs special handling, because older versions handle the -pthread -# option in a rather... idiosyncratic way - -if test "x$ax_pthread_clang" = "xyes"; then - - # Clang takes -pthread; it has never supported any other flag - - # (Note 1: This will need to be revisited if a system that Clang - # supports has POSIX threads in a separate library. This tends not - # to be the way of modern systems, but it's conceivable.) - - # (Note 2: On some systems, notably Darwin, -pthread is not needed - # to get POSIX threads support; the API is always present and - # active. We could reasonably leave PTHREAD_CFLAGS empty. But - # -pthread does define _REENTRANT, and while the Darwin headers - # ignore this macro, third-party headers might not.) - - # However, older versions of Clang make a point of warning the user - # that, in an invocation where only linking and no compilation is - # taking place, the -pthread option has no effect ("argument unused - # during compilation"). They expect -pthread to be passed in only - # when source code is being compiled. - # - # Problem is, this is at odds with the way Automake and most other - # C build frameworks function, which is that the same flags used in - # compilation (CFLAGS) are also used in linking. Many systems - # supported by AX_PTHREAD require exactly this for POSIX threads - # support, and in fact it is often not straightforward to specify a - # flag that is used only in the compilation phase and not in - # linking. Such a scenario is extremely rare in practice. - # - # Even though use of the -pthread flag in linking would only print - # a warning, this can be a nuisance for well-run software projects - # that build with -Werror. So if the active version of Clang has - # this misfeature, we search for an option to squash it. - - AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread], - [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG], - [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown - # Create an alternate version of $ac_link that compiles and - # links in two steps (.c -> .o, .o -> exe) instead of one - # (.c -> exe), because the warning occurs only in the second - # step - ax_pthread_save_ac_link="$ac_link" - ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' - ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` - ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" - ax_pthread_save_CFLAGS="$CFLAGS" - for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do - AS_IF([test "x$ax_pthread_try" = "xunknown"], [break]) - CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" - ac_link="$ax_pthread_save_ac_link" - AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], - [ac_link="$ax_pthread_2step_ac_link" - AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], - [break]) - ]) - done - ac_link="$ax_pthread_save_ac_link" - CFLAGS="$ax_pthread_save_CFLAGS" - AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no]) - ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" - ]) - - case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in - no | unknown) ;; - *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; - esac - -fi # $ax_pthread_clang = yes - - - -# Various other checks: -if test "x$ax_pthread_ok" = "xyes"; then - ax_pthread_save_CFLAGS="$CFLAGS" - ax_pthread_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - - # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - AC_CACHE_CHECK([for joinable pthread attribute], - [ax_cv_PTHREAD_JOINABLE_ATTR], - [ax_cv_PTHREAD_JOINABLE_ATTR=unknown - for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], - [int attr = $ax_pthread_attr; return attr /* ; */])], - [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], - []) - done - ]) - AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ - test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ - test "x$ax_pthread_joinable_attr_defined" != "xyes"], - [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], - [$ax_cv_PTHREAD_JOINABLE_ATTR], - [Define to necessary symbol if this constant - uses a non-standard name on your system.]) - ax_pthread_joinable_attr_defined=yes - ]) - - AC_CACHE_CHECK([whether more special flags are required for pthreads], - [ax_cv_PTHREAD_SPECIAL_FLAGS], - [ax_cv_PTHREAD_SPECIAL_FLAGS=no - case $host_os in - solaris*) - ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" - ;; - esac - ]) - AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ - test "x$ax_pthread_special_flags_added" != "xyes"], - [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" - ax_pthread_special_flags_added=yes]) - - AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], - [ax_cv_PTHREAD_PRIO_INHERIT], - [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[int i = PTHREAD_PRIO_INHERIT; - return i;]])], - [ax_cv_PTHREAD_PRIO_INHERIT=yes], - [ax_cv_PTHREAD_PRIO_INHERIT=no]) - ]) - AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ - test "x$ax_pthread_prio_inherit_defined" != "xyes"], - [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.]) - ax_pthread_prio_inherit_defined=yes - ]) - - CFLAGS="$ax_pthread_save_CFLAGS" - LIBS="$ax_pthread_save_LIBS" - - # More AIX lossage: compile with *_r variant - if test "x$GCC" != "xyes"; then - case $host_os in - aix*) - AS_CASE(["x/$CC"], - [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], - [#handle absolute path differently from PATH based program lookup - AS_CASE(["x$CC"], - [x/*], - [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], - [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) - ;; - esac - fi -fi - -test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" - -AC_SUBST([PTHREAD_LIBS]) -AC_SUBST([PTHREAD_CFLAGS]) -AC_SUBST([PTHREAD_CC]) - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test "x$ax_pthread_ok" = "xyes"; then - ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) - : -else - ax_pthread_ok=no - $2 -fi -AC_LANG_POP -])dnl AX_PTHREAD diff --git a/m4/stl_hash.m4 b/m4/stl_hash.m4 deleted file mode 100644 index d7def1af9b..0000000000 --- a/m4/stl_hash.m4 +++ /dev/null @@ -1,71 +0,0 @@ -# We check two things: where the include file is for -# unordered_map/hash_map (we prefer the first form), and what -# namespace unordered/hash_map lives in within that include file. We -# include AC_TRY_COMPILE for all the combinations we've seen in the -# wild. We define HASH_MAP_H to the location of the header file, and -# HASH_NAMESPACE to the namespace the class (unordered_map or -# hash_map) is in. - -# This also checks if unordered map exists. -AC_DEFUN([AC_CXX_STL_HASH], - [ - AC_MSG_CHECKING(the location of hash_map) - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - ac_cv_cxx_hash_map="" - # First try unordered_map, but not on gcc's before 4.2 -- I've - # seen unexplainable unordered_map bugs with -O2 on older gcc's. - AC_TRY_COMPILE([#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)) - # error GCC too old for unordered_map - #endif - ], - [/* no program body necessary */], - [stl_hash_old_gcc=no], - [stl_hash_old_gcc=yes]) - for location in unordered_map tr1/unordered_map; do - for namespace in std std::tr1; do - if test -z "$ac_cv_cxx_hash_map" -a "$stl_hash_old_gcc" != yes; then - # Some older gcc's have a buggy tr1, so test a bit of code. - AC_TRY_COMPILE([#include <$location>], - [const ${namespace}::unordered_map t; - return t.find(5) == t.end();], - [ac_cv_cxx_hash_map="<$location>"; - ac_cv_cxx_hash_namespace="$namespace"; - ac_cv_cxx_hash_map_class="unordered_map";]) - fi - done - done - # Now try hash_map - for location in ext/hash_map hash_map; do - for namespace in __gnu_cxx "" std stdext; do - if test -z "$ac_cv_cxx_hash_map"; then - AC_TRY_COMPILE([#include <$location>], - [${namespace}::hash_map t], - [ac_cv_cxx_hash_map="<$location>"; - ac_cv_cxx_hash_namespace="$namespace"; - ac_cv_cxx_hash_map_class="hash_map";]) - fi - done - done - ac_cv_cxx_hash_set=`echo "$ac_cv_cxx_hash_map" | sed s/map/set/`; - ac_cv_cxx_hash_set_class=`echo "$ac_cv_cxx_hash_map_class" | sed s/map/set/`; - if test -n "$ac_cv_cxx_hash_map"; then - AC_DEFINE(HAVE_HASH_MAP, 1, [define if the compiler has hash_map]) - AC_DEFINE(HAVE_HASH_SET, 1, [define if the compiler has hash_set]) - AC_DEFINE_UNQUOTED(HASH_MAP_H,$ac_cv_cxx_hash_map, - [the location of or ]) - AC_DEFINE_UNQUOTED(HASH_SET_H,$ac_cv_cxx_hash_set, - [the location of or ]) - AC_DEFINE_UNQUOTED(HASH_NAMESPACE,$ac_cv_cxx_hash_namespace, - [the namespace of hash_map/hash_set]) - AC_DEFINE_UNQUOTED(HASH_MAP_CLASS,$ac_cv_cxx_hash_map_class, - [the name of ]) - AC_DEFINE_UNQUOTED(HASH_SET_CLASS,$ac_cv_cxx_hash_set_class, - [the name of ]) - AC_MSG_RESULT([$ac_cv_cxx_hash_map]) - else - AC_MSG_RESULT() - AC_MSG_WARN([could not find an STL hash_map]) - fi -]) - diff --git a/maven_install.json b/maven_install.json index 9c5860a948..1a938afc22 100644 --- a/maven_install.json +++ b/maven_install.json @@ -1,24 +1,251 @@ { "dependency_tree": { "__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL", - "__INPUT_ARTIFACTS_HASH": -228414992, - "__RESOLVED_ARTIFACTS_HASH": -722345565, + "__INPUT_ARTIFACTS_HASH": 579287445, + "__RESOLVED_ARTIFACTS_HASH": -1248440885, "conflict_resolution": { - "com.google.errorprone:error_prone_annotations:2.3.2": "com.google.errorprone:error_prone_annotations:2.11.0", - "junit:junit:4.12": "junit:junit:4.13.2" + "com.google.errorprone:error_prone_annotations:2.3.2": "com.google.errorprone:error_prone_annotations:2.11.0" }, "dependencies": [ { - "coord": "com.google.auto.value:auto-value-annotations:1.7.4", + "coord": "com.google.auto.value:auto-value-annotations:1.8.1", "dependencies": [], "directDependencies": [], - "file": "v1/https/repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations/1.7.4/auto-value-annotations-1.7.4.jar", + "file": "v1/https/repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations/1.8.1/auto-value-annotations-1.8.1.jar", "mirror_urls": [ - "https://repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations/1.7.4/auto-value-annotations-1.7.4.jar", - "https://repo.maven.apache.org/maven2/com/google/auto/value/auto-value-annotations/1.7.4/auto-value-annotations-1.7.4.jar" + "https://repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations/1.8.1/auto-value-annotations-1.8.1.jar", + "https://repo.maven.apache.org/maven2/com/google/auto/value/auto-value-annotations/1.8.1/auto-value-annotations-1.8.1.jar" ], - "sha256": "fedd59b0b4986c342f6ab2d182f2a4ee9fceb2c7e2d5bdc4dc764c92394a23d3", - "url": "https://repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations/1.7.4/auto-value-annotations-1.7.4.jar" + "sha256": "37ec09b47d7ed35a99d13927db5c86fc9071f620f943ead5d757144698310852", + "url": "https://repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations/1.8.1/auto-value-annotations-1.8.1.jar" + }, + { + "coord": "com.google.caliper:caliper-api:1.0-beta-3", + "dependencies": [ + "com.google.guava:guava:31.1-jre", + "joda-time:joda-time:2.10.10" + ], + "directDependencies": [ + "com.google.guava:guava:31.1-jre", + "joda-time:joda-time:2.10.10" + ], + "file": "v1/https/repo1.maven.org/maven2/com/google/caliper/caliper-api/1.0-beta-3/caliper-api-1.0-beta-3.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/com/google/caliper/caliper-api/1.0-beta-3/caliper-api-1.0-beta-3.jar", + "https://repo.maven.apache.org/maven2/com/google/caliper/caliper-api/1.0-beta-3/caliper-api-1.0-beta-3.jar" + ], + "sha256": "374f0c6c0c1f8784cb69d885e1dcbb7498c34ca20369e0597264568530642928", + "url": "https://repo1.maven.org/maven2/com/google/caliper/caliper-api/1.0-beta-3/caliper-api-1.0-beta-3.jar" + }, + { + "coord": "com.google.caliper:caliper-core:1.0-beta-3", + "dependencies": [ + "com.google.auto.value:auto-value-annotations:1.8.1", + "com.google.caliper:caliper-api:1.0-beta-3", + "com.google.caliper:caliper-util:1.0-beta-3", + "com.google.code.gson:gson:2.8.9", + "com.google.dagger:dagger:2.22.1", + "com.google.guava:guava:31.1-jre", + "com.squareup.okhttp:okhttp:2.7.5", + "com.squareup.okio:okio:1.6.0", + "javax.inject:javax.inject:1", + "joda-time:joda-time:2.10.10" + ], + "directDependencies": [ + "com.google.auto.value:auto-value-annotations:1.8.1", + "com.google.caliper:caliper-api:1.0-beta-3", + "com.google.caliper:caliper-util:1.0-beta-3", + "com.google.dagger:dagger:2.22.1", + "com.google.guava:guava:31.1-jre", + "com.squareup.okhttp:okhttp:2.7.5", + "joda-time:joda-time:2.10.10" + ], + "file": "v1/https/repo1.maven.org/maven2/com/google/caliper/caliper-core/1.0-beta-3/caliper-core-1.0-beta-3.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/com/google/caliper/caliper-core/1.0-beta-3/caliper-core-1.0-beta-3.jar", + "https://repo.maven.apache.org/maven2/com/google/caliper/caliper-core/1.0-beta-3/caliper-core-1.0-beta-3.jar" + ], + "sha256": "514deac8f8b09dd4262733e0a4406a333208c899dc7ea726b03600b9bb94f192", + "url": "https://repo1.maven.org/maven2/com/google/caliper/caliper-core/1.0-beta-3/caliper-core-1.0-beta-3.jar" + }, + { + "coord": "com.google.caliper:caliper-runner:1.0-beta-3", + "dependencies": [ + "com.google.auto.value:auto-value-annotations:1.8.1", + "com.google.caliper:caliper-api:1.0-beta-3", + "com.google.caliper:caliper-core:1.0-beta-3", + "com.google.caliper:caliper-util:1.0-beta-3", + "com.google.code.gson:gson:2.8.9", + "com.google.dagger:dagger-producers:2.22.1", + "com.google.dagger:dagger:2.22.1", + "com.google.guava:guava:31.1-jre", + "com.squareup.okhttp:okhttp:2.7.5", + "com.squareup.okio:okio:1.6.0", + "javax.inject:javax.inject:1", + "joda-time:joda-time:2.10.10", + "org.checkerframework:checker-compat-qual:2.5.3" + ], + "directDependencies": [ + "com.google.caliper:caliper-api:1.0-beta-3", + "com.google.caliper:caliper-core:1.0-beta-3", + "com.google.caliper:caliper-util:1.0-beta-3", + "com.google.dagger:dagger-producers:2.22.1", + "com.google.dagger:dagger:2.22.1", + "com.google.guava:guava:31.1-jre", + "com.squareup.okhttp:okhttp:2.7.5", + "joda-time:joda-time:2.10.10" + ], + "file": "v1/https/repo1.maven.org/maven2/com/google/caliper/caliper-runner/1.0-beta-3/caliper-runner-1.0-beta-3.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/com/google/caliper/caliper-runner/1.0-beta-3/caliper-runner-1.0-beta-3.jar", + "https://repo.maven.apache.org/maven2/com/google/caliper/caliper-runner/1.0-beta-3/caliper-runner-1.0-beta-3.jar" + ], + "sha256": "3ab58890aa01343361adedf859500d280f67813df0cedfcd165b169533b9b1fa", + "url": "https://repo1.maven.org/maven2/com/google/caliper/caliper-runner/1.0-beta-3/caliper-runner-1.0-beta-3.jar" + }, + { + "coord": "com.google.caliper:caliper-util:1.0-beta-3", + "dependencies": [ + "com.google.code.gson:gson:2.8.9", + "com.google.dagger:dagger:2.22.1", + "com.google.guava:guava:31.1-jre", + "javax.inject:javax.inject:1", + "joda-time:joda-time:2.10.10" + ], + "directDependencies": [ + "com.google.code.gson:gson:2.8.9", + "com.google.dagger:dagger:2.22.1", + "com.google.guava:guava:31.1-jre", + "joda-time:joda-time:2.10.10" + ], + "file": "v1/https/repo1.maven.org/maven2/com/google/caliper/caliper-util/1.0-beta-3/caliper-util-1.0-beta-3.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/com/google/caliper/caliper-util/1.0-beta-3/caliper-util-1.0-beta-3.jar", + "https://repo.maven.apache.org/maven2/com/google/caliper/caliper-util/1.0-beta-3/caliper-util-1.0-beta-3.jar" + ], + "sha256": "6e9af500c7020450dfdb5003d09501d512d395f431c54c7ee8f79e712463fe66", + "url": "https://repo1.maven.org/maven2/com/google/caliper/caliper-util/1.0-beta-3/caliper-util-1.0-beta-3.jar" + }, + { + "coord": "com.google.caliper:caliper-worker-jvm:1.0-beta-3", + "dependencies": [ + "com.google.auto.value:auto-value-annotations:1.8.1", + "com.google.caliper:caliper-api:1.0-beta-3", + "com.google.caliper:caliper-core:1.0-beta-3", + "com.google.caliper:caliper-util:1.0-beta-3", + "com.google.caliper:caliper-worker:1.0-beta-3", + "com.google.code.gson:gson:2.8.9", + "com.google.code.java-allocation-instrumenter:java-allocation-instrumenter:3.3.0", + "com.google.dagger:dagger:2.22.1", + "com.google.guava:guava:31.1-jre", + "com.squareup.okhttp:okhttp:2.7.5", + "com.squareup.okio:okio:1.6.0", + "com.sun.jersey:jersey-client:1.19.4", + "com.sun.jersey:jersey-core:1.19.4", + "javax.annotation:javax.annotation-api:1.3.2", + "javax.inject:javax.inject:1", + "javax.ws.rs:jsr311-api:1.1.1", + "joda-time:joda-time:2.10.10", + "org.ow2.asm:asm-analysis:7.2", + "org.ow2.asm:asm-commons:7.2", + "org.ow2.asm:asm-tree:7.2", + "org.ow2.asm:asm-util:7.2", + "org.ow2.asm:asm:9.0" + ], + "directDependencies": [ + "com.google.caliper:caliper-core:1.0-beta-3", + "com.google.caliper:caliper-worker:1.0-beta-3", + "com.google.code.java-allocation-instrumenter:java-allocation-instrumenter:3.3.0", + "com.google.dagger:dagger:2.22.1", + "com.google.guava:guava:31.1-jre", + "com.sun.jersey:jersey-client:1.19.4" + ], + "file": "v1/https/repo1.maven.org/maven2/com/google/caliper/caliper-worker-jvm/1.0-beta-3/caliper-worker-jvm-1.0-beta-3.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/com/google/caliper/caliper-worker-jvm/1.0-beta-3/caliper-worker-jvm-1.0-beta-3.jar", + "https://repo.maven.apache.org/maven2/com/google/caliper/caliper-worker-jvm/1.0-beta-3/caliper-worker-jvm-1.0-beta-3.jar" + ], + "sha256": "e14e1ecfdf939c82abdb902105be41ff3f83c18cb968116232015f2662d065a4", + "url": "https://repo1.maven.org/maven2/com/google/caliper/caliper-worker-jvm/1.0-beta-3/caliper-worker-jvm-1.0-beta-3.jar" + }, + { + "coord": "com.google.caliper:caliper-worker:1.0-beta-3", + "dependencies": [ + "com.google.auto.value:auto-value-annotations:1.8.1", + "com.google.caliper:caliper-api:1.0-beta-3", + "com.google.caliper:caliper-core:1.0-beta-3", + "com.google.caliper:caliper-util:1.0-beta-3", + "com.google.code.gson:gson:2.8.9", + "com.google.dagger:dagger:2.22.1", + "com.google.guava:guava:31.1-jre", + "com.squareup.okhttp:okhttp:2.7.5", + "com.squareup.okio:okio:1.6.0", + "javax.inject:javax.inject:1", + "joda-time:joda-time:2.10.10" + ], + "directDependencies": [ + "com.google.caliper:caliper-api:1.0-beta-3", + "com.google.caliper:caliper-core:1.0-beta-3", + "com.google.caliper:caliper-util:1.0-beta-3", + "com.google.dagger:dagger:2.22.1", + "com.google.guava:guava:31.1-jre", + "com.squareup.okhttp:okhttp:2.7.5", + "joda-time:joda-time:2.10.10" + ], + "file": "v1/https/repo1.maven.org/maven2/com/google/caliper/caliper-worker/1.0-beta-3/caliper-worker-1.0-beta-3.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/com/google/caliper/caliper-worker/1.0-beta-3/caliper-worker-1.0-beta-3.jar", + "https://repo.maven.apache.org/maven2/com/google/caliper/caliper-worker/1.0-beta-3/caliper-worker-1.0-beta-3.jar" + ], + "sha256": "315d8e51df1f60551645a0e3bf2c504d2c79762f688e6f728eb9d1d9cd9a491b", + "url": "https://repo1.maven.org/maven2/com/google/caliper/caliper-worker/1.0-beta-3/caliper-worker-1.0-beta-3.jar" + }, + { + "coord": "com.google.caliper:caliper:1.0-beta-3", + "dependencies": [ + "com.google.auto.value:auto-value-annotations:1.8.1", + "com.google.caliper:caliper-api:1.0-beta-3", + "com.google.caliper:caliper-core:1.0-beta-3", + "com.google.caliper:caliper-runner:1.0-beta-3", + "com.google.caliper:caliper-util:1.0-beta-3", + "com.google.caliper:caliper-worker-jvm:1.0-beta-3", + "com.google.caliper:caliper-worker:1.0-beta-3", + "com.google.code.gson:gson:2.8.9", + "com.google.code.java-allocation-instrumenter:java-allocation-instrumenter:3.3.0", + "com.google.dagger:dagger-producers:2.22.1", + "com.google.dagger:dagger:2.22.1", + "com.google.guava:guava:31.1-jre", + "com.squareup.okhttp:okhttp:2.7.5", + "com.squareup.okio:okio:1.6.0", + "com.sun.jersey:jersey-client:1.19.4", + "com.sun.jersey:jersey-core:1.19.4", + "javax.annotation:javax.annotation-api:1.3.2", + "javax.inject:javax.inject:1", + "javax.ws.rs:jsr311-api:1.1.1", + "joda-time:joda-time:2.10.10", + "org.checkerframework:checker-compat-qual:2.5.3", + "org.ow2.asm:asm-analysis:7.2", + "org.ow2.asm:asm-commons:7.2", + "org.ow2.asm:asm-tree:7.2", + "org.ow2.asm:asm-util:7.2", + "org.ow2.asm:asm:9.0" + ], + "directDependencies": [ + "com.google.caliper:caliper-core:1.0-beta-3", + "com.google.caliper:caliper-runner:1.0-beta-3", + "com.google.caliper:caliper-worker-jvm:1.0-beta-3", + "com.google.code.java-allocation-instrumenter:java-allocation-instrumenter:3.3.0", + "com.google.dagger:dagger:2.22.1", + "com.google.guava:guava:31.1-jre", + "com.sun.jersey:jersey-client:1.19.4" + ], + "file": "v1/https/repo1.maven.org/maven2/com/google/caliper/caliper/1.0-beta-3/caliper-1.0-beta-3.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/com/google/caliper/caliper/1.0-beta-3/caliper-1.0-beta-3.jar", + "https://repo.maven.apache.org/maven2/com/google/caliper/caliper/1.0-beta-3/caliper-1.0-beta-3.jar" + ], + "sha256": "d54e1bfdbe9359a79e175c217b8d472555cf20da9c5c0a18bdb1ea7db979ed8e", + "url": "https://repo1.maven.org/maven2/com/google/caliper/caliper/1.0-beta-3/caliper-1.0-beta-3.jar" }, { "coord": "com.google.code.findbugs:jsr305:3.0.2", @@ -44,6 +271,72 @@ "sha256": "d3999291855de495c94c743761b8ab5176cfeabe281a5ab0d8e8d45326fd703e", "url": "https://repo1.maven.org/maven2/com/google/code/gson/gson/2.8.9/gson-2.8.9.jar" }, + { + "coord": "com.google.code.java-allocation-instrumenter:java-allocation-instrumenter:3.3.0", + "dependencies": [ + "com.google.guava:guava:31.1-jre", + "javax.annotation:javax.annotation-api:1.3.2", + "org.ow2.asm:asm-analysis:7.2", + "org.ow2.asm:asm-commons:7.2", + "org.ow2.asm:asm-tree:7.2", + "org.ow2.asm:asm-util:7.2", + "org.ow2.asm:asm:9.0" + ], + "directDependencies": [ + "com.google.guava:guava:31.1-jre", + "javax.annotation:javax.annotation-api:1.3.2", + "org.ow2.asm:asm-analysis:7.2", + "org.ow2.asm:asm-commons:7.2", + "org.ow2.asm:asm-tree:7.2", + "org.ow2.asm:asm-util:7.2", + "org.ow2.asm:asm:9.0" + ], + "file": "v1/https/repo1.maven.org/maven2/com/google/code/java-allocation-instrumenter/java-allocation-instrumenter/3.3.0/java-allocation-instrumenter-3.3.0.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/com/google/code/java-allocation-instrumenter/java-allocation-instrumenter/3.3.0/java-allocation-instrumenter-3.3.0.jar", + "https://repo.maven.apache.org/maven2/com/google/code/java-allocation-instrumenter/java-allocation-instrumenter/3.3.0/java-allocation-instrumenter-3.3.0.jar" + ], + "sha256": "1ef5535a8bd41cf3072469f381b9ee6ab28275311a7499f53d6e52adf976fef0", + "url": "https://repo1.maven.org/maven2/com/google/code/java-allocation-instrumenter/java-allocation-instrumenter/3.3.0/java-allocation-instrumenter-3.3.0.jar" + }, + { + "coord": "com.google.dagger:dagger-producers:2.22.1", + "dependencies": [ + "com.google.dagger:dagger:2.22.1", + "com.google.guava:guava:31.1-jre", + "javax.inject:javax.inject:1", + "org.checkerframework:checker-compat-qual:2.5.3" + ], + "directDependencies": [ + "com.google.dagger:dagger:2.22.1", + "com.google.guava:guava:31.1-jre", + "javax.inject:javax.inject:1", + "org.checkerframework:checker-compat-qual:2.5.3" + ], + "file": "v1/https/repo1.maven.org/maven2/com/google/dagger/dagger-producers/2.22.1/dagger-producers-2.22.1.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/com/google/dagger/dagger-producers/2.22.1/dagger-producers-2.22.1.jar", + "https://repo.maven.apache.org/maven2/com/google/dagger/dagger-producers/2.22.1/dagger-producers-2.22.1.jar" + ], + "sha256": "f834a0082014213a68ff06a0f048d750178d02196c58b0b15beb367d32b97e35", + "url": "https://repo1.maven.org/maven2/com/google/dagger/dagger-producers/2.22.1/dagger-producers-2.22.1.jar" + }, + { + "coord": "com.google.dagger:dagger:2.22.1", + "dependencies": [ + "javax.inject:javax.inject:1" + ], + "directDependencies": [ + "javax.inject:javax.inject:1" + ], + "file": "v1/https/repo1.maven.org/maven2/com/google/dagger/dagger/2.22.1/dagger-2.22.1.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/com/google/dagger/dagger/2.22.1/dagger-2.22.1.jar", + "https://repo.maven.apache.org/maven2/com/google/dagger/dagger/2.22.1/dagger-2.22.1.jar" + ], + "sha256": "329d4340f24c4f5717af016c097e90668bfea2a5376e6aa9964b01cef3fd241a", + "url": "https://repo1.maven.org/maven2/com/google/dagger/dagger/2.22.1/dagger-2.22.1.jar" + }, { "coord": "com.google.errorprone:error_prone_annotations:2.11.0", "dependencies": [], @@ -150,7 +443,7 @@ { "coord": "com.google.truth:truth:1.1.2", "dependencies": [ - "com.google.auto.value:auto-value-annotations:1.7.4", + "com.google.auto.value:auto-value-annotations:1.8.1", "com.google.errorprone:error_prone_annotations:2.11.0", "com.google.guava:guava:31.1-jre", "junit:junit:4.13.2", @@ -158,7 +451,7 @@ "org.ow2.asm:asm:9.0" ], "directDependencies": [ - "com.google.auto.value:auto-value-annotations:1.7.4", + "com.google.auto.value:auto-value-annotations:1.8.1", "com.google.errorprone:error_prone_annotations:2.11.0", "com.google.guava:guava:31.1-jre", "junit:junit:4.13.2", @@ -173,6 +466,115 @@ "sha256": "a85e03b8b6ae8780f060cfded9500a3d1b5f52808f99a2ea6da9c683313c7518", "url": "https://repo1.maven.org/maven2/com/google/truth/truth/1.1.2/truth-1.1.2.jar" }, + { + "coord": "com.squareup.okhttp:okhttp:2.7.5", + "dependencies": [ + "com.squareup.okio:okio:1.6.0" + ], + "directDependencies": [ + "com.squareup.okio:okio:1.6.0" + ], + "file": "v1/https/repo1.maven.org/maven2/com/squareup/okhttp/okhttp/2.7.5/okhttp-2.7.5.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/com/squareup/okhttp/okhttp/2.7.5/okhttp-2.7.5.jar", + "https://repo.maven.apache.org/maven2/com/squareup/okhttp/okhttp/2.7.5/okhttp-2.7.5.jar" + ], + "sha256": "88ac9fd1bb51f82bcc664cc1eb9c225c90dc4389d660231b4cc737bebfe7d0aa", + "url": "https://repo1.maven.org/maven2/com/squareup/okhttp/okhttp/2.7.5/okhttp-2.7.5.jar" + }, + { + "coord": "com.squareup.okio:okio:1.6.0", + "dependencies": [], + "directDependencies": [], + "file": "v1/https/repo1.maven.org/maven2/com/squareup/okio/okio/1.6.0/okio-1.6.0.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/com/squareup/okio/okio/1.6.0/okio-1.6.0.jar", + "https://repo.maven.apache.org/maven2/com/squareup/okio/okio/1.6.0/okio-1.6.0.jar" + ], + "sha256": "114bdc1f47338a68bcbc95abf2f5cdc72beeec91812f2fcd7b521c1937876266", + "url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/1.6.0/okio-1.6.0.jar" + }, + { + "coord": "com.sun.jersey:jersey-client:1.19.4", + "dependencies": [ + "com.sun.jersey:jersey-core:1.19.4", + "javax.ws.rs:jsr311-api:1.1.1" + ], + "directDependencies": [ + "com.sun.jersey:jersey-core:1.19.4" + ], + "file": "v1/https/repo1.maven.org/maven2/com/sun/jersey/jersey-client/1.19.4/jersey-client-1.19.4.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/com/sun/jersey/jersey-client/1.19.4/jersey-client-1.19.4.jar", + "https://repo.maven.apache.org/maven2/com/sun/jersey/jersey-client/1.19.4/jersey-client-1.19.4.jar" + ], + "sha256": "639c825c5db580f8115bf49ffc893093526d2ed1079fbc929b6a5fbd0b2eda40", + "url": "https://repo1.maven.org/maven2/com/sun/jersey/jersey-client/1.19.4/jersey-client-1.19.4.jar" + }, + { + "coord": "com.sun.jersey:jersey-core:1.19.4", + "dependencies": [ + "javax.ws.rs:jsr311-api:1.1.1" + ], + "directDependencies": [ + "javax.ws.rs:jsr311-api:1.1.1" + ], + "file": "v1/https/repo1.maven.org/maven2/com/sun/jersey/jersey-core/1.19.4/jersey-core-1.19.4.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/com/sun/jersey/jersey-core/1.19.4/jersey-core-1.19.4.jar", + "https://repo.maven.apache.org/maven2/com/sun/jersey/jersey-core/1.19.4/jersey-core-1.19.4.jar" + ], + "sha256": "64b03198e0264849d0fc341857ebcc9c882b1909a2dc35a0972fe7d901b826e5", + "url": "https://repo1.maven.org/maven2/com/sun/jersey/jersey-core/1.19.4/jersey-core-1.19.4.jar" + }, + { + "coord": "javax.annotation:javax.annotation-api:1.3.2", + "dependencies": [], + "directDependencies": [], + "file": "v1/https/repo1.maven.org/maven2/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar", + "https://repo.maven.apache.org/maven2/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar" + ], + "sha256": "e04ba5195bcd555dc95650f7cc614d151e4bcd52d29a10b8aa2197f3ab89ab9b", + "url": "https://repo1.maven.org/maven2/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar" + }, + { + "coord": "javax.inject:javax.inject:1", + "dependencies": [], + "directDependencies": [], + "file": "v1/https/repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar", + "https://repo.maven.apache.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar" + ], + "sha256": "91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff", + "url": "https://repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar" + }, + { + "coord": "javax.ws.rs:jsr311-api:1.1.1", + "dependencies": [], + "directDependencies": [], + "file": "v1/https/repo1.maven.org/maven2/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar", + "https://repo.maven.apache.org/maven2/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar" + ], + "sha256": "ab1534b73b5fa055808e6598a5e73b599ccda28c3159c3c0908977809422ee4a", + "url": "https://repo1.maven.org/maven2/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar" + }, + { + "coord": "joda-time:joda-time:2.10.10", + "dependencies": [], + "directDependencies": [], + "file": "v1/https/repo1.maven.org/maven2/joda-time/joda-time/2.10.10/joda-time-2.10.10.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/joda-time/joda-time/2.10.10/joda-time-2.10.10.jar", + "https://repo.maven.apache.org/maven2/joda-time/joda-time/2.10.10/joda-time-2.10.10.jar" + ], + "sha256": "dd8e7c92185a678d1b7b933f31209b6203c8ffa91e9880475a1be0346b9617e3", + "url": "https://repo1.maven.org/maven2/joda-time/joda-time/2.10.10/joda-time-2.10.10.jar" + }, { "coord": "junit:junit:4.13.2", "dependencies": [ @@ -213,6 +615,18 @@ "sha256": "d2e46555699e70361b5471a7e142f9c67855bba6907a285177ebd8ad973775d8", "url": "https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy/1.12.7/byte-buddy-1.12.7.jar" }, + { + "coord": "org.checkerframework:checker-compat-qual:2.5.3", + "dependencies": [], + "directDependencies": [], + "file": "v1/https/repo1.maven.org/maven2/org/checkerframework/checker-compat-qual/2.5.3/checker-compat-qual-2.5.3.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/org/checkerframework/checker-compat-qual/2.5.3/checker-compat-qual-2.5.3.jar", + "https://repo.maven.apache.org/maven2/org/checkerframework/checker-compat-qual/2.5.3/checker-compat-qual-2.5.3.jar" + ], + "sha256": "d76b9afea61c7c082908023f0cbc1427fab9abd2df915c8b8a3e7a509bccbc6d", + "url": "https://repo1.maven.org/maven2/org/checkerframework/checker-compat-qual/2.5.3/checker-compat-qual-2.5.3.jar" + }, { "coord": "org.checkerframework:checker-qual:3.12.0", "dependencies": [], @@ -269,6 +683,79 @@ "sha256": "03d960bd5aef03c653eb000413ada15eb77cdd2b8e4448886edf5692805e35f3", "url": "https://repo1.maven.org/maven2/org/objenesis/objenesis/3.2/objenesis-3.2.jar" }, + { + "coord": "org.ow2.asm:asm-analysis:7.2", + "dependencies": [ + "org.ow2.asm:asm-tree:7.2", + "org.ow2.asm:asm:9.0" + ], + "directDependencies": [ + "org.ow2.asm:asm-tree:7.2" + ], + "file": "v1/https/repo1.maven.org/maven2/org/ow2/asm/asm-analysis/7.2/asm-analysis-7.2.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/org/ow2/asm/asm-analysis/7.2/asm-analysis-7.2.jar", + "https://repo.maven.apache.org/maven2/org/ow2/asm/asm-analysis/7.2/asm-analysis-7.2.jar" + ], + "sha256": "be922aae60ff1ff1768e8e6544a38a7f92bd0a6d6b0b9791f94955d1bd453de2", + "url": "https://repo1.maven.org/maven2/org/ow2/asm/asm-analysis/7.2/asm-analysis-7.2.jar" + }, + { + "coord": "org.ow2.asm:asm-commons:7.2", + "dependencies": [ + "org.ow2.asm:asm-analysis:7.2", + "org.ow2.asm:asm-tree:7.2", + "org.ow2.asm:asm:9.0" + ], + "directDependencies": [ + "org.ow2.asm:asm-analysis:7.2", + "org.ow2.asm:asm-tree:7.2", + "org.ow2.asm:asm:9.0" + ], + "file": "v1/https/repo1.maven.org/maven2/org/ow2/asm/asm-commons/7.2/asm-commons-7.2.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/org/ow2/asm/asm-commons/7.2/asm-commons-7.2.jar", + "https://repo.maven.apache.org/maven2/org/ow2/asm/asm-commons/7.2/asm-commons-7.2.jar" + ], + "sha256": "0e86b8b179c5fb223d1a880a0ff4960b6978223984b94e62e71135f2d8ea3558", + "url": "https://repo1.maven.org/maven2/org/ow2/asm/asm-commons/7.2/asm-commons-7.2.jar" + }, + { + "coord": "org.ow2.asm:asm-tree:7.2", + "dependencies": [ + "org.ow2.asm:asm:9.0" + ], + "directDependencies": [ + "org.ow2.asm:asm:9.0" + ], + "file": "v1/https/repo1.maven.org/maven2/org/ow2/asm/asm-tree/7.2/asm-tree-7.2.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/7.2/asm-tree-7.2.jar", + "https://repo.maven.apache.org/maven2/org/ow2/asm/asm-tree/7.2/asm-tree-7.2.jar" + ], + "sha256": "c063f5a67fa03cdc9bd79fd1c2ea6816cc4a19473ecdfbd9e9153b408c6f2656", + "url": "https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/7.2/asm-tree-7.2.jar" + }, + { + "coord": "org.ow2.asm:asm-util:7.2", + "dependencies": [ + "org.ow2.asm:asm-analysis:7.2", + "org.ow2.asm:asm-tree:7.2", + "org.ow2.asm:asm:9.0" + ], + "directDependencies": [ + "org.ow2.asm:asm-analysis:7.2", + "org.ow2.asm:asm-tree:7.2", + "org.ow2.asm:asm:9.0" + ], + "file": "v1/https/repo1.maven.org/maven2/org/ow2/asm/asm-util/7.2/asm-util-7.2.jar", + "mirror_urls": [ + "https://repo1.maven.org/maven2/org/ow2/asm/asm-util/7.2/asm-util-7.2.jar", + "https://repo.maven.apache.org/maven2/org/ow2/asm/asm-util/7.2/asm-util-7.2.jar" + ], + "sha256": "6e24913b021ffacfe8e7e053d6e0ccc731941148cfa078d4f1ed3d96904530f8", + "url": "https://repo1.maven.org/maven2/org/ow2/asm/asm-util/7.2/asm-util-7.2.jar" + }, { "coord": "org.ow2.asm:asm:9.0", "dependencies": [], diff --git a/objectivec/BUILD.bazel b/objectivec/BUILD.bazel index c18788f40d..153894ff60 100644 --- a/objectivec/BUILD.bazel +++ b/objectivec/BUILD.bazel @@ -1,5 +1,6 @@ load("@rules_cc//cc:defs.bzl", "objc_library") load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") +load("//conformance:defs.bzl", "conformance_test") objc_library( name = "objectivec", @@ -90,6 +91,20 @@ objc_library( visibility = ["//visibility:public"], ) +################################################################################ +# Tests +################################################################################ + +conformance_test( + name = "conformance_test", + failure_list = "//conformance:failure_list_objc.txt", + testee = "//conformance:conformance_objc", +) + +################################################################################ +# Distribution files +################################################################################ + pkg_files( name = "dist_files", srcs = glob([ diff --git a/objectivec/DevTools/compile_testing_protos.sh b/objectivec/DevTools/compile_testing_protos.sh index 69c32f920b..eb43cae048 100755 --- a/objectivec/DevTools/compile_testing_protos.sh +++ b/objectivec/DevTools/compile_testing_protos.sh @@ -89,7 +89,8 @@ mkdir -p "${OUTPUT_DIR}/google/protobuf" # Move to the top of the protobuf directories and ensure there is a protoc # binary to use. cd "${SRCROOT}/.." -[[ -x src/protoc ]] || \ +readonly PROTOC="bazel-bin/protoc" +[[ -x $PROTOC ]] || \ die "Could not find the protoc binary; make sure you have built it (objectivec/DevTools/full_mac_build.sh -h)." # ----------------------------------------------------------------------------- @@ -120,7 +121,7 @@ if [[ "${RUN_PROTOC}" != "yes" ]] ; then readonly NewestInput=$(find \ src/google/protobuf/*.proto \ objectivec/Tests/*.proto \ - src/.libs src/*.la src/protoc \ + src/.libs src/*.la $PROTOC \ objectivec/DevTools/compile_testing_protos.sh \ -type f -print0 \ | xargs -0 stat -f "%m %N" \ @@ -152,7 +153,7 @@ find "${OUTPUT_DIR}" \ # ----------------------------------------------------------------------------- # Helper to invoke protoc compile_protos() { - src/protoc \ + $PROTOC \ --objc_out="${OUTPUT_DIR}/google/protobuf" \ --proto_path=src/google/protobuf/ \ --proto_path=src \ diff --git a/objectivec/DevTools/full_mac_build.sh b/objectivec/DevTools/full_mac_build.sh index 0e183f20ca..0af0e40e77 100755 --- a/objectivec/DevTools/full_mac_build.sh +++ b/objectivec/DevTools/full_mac_build.sh @@ -8,6 +8,7 @@ set -eu # Some base locations. readonly ScriptDir=$(dirname "$(echo $0 | sed -e "s,^\([^/]\),$(pwd)/\1,")") readonly ProtoRootDir="${ScriptDir}/../.." +readonly BazelFlags="-k --test_output=streamed --macos_minimum_os=10.9" printUsage() { NAME=$(basename "${0}") @@ -24,8 +25,6 @@ OPTIONS: Show this message -c, --clean Issue a clean before the normal build. - -a, --autogen - Start by rerunning autogen & configure. -r, --regenerate-descriptors Run generate_descriptor_proto.sh to regenerate all the checked in proto sources. @@ -60,25 +59,7 @@ header() { echo "========================================================================" } -# Thanks to libtool, builds can fail in odd ways and since it eats some output -# it can be hard to spot, so force error output if make exits with a non zero. -wrapped_make() { - set +e # Don't stop if the command fails. - make $* - MAKE_EXIT_STATUS=$? - if [ ${MAKE_EXIT_STATUS} -ne 0 ]; then - echo "Error: 'make $*' exited with status ${MAKE_EXIT_STATUS}" - exit ${MAKE_EXIT_STATUS} - fi - set -e -} - -NUM_MAKE_JOBS=$(/usr/sbin/sysctl -n hw.ncpu) -if [[ "${NUM_MAKE_JOBS}" -lt 2 ]] ; then - NUM_MAKE_JOBS=2 -fi - -DO_AUTOGEN=no +NUM_JOBS=auto DO_CLEAN=no REGEN_DESCRIPTORS=no CORE_ONLY=no @@ -98,15 +79,12 @@ while [[ $# != 0 ]]; do -c | --clean ) DO_CLEAN=yes ;; - -a | --autogen ) - DO_AUTOGEN=yes - ;; -r | --regenerate-descriptors ) REGEN_DESCRIPTORS=yes ;; -j | --jobs ) shift - NUM_MAKE_JOBS="${1}" + NUM_JOBS="${1}" ;; --core-only ) CORE_ONLY=yes @@ -154,21 +132,9 @@ done # Into the proto dir. cd "${ProtoRootDir}" -# if no Makefile, force the autogen. -if [[ ! -f Makefile ]] ; then - DO_AUTOGEN=yes -fi - -if [[ "${DO_AUTOGEN}" == "yes" ]] ; then - header "Running autogen & configure" - ./autogen.sh - ./configure \ - CPPFLAGS="-mmacosx-version-min=10.9 -Wunused-const-variable -Wunused-function" -fi - if [[ "${DO_CLEAN}" == "yes" ]] ; then header "Cleaning" - wrapped_make clean + bazel clean if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then XCODEBUILD_CLEAN_BASE_IOS=( xcodebuild @@ -212,26 +178,23 @@ fi if [[ "${REGEN_DESCRIPTORS}" == "yes" ]] ; then header "Regenerating the descriptor sources." - ./generate_descriptor_proto.sh -j "${NUM_MAKE_JOBS}" + ./generate_descriptor_proto.sh -j "${NUM_JOBS}" fi if [[ "${CORE_ONLY}" == "yes" ]] ; then header "Building core Only" - wrapped_make -j "${NUM_MAKE_JOBS}" + bazel build //:protoc //:protobuf //:protobuf_lite -j "${NUM_JOBS}" $BazelFlags else header "Building" # Can't issue these together, when fully parallel, something sometimes chokes # at random. - wrapped_make -j "${NUM_MAKE_JOBS}" all - wrapped_make -j "${NUM_MAKE_JOBS}" check + bazel test //src/... $BazelFlags # Fire off the conformance tests also. - cd conformance - wrapped_make -j "${NUM_MAKE_JOBS}" test_cpp - cd .. + bazel test //objectivec:conformance_test $BazelFlags fi # Ensure the WKT sources checked in are current. -objectivec/generate_well_known_types.sh --check-only -j "${NUM_MAKE_JOBS}" +objectivec/generate_well_known_types.sh --check-only -j "${NUM_JOBS}" header "Checking on the ObjC Runtime Code" # Some of the kokoro machines don't have python3 yet, so fall back to python if need be. @@ -295,7 +258,7 @@ if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then -disable-concurrent-destination-testing ) ;; - 11.* | 12.* | 13.*) + 11.* | 12.* | 13.* | 14.*) # Dropped 32bit as Apple doesn't seem support the simulators either. XCODEBUILD_TEST_BASE_IOS+=( -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" # 64bit @@ -391,9 +354,7 @@ fi if [[ "${DO_OBJC_CONFORMANCE_TESTS}" == "yes" ]] ; then header "Running ObjC Conformance Tests" - cd conformance - wrapped_make -j "${NUM_MAKE_JOBS}" test_objc - cd .. + bazel test //objectivec:conformance_test $BazelFlags fi echo "" diff --git a/objectivec/README.md b/objectivec/README.md index f2c2a846a7..25e6b23463 100644 --- a/objectivec/README.md +++ b/objectivec/README.md @@ -25,7 +25,7 @@ to build the compiler and run the runtime tests, you can use: $ objectivec/DevTools/full_mac_build.sh -This will generate the `src/protoc` binary. +This will generate the `protoc` binary. Building -------- diff --git a/objectivec/generate_well_known_types.sh b/objectivec/generate_well_known_types.sh index e6c9b044d1..10b2a10be8 100755 --- a/objectivec/generate_well_known_types.sh +++ b/objectivec/generate_well_known_types.sh @@ -4,7 +4,7 @@ # the protocol compiler changes. # HINT: Flags passed to generate_well_known_types.sh will be passed directly -# to make when building protoc. This is particularly useful for passing +# to bazel when building protoc. This is particularly useful for passing # -j4 to run 4 jobs simultaneously. set -eu @@ -30,18 +30,10 @@ __EOF__ exit 1 fi -if [[ ! -e src/Makefile ]]; then - cat >&2 << __EOF__ -Could not find src/Makefile. You must run ./configure (and perhaps -./autogen.sh) first. -__EOF__ - exit 1 -fi - # Make sure the compiler is current. -cd src -make $@ protoc +bazel build $@ //:protoc +cd src declare -a RUNTIME_PROTO_FILES=( \ google/protobuf/any.proto \ google/protobuf/api.proto \ @@ -59,7 +51,7 @@ declare -a OBJC_EXTENSIONS=( .pbobjc.h .pbobjc.m ) # Generate to a temp directory to see if they match. TMP_DIR=$(mktemp -d) trap "rm -rf ${TMP_DIR}" EXIT -./protoc --objc_out="${TMP_DIR}" ${RUNTIME_PROTO_FILES[@]} +${ProtoRootDir}/bazel-bin/protoc --objc_out="${TMP_DIR}" ${RUNTIME_PROTO_FILES[@]} DID_COPY=0 for PROTO_FILE in "${RUNTIME_PROTO_FILES[@]}"; do diff --git a/php/BUILD.bazel b/php/BUILD.bazel index dfb0976fca..28b085af0a 100644 --- a/php/BUILD.bazel +++ b/php/BUILD.bazel @@ -3,19 +3,103 @@ # See also code generation logic under /src/google/protobuf/compiler/php. load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") +load("//build_defs:internal_shell.bzl", "inline_sh_binary") +load("//conformance:defs.bzl", "conformance_test") + +filegroup( + name = "source_files", + visibility = [ + "//benchmarks/php:__pkg__", + "//conformance:__pkg__", + "//php:__pkg__", + ], + srcs = glob([ + "ext/google/protobuf/*.h", + "ext/google/protobuf/*.c", + "src/GPBMetadata/Google/Protobuf/**/*.php", + "src/Google/Protobuf/**/*.php", + ]) + [ + "composer.json", + "ext/google/protobuf/wkt.inc", + "ext/google/protobuf/config.m4", + "ext/google/protobuf/package.xml", + ], +) + +################################################################################ +# PHP Extension +################################################################################ + +inline_sh_binary( + name = "build_extension", + cmd = """ + mkdir -p php/ext/google/protobuf/third_party/utf8_range + cp third_party/utf8_range/* php/ext/google/protobuf/third_party/utf8_range + + pushd php/ext/google/protobuf + phpize + ./configure --with-php-config=$$(which php-config) + make + popd + """, +) + +genrule( + name = "extension", + srcs = [ + ":source_files", + "//third_party/utf8_range:all_files", + ], + tools = [":build_extension"], + outs = ["protobuf.so"], + cmd = """ + ./$(execpath :build_extension) $@ + cp php/ext/google/protobuf/modules/protobuf.so $(OUTS) + """, + visibility = ["//visibility:public"], +) + +################################################################################ +# Tests +################################################################################ + +conformance_test( + name = "conformance_test", + failure_list = "//conformance:failure_list_php.txt", + testee = "//conformance:conformance_php", + text_format_failure_list = "//conformance:text_format_failure_list_php.txt", + target_compatible_with = select({ + "@platforms//os:osx": ["@platforms//:incompatible"], + "//conditions:default": [], + }), +) + +conformance_test( + name = "conformance_test_c", + failure_list = "//conformance:failure_list_php_c.txt", + testee = "//conformance:conformance_php_c", + text_format_failure_list = "//conformance:text_format_failure_list_php.txt", + target_compatible_with = select({ + "@platforms//os:osx": [], + "//conditions:default": ["@platforms//:incompatible"], + }), +) + +################################################################################ +# Distribution files +################################################################################ pkg_files( name = "dist_files", srcs = glob([ "ext/google/protobuf/**/*", - "src/GPBMetadata/Google/Protobuf/**/*.php", - "src/Google/Protobuf/**/*.php", "tests/*.php", "tests/*.sh", "tests/generated_previous/**/*.php", "tests/proto/**/*.proto", "tests/proto_previous/*.proto", ]) + [ + ":source_files", "BUILD.bazel", "README.md", "REFCOUNTING.md", diff --git a/php/README.md b/php/README.md index c4292cf778..775fbc8fc0 100644 --- a/php/README.md +++ b/php/README.md @@ -26,8 +26,6 @@ To use PHP runtime library requires: #### Prerequirements To install the c extension, the following tools are needed: -* autoconf -* automake * libtool * make * gcc @@ -36,7 +34,7 @@ To install the c extension, the following tools are needed: On Ubuntu, you can install them with: ``` -sudo apt-get install -y php-pear php5-dev autoconf automake libtool make gcc +sudo apt-get install -y php-pear php-dev libtool make gcc ``` On other platforms, please use the corresponding package managing tool to install them before proceeding. @@ -98,24 +96,18 @@ Known Issues ## Development -### Docker Image - -We provide a docker image for php development, which is also used in our automatic tests: -``` -docker run --security-opt seccomp=unconfined -it protobuftesting/php_8dbe419c6df1a8b3af0ae3a267c112efb436b45c -``` - ### Test Native PHP ``` +# Install Dependencies (Linux) +apt-get install bazel composer php-dev + # Download protobuf git clone https://github.com/protocolbuffers/protobuf.git cd protobuf # Build protoc -./autogen.sh -./configure -make -j4 +bazel build :protoc # Test native php cd php diff --git a/php/generate_descriptor_protos.sh b/php/generate_descriptor_protos.sh index 9feaa96c8b..2239312ab5 100755 --- a/php/generate_descriptor_protos.sh +++ b/php/generate_descriptor_protos.sh @@ -5,6 +5,12 @@ set -e +PROTOC=protoc +if [ ! -f $PROTOC ]; then + bazel build -c opt //:protoc + PROTOC=bazel-bin/protoc +fi + if test ! -e src/google/protobuf/stubs/common.h; then cat >&2 << __EOF__ Could not find source code. Make sure you are running this script from the @@ -13,17 +19,16 @@ __EOF__ exit 1 fi -pushd src -./protoc --php_out=internal:../php/src google/protobuf/descriptor.proto -./protoc --php_out=internal_generate_c_wkt:../php/src \ - google/protobuf/any.proto \ - google/protobuf/api.proto \ - google/protobuf/duration.proto \ - google/protobuf/empty.proto \ - google/protobuf/field_mask.proto \ - google/protobuf/source_context.proto \ - google/protobuf/struct.proto \ - google/protobuf/type.proto \ - google/protobuf/timestamp.proto \ - google/protobuf/wrappers.proto +$PROTOC --php_out=internal:php/src google/protobuf/descriptor.proto +$PROTOC --php_out=internal_generate_c_wkt:php/src \ + src/google/protobuf/any.proto \ + src/google/protobuf/api.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/type.proto \ + src/google/protobuf/timestamp.proto \ + src/google/protobuf/wrappers.proto popd diff --git a/php/generate_test_protos.sh b/php/generate_test_protos.sh index 8607499c8e..565c7ec1cd 100755 --- a/php/generate_test_protos.sh +++ b/php/generate_test_protos.sh @@ -2,19 +2,15 @@ set -ex -cd `dirname $0` +cd `dirname $0`/.. -if ../src/protoc --help > /dev/null; then - PROTOC=src/protoc -else - # Bazel seems to be creating a problematic symlink in - # _build/out/external/com_google_protobuf, so we remove the _build directory - # before building protoc. - (cd .. && bazel build -c opt :protoc) - PROTOC=bazel-bin/protoc +PROTOC=$(pwd)/protoc +if [ ! -f $PROTOC ]; then + bazel build -c opt //:protoc + PROTOC=$(pwd)/bazel-bin/protoc fi -if [[ -d tmp && -z $(find tests/proto ../$PROTOC -newer tmp) ]]; then +if [[ -d php/tmp && -z $(find php/tests/proto $PROTOC -newer php/tmp) ]]; then # Generated protos are already present and up to date, so we can skip protoc. # # Protoc is very fast, but sometimes it is not available (like if we haven't @@ -23,10 +19,9 @@ if [[ -d tmp && -z $(find tests/proto ../$PROTOC -newer tmp) ]]; then exit 0 fi -rm -rf tmp -mkdir -p tmp +rm -rf php/tmp +mkdir -p php/tmp -cd .. find php/tests/proto -type f -name "*.proto"| xargs $PROTOC --php_out=php/tmp -Isrc -Iphp/tests if [ "$1" = "--aggregate_metadata" ]; then diff --git a/php/tests/compatibility_test.sh b/php/tests/compatibility_test.sh deleted file mode 100755 index 7e44cce06b..0000000000 --- a/php/tests/compatibility_test.sh +++ /dev/null @@ -1,152 +0,0 @@ -#!/bin/bash - -function generate_proto() { - PROTOC1=$1 - PROTOC2=$2 - - rm -rf generated - mkdir generated - - $PROTOC1 --php_out=generated proto/test_include.proto - $PROTOC2 --php_out=generated \ - -I../../src -I. \ - proto/empty/echo.proto \ - proto/test.proto \ - proto/test_no_namespace.proto \ - proto/test_prefix.proto \ - proto/test_php_namespace.proto \ - proto/test_empty_php_namespace.proto \ - proto/test_reserved_enum_lower.proto \ - proto/test_reserved_enum_upper.proto \ - proto/test_reserved_enum_value_lower.proto \ - proto/test_reserved_enum_value_upper.proto \ - proto/test_reserved_message_lower.proto \ - proto/test_reserved_message_upper.proto \ - proto/test_service.proto \ - proto/test_service_namespace.proto \ - proto/test_wrapper_type_setters.proto \ - proto/test_descriptors.proto - - pushd ../../src - $PROTOC2 --php_out=../php/tests/generated -I../php/tests -I. ../php/tests/proto/test_import_descriptor_proto.proto - popd -} - -# Remove tests to expect error. These were added to API tests by mistake. -function remove_error_test() { - local TEMPFILE=`tempfile` - cat $1 | \ - awk -v file=`basename $1` -v dir=`basename $(dirname $1)` ' - BEGIN { - show = 1 - } - /@expectedException PHPUnit_Framework_Error/ { show = 0; next; } - / *\*\// { print; next; } - / *}/ { - if (!show) { - show = 1; - next; - } - } - show { print } - ' > $TEMPFILE - cp $TEMPFILE $1 -} - -set -ex - -# Change to the script's directory. -cd $(dirname $0) - -OLD_VERSION=$1 -OLD_VERSION_PROTOC=https://repo1.maven.org/maven2/com/google/protobuf/protoc/$OLD_VERSION/protoc-$OLD_VERSION-linux-x86_64.exe - -# Extract the latest protobuf version number. -VERSION_NUMBER=`grep "PHP_PROTOBUF_VERSION" ../ext/google/protobuf/protobuf.h | sed "s|#define PHP_PROTOBUF_VERSION \"\(.*\)\"|\1|"` - -echo "Running compatibility tests between current $VERSION_NUMBER and released $OLD_VERSION" - -# Check protoc -[ -f ../../src/protoc ] || { - echo "[ERROR]: Please build protoc first." - exit 1 -} - -# Download old test. -rm -rf protobuf -git clone https://github.com/protocolbuffers/protobuf.git -pushd protobuf -git checkout v$OLD_VERSION -popd - -# Build and copy the new runtime -pushd ../ext/google/protobuf -make clean || true -phpize && ./configure && make -popd - -rm -rf protobuf/php/ext -rm -rf protobuf/php/src -cp -r ../ext protobuf/php/ext/ -cp -r ../src protobuf/php/src/ - -# Download old version protoc compiler (for linux) -wget $OLD_VERSION_PROTOC -O old_protoc -chmod +x old_protoc - -NEW_PROTOC=`pwd`/../../src/protoc -OLD_PROTOC=`pwd`/old_protoc -cd protobuf/php -composer install - -# Remove implementation detail tests. -# TODO(teboring): Temporarily disable encode_decode_test.php. In 3.13.0-rc1, -# repeated primitive field encoding is changed to packed, which is a bug fix. -# However, this fails the compatibility test which hard coded old encoding. -# Will re-enable the test after making a release. After the version bump, the -# compatibility test will use the updated test code. -tests=( array_test.php generated_class_test.php map_field_test.php well_known_test.php ) -sed -i.bak '/php_implementation_test.php/d' phpunit.xml -sed -i.bak '/generated_phpdoc_test.php/d' phpunit.xml -sed -i.bak '/encode_decode_test.php/d' phpunit.xml -sed -i.bak 's/generated_phpdoc_test.php//g' tests/test.sh -sed -i.bak 's/generated_service_test.php//g' tests/test.sh -sed -i.bak 's/encode_decode_test.php//g' tests/test.sh -sed -i.bak '/memory_leak_test.php/d' tests/test.sh -sed -i.bak '/^ public function testTimestamp()$/,/^ }$/d' tests/well_known_test.php -sed -i.bak 's/PHPUnit_Framework_TestCase/\\PHPUnit\\Framework\\TestCase/g' tests/array_test.php -sed -i.bak 's/PHPUnit_Framework_TestCase/\\PHPUnit\\Framework\\TestCase/g' tests/map_field_test.php -sed -i.bak 's/PHPUnit_Framework_TestCase/\\PHPUnit\\Framework\\TestCase/g' tests/test_base.php -for t in "${tests[@]}" -do - remove_error_test tests/$t -done - -cd tests - -# Test A.1: -# proto set 1: use old version -# proto set 2 which may import protos in set 1: use old version -generate_proto $OLD_PROTOC $OLD_PROTOC -./test.sh -pushd .. -./vendor/bin/phpunit -popd - -# Test A.2: -# proto set 1: use new version -# proto set 2 which may import protos in set 1: use old version -generate_proto $NEW_PROTOC $OLD_PROTOC -./test.sh -pushd .. -./vendor/bin/phpunit -popd - -# Test A.3: -# proto set 1: use old version -# proto set 2 which may import protos in set 1: use new version -generate_proto $OLD_PROTOC $NEW_PROTOC -./test.sh -pushd .. -./vendor/bin/phpunit -popd diff --git a/pkg/BUILD.bazel b/pkg/BUILD.bazel index dd31f7d544..6f35175a03 100644 --- a/pkg/BUILD.bazel +++ b/pkg/BUILD.bazel @@ -7,7 +7,7 @@ load( "strip_prefix", ) load("//:protobuf_release.bzl", "package_naming") -load(":build_systems.bzl", "gen_automake_file_lists", "gen_file_lists") +load(":build_systems.bzl", "gen_file_lists") load(":cc_dist_library.bzl", "cc_dist_library") package_naming( @@ -92,6 +92,7 @@ pkg_filegroup( "//build_defs:dist_files", "//conformance:all_dist_files", "//src:all_dist_files", + "//third_party/utf8_range:dist_files", "@com_google_protobuf_examples//:dist_files", ], ) @@ -334,26 +335,6 @@ gen_file_lists( }, ) -gen_automake_file_lists( - name = "gen_automake_extra_dist_lists", - testonly = 1, - out = "extra_dist_file_lists.am", - src_libs = { - # source rule: name in generated file - "//:common_dist_files": "dist_common", - "//conformance:dist_files": "dist_conformance", - "//benchmarks:all_dist_files": "dist_benchmark", - "@com_google_protobuf_examples//:dist_files": "dist_example", - "//:csharp_dist_files": "dist_csharp", - "//csharp:dist_files": "dist_csharp2", - "//:objectivec_dist_files": "dist_objectivec", - "//objectivec:dist_files": "dist_objectivec2", - "//php:dist_files": "dist_php", - "//python:dist_files": "dist_python", - "//ruby:dist_files": "dist_ruby", - }, -) - ################################################################################ # Protobuf runtime libraries. ################################################################################ diff --git a/pkg/build_systems.bzl b/pkg/build_systems.bzl index 40bdaad659..cb8ad11505 100644 --- a/pkg/build_systems.bzl +++ b/pkg/build_systems.bzl @@ -14,17 +14,10 @@ def gen_file_lists(name, out_stem, **kwargs): source_prefix = "${protobuf_SOURCE_DIR}/", **kwargs ) - gen_automake_file_lists( - name = name + "_automake", - out = out_stem + ".am", - source_prefix = "$(top_srcdir)/", - **kwargs - ) native.filegroup( name = name, srcs = [ out_stem + ".cmake", - out_stem + ".am", ], ) @@ -331,75 +324,3 @@ endif() ), ), ) - -################################################################################ -# Automake source lists generation -################################################################################ - -def _automake_var_fragment(owner, varname, prefix, entries): - """Returns a single variable assignment fragment (Automake syntax). - - Args: - owner: Label, the rule that owns these srcs. - varname: str, the var name to set. - prefix: str, prefix to prepend to each of `entries`. - entries: [str], the entries in the list. - - Returns: - A string. - """ - if len(entries) == 0: - # A backslash followed by a blank line is illegal. We still want - # to emit the variable, though. - return "# {owner}\n{varname} =\n".format( - owner = owner, - varname = varname, - ) - fragment = ( - "# {owner}\n" + - "{varname} = \\\n" + - "{entries}" - ).format( - owner = owner, - varname = varname, - entries = " \\\n".join([" %s%s" % (prefix, f) for f in entries]), - ) - return fragment.rstrip("\\ ") + "\n" - -def _automake_file_list_impl(ctx): - _create_file_list_impl(ctx, _automake_var_fragment) - -gen_automake_file_lists = rule( - doc = """ -Generates an Automake-syntax file with lists of files. - -The generated file defines variables with lists of files from `srcs`. The -intent is for these files to be included from a non-generated Makefile.am -file which actually defines the libraries based on these lists. - -For C++ rules, the following are generated: - {libname}_srcs: contains srcs. - {libname}_hdrs: contains hdrs and textual_hdrs. - -For proto_library, the following are generated: - {libname}_proto_srcs: contains the srcs from the `proto_library` rule. - {libname}_srcs: contains syntesized paths for generated C++ sources. - {libname}_hdrs: contains syntesized paths for generated C++ headers. - -""", - implementation = _automake_file_list_impl, - attrs = dict( - _source_list_common_attrs.items(), - _header = attr.string( - default = """\ -# Auto-generated by %s -# -# This file contains lists of sources based on Bazel rules. It should -# be included from a hand-written Makefile.am that defines targets. -# -# Changes to this file will be overwritten based on Bazel definitions. - -""", - ), - ), -) diff --git a/post_process_dist.sh b/post_process_dist.sh deleted file mode 100755 index 2630f97546..0000000000 --- a/post_process_dist.sh +++ /dev/null @@ -1,64 +0,0 @@ -#! /bin/sh - -# This script takes the result of "make dist" and: -# 1) Unpacks it. -# 2) Ensures all contents are user-writable. Some version control systems -# keep code read-only until you explicitly ask to edit it, and the normal -# "make dist" process does not correct for this, so the result is that -# the entire dist is still marked read-only when unpacked, which is -# annoying. So, we fix it. -# 3) Convert MSVC project files to MSVC 2005, so that anyone who has version -# 2005 *or* 2008 can open them. (In version control, we keep things in -# MSVC 2008 format since that's what we use in development.) -# 4) Uses the result to create .tar.gz, .tar.bz2, and .zip versions and -# deposits them in the "dist" directory. In the .zip version, all -# non-testdata .txt files are converted to Windows-style line endings. -# 5) Cleans up after itself. - -if [ "$1" == "" ]; then - echo "USAGE: $0 DISTFILE" >&2 - exit 1 -fi - -if [ ! -e $1 ]; then - echo $1": File not found." >&2 - exit 1 -fi - -set -ex - -LANGUAGES="cpp csharp java objectivec python ruby php all" -BASENAME=`basename $1 .tar.gz` -VERSION=${BASENAME:9} - -# Create a directory called "dist", copy the tarball there and unpack it. -mkdir dist -cp $1 dist -cd dist -tar zxvf $BASENAME.tar.gz -rm $BASENAME.tar.gz - -# Set the entire contents to be user-writable. -chmod -R u+w $BASENAME -cd $BASENAME - -for LANG in $LANGUAGES; do - # Build the dist again in .tar.gz - ./configure DIST_LANG=$LANG - make dist-gzip - mv $BASENAME.tar.gz ../protobuf-$LANG-$VERSION.tar.gz -done - -# Convert all text files to use DOS-style line endings, then build a .zip -# distribution. -todos *.txt */*.txt - -for LANG in $LANGUAGES; do - # Build the dist again in .zip - ./configure DIST_LANG=$LANG - make dist-zip - mv $BASENAME.zip ../protobuf-$LANG-$VERSION.zip -done - -cd .. -rm -rf $BASENAME diff --git a/protobuf-lite.pc.in b/protobuf-lite.pc.in deleted file mode 100644 index f92e4ad9d7..0000000000 --- a/protobuf-lite.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: Protocol Buffers -Description: Google's Data Interchange Format -Version: @VERSION@ -Libs: -L${libdir} -lprotobuf-lite -Cflags: -I${includedir} -Conflicts: protobuf diff --git a/protobuf.bzl b/protobuf.bzl index 243341df37..2cb1cdd090 100644 --- a/protobuf.bzl +++ b/protobuf.bzl @@ -1,5 +1,6 @@ load("@bazel_skylib//lib:versions.bzl", "versions") -load("@rules_cc//cc:defs.bzl", "cc_library") +load("@bazel_skylib//lib:collections.bzl", "collections") +load("@rules_cc//cc:defs.bzl", "cc_library", "objc_library") load("@rules_proto//proto:defs.bzl", "ProtoInfo") load("@rules_python//python:defs.bzl", "py_library", "py_test") @@ -37,20 +38,23 @@ def _SourceDir(ctx): return _GetPath(ctx, ctx.attr.includes[0]) return _GetPath(ctx, ctx.label.package + "/" + ctx.attr.includes[0]) -def _CcHdrs(srcs, use_grpc_plugin = False): - ret = [s[:-len(".proto")] + ".pb.h" for s in srcs] - if use_grpc_plugin: - ret += [s[:-len(".proto")] + ".grpc.pb.h" for s in srcs] - return ret +def _ObjcBase(srcs): + return [ + "".join([token.capitalize() for token in src[:-len(".proto")].split("_")]) + for src in srcs] -def _CcSrcs(srcs, use_grpc_plugin = False): - ret = [s[:-len(".proto")] + ".pb.cc" for s in srcs] - if use_grpc_plugin: - ret += [s[:-len(".proto")] + ".grpc.pb.cc" for s in srcs] - return ret +def _ObjcHdrs(srcs): + return[src + ".pbobjc.h" for src in _ObjcBase(srcs)] -def _CcOuts(srcs, use_grpc_plugin = False): - return _CcHdrs(srcs, use_grpc_plugin) + _CcSrcs(srcs, use_grpc_plugin) +def _ObjcSrcs(srcs): + return[src + ".pbobjc.m" for src in _ObjcBase(srcs)] + +def _ObjcOuts(srcs, out_type): + if out_type == "hdrs": + return _ObjcHdrs(srcs) + if out_type == "srcs": + return _ObjcSrcs(srcs) + return _ObjcHdrs(srcs) + _ObjcSrcs(srcs) def _PyOuts(srcs, use_grpc_plugin = False): ret = [s[:-len(".proto")] + "_pb2.py" for s in srcs] @@ -58,6 +62,14 @@ def _PyOuts(srcs, use_grpc_plugin = False): ret += [s[:-len(".proto")] + "_pb2_grpc.py" for s in srcs] return ret +def _RubyOuts(srcs): + return [s[:-len(".proto")] + "_pb.rb" for s in srcs] + +def _CsharpOuts(srcs): + return [ + "".join([token.capitalize() for token in src[:-len(".proto")].split("_")]) + ".cs" + for src in srcs] + ProtoGenInfo = provider( fields = ["srcs", "import_flags", "deps"], ) @@ -65,6 +77,8 @@ ProtoGenInfo = provider( def _proto_gen_impl(ctx): """General implementation for generating protos""" srcs = ctx.files.srcs + langs = ctx.attr.langs or [] + out_type = ctx.attr.out_type deps = depset(direct = ctx.files.srcs) source_dir = _SourceDir(ctx) gen_dir = _GenDir(ctx).rstrip("/") @@ -81,6 +95,10 @@ def _proto_gen_impl(ctx): if has_generated: import_flags += ["-I" + gen_dir] + if ctx.attr.includes: + for include in ctx.attr.includes: + import_flags += ["-I"+_GetPath(ctx,include)] + import_flags = depset(direct = import_flags) for dep in ctx.attr.deps: @@ -99,7 +117,7 @@ def _proto_gen_impl(ctx): else: deps = depset(transitive = [deps, dep_proto.deps]) - if not ctx.attr.gen_cc and not ctx.attr.gen_py and not ctx.executable.plugin: + if not langs and not ctx.executable.plugin: return [ ProtoGenInfo( srcs = srcs, @@ -119,16 +137,24 @@ def _proto_gen_impl(ctx): path = f.replace("-I", "") import_flags_real.append("-I$(realpath -s %s)" % path) - outs = [] use_grpc_plugin = (ctx.attr.plugin_language == "grpc" and ctx.attr.plugin) path_tpl = "$(realpath %s)" if in_gen_dir else "%s" - if ctx.attr.gen_cc: - args += [("--cpp_out=" + path_tpl) % gen_dir] - outs.extend(_CcOuts([src.basename], use_grpc_plugin = use_grpc_plugin)) - if ctx.attr.gen_py: - args += [("--python_out=" + path_tpl) % gen_dir] - outs.extend(_PyOuts([src.basename], use_grpc_plugin = use_grpc_plugin)) + outs = [] + for lang in langs: + if lang == "csharp": + outs.extend(_CsharpOuts([src.basename])) + elif lang == "objc": + outs.extend(_ObjcOuts([src.basename], out_type = out_type)) + elif lang == "python": + outs.extend(_PyOuts([src.basename], use_grpc_plugin = use_grpc_plugin)) + elif lang == "ruby": + outs.extend(_RubyOuts([src.basename])) + # Otherwise, rely on user-supplied outs. + args += [("--%s_out=" + path_tpl) % (lang, gen_dir)] + + if ctx.attr.outs: + outs.extend(ctx.attr.outs) outs = [ctx.actions.declare_file(out, sibling = src) for out in outs] generated_files.extend(outs) @@ -193,7 +219,29 @@ def _proto_gen_impl(ctx): DefaultInfo(files = depset(generated_files)), ] -proto_gen = rule( +"""Generates codes from Protocol Buffers definitions. + +This rule helps you to implement Skylark macros specific to the target +language. You should prefer more specific `cc_proto_library `, +`py_proto_library` and others unless you are adding such wrapper macros. + +Args: + srcs: Protocol Buffers definition files (.proto) to run the protocol compiler + against. + deps: a list of dependency labels; must be other proto libraries. + includes: a list of include paths to .proto files. + protoc: the label of the protocol compiler to generate the sources. + plugin: the label of the protocol compiler plugin to be passed to the protocol + compiler. + plugin_language: the language of the generated sources + plugin_options: a list of options to be passed to the plugin + langs: generates sources in addition to the ones from the plugin for each + specified language. + outs: a list of labels of the expected outputs from the protocol compiler. + out_type: only generated a single type of source file for languages that have + split sources (e.g. *.h and *.cc in C++) +""" +_proto_gen = rule( attrs = { "srcs": attr.label_list(allow_files = True), "deps": attr.label_list(providers = [ProtoGenInfo]), @@ -211,124 +259,15 @@ proto_gen = rule( ), "plugin_language": attr.string(), "plugin_options": attr.string_list(), - "gen_cc": attr.bool(), - "gen_py": attr.bool(), - "outs": attr.label_list(), + "langs": attr.string_list(), + "outs": attr.string_list(), + "out_type": attr.string( + default = "all" + ), }, output_to_genfiles = True, implementation = _proto_gen_impl, ) -"""Generates codes from Protocol Buffers definitions. - -This rule helps you to implement Skylark macros specific to the target -language. You should prefer more specific `cc_proto_library `, -`py_proto_library` and others unless you are adding such wrapper macros. - -Args: - srcs: Protocol Buffers definition files (.proto) to run the protocol compiler - against. - deps: a list of dependency labels; must be other proto libraries. - includes: a list of include paths to .proto files. - protoc: the label of the protocol compiler to generate the sources. - plugin: the label of the protocol compiler plugin to be passed to the protocol - compiler. - plugin_language: the language of the generated sources - plugin_options: a list of options to be passed to the plugin - gen_cc: generates C++ sources in addition to the ones from the plugin. - gen_py: generates Python sources in addition to the ones from the plugin. - outs: a list of labels of the expected outputs from the protocol compiler. -""" - -def _adapt_proto_library_impl(ctx): - deps = [dep[ProtoInfo] for dep in ctx.attr.deps] - - srcs = [src for dep in deps for src in dep.direct_sources] - return struct( - proto = struct( - srcs = srcs, - import_flags = ["-I{}".format(path) for dep in deps for path in dep.transitive_proto_path.to_list()], - deps = srcs, - ), - ) - -adapt_proto_library = rule( - implementation = _adapt_proto_library_impl, - attrs = { - "deps": attr.label_list( - mandatory = True, - providers = [ProtoInfo], - ), - }, - doc = "Adapts `proto_library` from `@rules_proto` to be used with `{cc,py}_proto_library` from this file.", -) - -def cc_proto_library( - name, - srcs = [], - deps = [], - cc_libs = [], - include = None, - protoc = "@com_google_protobuf//:protoc", - use_grpc_plugin = False, - default_runtime = "@com_google_protobuf//:protobuf", - **kargs): - """Bazel rule to create a C++ protobuf library from proto source files - - NOTE: the rule is only an internal workaround to generate protos. The - interface may change and the rule may be removed when bazel has introduced - the native rule. - - Args: - name: the name of the cc_proto_library. - srcs: the .proto files of the cc_proto_library. - deps: a list of dependency labels; must be cc_proto_library. - cc_libs: a list of other cc_library targets depended by the generated - cc_library. - include: a string indicating the include path of the .proto files. - protoc: the label of the protocol compiler to generate the sources. - use_grpc_plugin: a flag to indicate whether to call the grpc C++ plugin - when processing the proto files. - default_runtime: the implicitly default runtime which will be depended on by - the generated cc_library target. - **kargs: other keyword arguments that are passed to cc_library. - """ - - includes = [] - if include != None: - includes = [include] - - grpc_cpp_plugin = None - if use_grpc_plugin: - grpc_cpp_plugin = "//external:grpc_cpp_plugin" - - gen_srcs = _CcSrcs(srcs, use_grpc_plugin) - gen_hdrs = _CcHdrs(srcs, use_grpc_plugin) - outs = gen_srcs + gen_hdrs - - proto_gen( - name = name + "_genproto", - srcs = srcs, - deps = [s + "_genproto" for s in deps], - includes = includes, - protoc = protoc, - plugin = grpc_cpp_plugin, - plugin_language = "grpc", - gen_cc = 1, - visibility = ["//visibility:public"], - ) - - if default_runtime and not default_runtime in cc_libs: - cc_libs = cc_libs + [default_runtime] - if use_grpc_plugin: - cc_libs = cc_libs + ["//external:grpc_lib"] - cc_library( - name = name, - srcs = gen_srcs, - hdrs = gen_hdrs, - deps = cc_libs + deps, - includes = includes, - **kargs - ) def _internal_gen_well_known_protos_java_impl(ctx): args = ctx.actions.args() @@ -454,7 +393,97 @@ internal_gen_kt_protos = rule( }, ) -def py_proto_library( +def internal_objc_proto_library( + name, + srcs = [], + deps = [], + outs = [], + proto_deps = [], + includes = ["."], + default_runtime = "@com_google_protobuf//:protobuf_objc", + protoc = "@com_google_protobuf//:protoc", + testonly = None, + visibility = ["//visibility:public"], + **kwargs): + """Bazel rule to create a Objective-C protobuf library from proto sourc + files + + NOTE: the rule is only an internal workaround to generate protos. The + interface may change and the rule may be removed when bazel has introduced + the native rule. + + Args: + name: the name of the objc_proto_library. + srcs: the .proto files to compile. + deps: a list of dependency labels; must be objc_proto_library. + outs: a list of expected output files. + proto_deps: a list of proto file dependencies that don't have a + objc_proto_library rule. + include: a string indicating the include path of the .proto files. + default_runtime: the Objective-C Protobuf runtime + protoc: the label of the protocol compiler to generate the sources. + testonly: common rule attribute (see: + https://bazel.build/reference/be/common-definitions#common-attributes) + visibility: the visibility of the generated files. + **kwargs: other keyword arguments that are passed to py_library. + + """ + full_deps = [d + "_genproto" for d in deps] + + if proto_deps: + _proto_gen( + name = name + "_deps_genproto", + testonly = testonly, + srcs = proto_deps, + protoc = protoc, + includes = includes, + ) + full_deps.append(":%s_deps_genproto" % name) + + # Note: we need to run the protoc build twice to get separate targets for + # the generated header and the source files. + _proto_gen( + name = name + "_genproto_hdrs", + srcs = srcs, + deps = full_deps, + langs = ["objc"], + out_type = "hdrs", + includes = includes, + protoc = protoc, + testonly = testonly, + visibility = visibility, + tags = ["manual"], + ) + + _proto_gen( + name = name + "_genproto", + srcs = srcs, + deps = full_deps, + langs = ["objc"], + out_type = "srcs", + includes = includes, + protoc = protoc, + testonly = testonly, + visibility = visibility, + tags = ["manual"], + ) + + objc_library( + name = name, + hdrs = [name + "_genproto_hdrs"], + non_arc_srcs = [name + "_genproto"], + deps = [default_runtime], + includes = includes, + testonly = testonly, + visibility = visibility, + # Don't auto-expand these targets until target_compatible_with + # works. See https://github.com/bazelbuild/bazel/issues/12897. + tags = ["manual"], + target_compatible_with = ["@platforms//os:osx"], + **kwargs + ) + +def internal_py_proto_library( name, srcs = [], deps = [], @@ -502,14 +531,14 @@ def py_proto_library( # is not explicitly listed in py_libs. Instead, host system is assumed to # have grpc installed. - proto_gen( + _proto_gen( name = name + "_genproto", testonly = testonly, srcs = srcs, deps = [s + "_genproto" for s in deps], includes = includes, protoc = protoc, - gen_py = 1, + langs = ["python"], visibility = ["//visibility:public"], plugin = grpc_python_plugin, plugin_language = "grpc", @@ -526,6 +555,137 @@ def py_proto_library( **kargs ) +def _source_proto_library( + name, + srcs = [], + deps = [], + proto_deps = [], + outs = [], + lang = None, + includes = ["."], + protoc = "@com_google_protobuf//:protoc", + testonly = None, + visibility = ["//visibility:public"], + **kwargs): + """Bazel rule to create generated protobuf code from proto source files for + languages not well supported by Bazel yet. This will output the generated + code as-is without any compilation. This is most useful for interpreted + languages that don't require it. + + NOTE: the rule is only an internal workaround to generate protos. The + interface may change and the rule may be removed when bazel has introduced + the native rule. + + Args: + name: the name of the unsupported_proto_library. + srcs: the .proto files to compile. Note, that for languages where out + needs to be provided, only a single source file is allowed. + deps: a list of dependency labels; must be unsupported_proto_library. + proto_deps: a list of proto file dependencies that don't have a + unsupported_proto_library rule. + lang: the language to (optionally) generate code for. + outs: a list of expected output files. This is only required for + languages where we can't predict the outputs. + includes: strings indicating the include path of the .proto files. + protoc: the label of the protocol compiler to generate the sources. + testonly: common rule attribute (see: + https://bazel.build/reference/be/common-definitions#common-attributes) + visibility: the visibility of the generated files. + **kwargs: other keyword arguments that are passed to py_library. + + """ + if outs and len(srcs) != 1: + fail("Custom outputs only allowed for single proto targets.") + + langs = [] + if lang != None: + langs = [lang] + + full_deps = [d + "_genproto" for d in deps] + + if proto_deps: + _proto_gen( + name = name + "_deps_genproto", + testonly = testonly, + srcs = proto_deps, + protoc = protoc, + includes = includes, + ) + full_deps.append(":%s_deps_genproto" % name) + + _proto_gen( + name = name + "_genproto", + srcs = srcs, + deps = full_deps, + langs = langs, + outs = outs, + includes = includes, + protoc = protoc, + testonly = testonly, + visibility = visibility, + ) + + native.filegroup( + name = name, + srcs = [":%s_genproto"%name], + testonly = testonly, + visibility = visibility, + **kwargs + ) + +def internal_csharp_proto_library(**kwargs): + """Bazel rule to create a C# protobuf library from proto source files + + NOTE: the rule is only an internal workaround to generate protos. The + interface may change and the rule may be removed when bazel has introduced + the native rule. + + Args: + **kwargs: arguments that are passed to unsupported_proto_library. + + """ + + _source_proto_library( + lang = "csharp", + **kwargs + ) + +def internal_php_proto_library(**kwargs): + """Bazel rule to create a PHP protobuf library from proto source files + + NOTE: the rule is only an internal workaround to generate protos. The + interface may change and the rule may be removed when bazel has introduced + the native rule. + + Args: + **kwargs: arguments that are passed to unsupported_proto_library. + + """ + if not kwargs.get("outs"): + fail("Unable to predict the outputs for php_proto_library. Please specify them via `outs`.") + + _source_proto_library( + lang = "php", + **kwargs + ) + +def internal_ruby_proto_library(**kwargs): + """Bazel rule to create a Ruby protobuf library from proto source files + + NOTE: the rule is only an internal workaround to generate protos. The + interface may change and the rule may be removed when bazel has introduced + the native rule. + + Args: + **kwargs: arguments that are passed to unsupported_proto_library. + + """ + + _source_proto_library( + lang = "ruby", + **kwargs + ) + def check_protobuf_required_bazel_version(): """For WORKSPACE files, to check the installed version of bazel. diff --git a/protobuf.pc.in b/protobuf.pc.in deleted file mode 100644 index e9bef5d0fe..0000000000 --- a/protobuf.pc.in +++ /dev/null @@ -1,13 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: Protocol Buffers -Description: Google's Data Interchange Format -Version: @VERSION@ -Libs: -L${libdir} -lprotobuf -Libs.private: @LIBS@ - -Cflags: -I${includedir} -Conflicts: protobuf-lite diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl index 0d2611f16f..d002ef3231 100644 --- a/protobuf_deps.bzl +++ b/protobuf_deps.bzl @@ -3,6 +3,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") PROTOBUF_MAVEN_ARTIFACTS = [ + "com.google.caliper:caliper:1.0-beta-3", "com.google.code.findbugs:jsr305:3.0.2", "com.google.code.gson:gson:2.8.9", "com.google.errorprone:error_prone_annotations:2.3.2", @@ -114,6 +115,6 @@ def protobuf_deps(): _github_archive( name = "upb", repo = "https://github.com/protocolbuffers/upb", - commit = "17b6451684ffcf6e77d10a5def9bf19af57eccd3", - sha256 = "655c30a01c8ab56680c154baded548c5df8f726305d3338d0885cbb1f700ec10", + commit = "63a4a7d74bcbc8c6b94e6b18e599ffc68c71b91c", + sha256 = "9c921e799c4a5446b7164368a6579e20121103646045cd93986ba5bb8b376b29", ) diff --git a/protoc-artifacts/Dockerfile b/protoc-artifacts/Dockerfile deleted file mode 100644 index 278bc7452d..0000000000 --- a/protoc-artifacts/Dockerfile +++ /dev/null @@ -1,55 +0,0 @@ -FROM centos:6.9 - -RUN yum install -y git \ - tar \ - wget \ - make \ - autoconf \ - curl-devel \ - unzip \ - automake \ - libtool \ - glibc-static.i686 \ - glibc-devel \ - glibc-devel.i686 \ - && \ - yum clean all - -# Install Java 8 -RUN wget -q --no-cookies --no-check-certificate \ - --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \ - "http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz" \ - -O - | tar xz -C /var/local -ENV JAVA_HOME /var/local/jdk1.8.0_131 -ENV PATH $JAVA_HOME/bin:$PATH - -# Install Maven -RUN wget -q http://apache.cs.utah.edu/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz -O - | \ - tar xz -C /var/local -ENV PATH /var/local/apache-maven-3.3.9/bin:$PATH - -# Install GCC 4.8 to support -static-libstdc++ -RUN wget http://people.centos.org/tru/devtools-2/devtools-2.repo -P /etc/yum.repos.d && \ - bash -c 'echo "enabled=1" >> /etc/yum.repos.d/devtools-2.repo' && \ - bash -c "sed -e 's/\$basearch/i386/g' /etc/yum.repos.d/devtools-2.repo > /etc/yum.repos.d/devtools-i386-2.repo" && \ - sed -e 's/testing-/testing-i386-/g' -i /etc/yum.repos.d/devtools-i386-2.repo && \ - rpm --rebuilddb - -RUN yum install -y devtoolset-2-gcc \ - devtoolset-2-gcc-c++ \ - devtoolset-2-binutils \ - devtoolset-2-libstdc++-devel \ - devtoolset-2-libatomic-devel \ - libatomic \ - devtoolset-2-gcc.i686 \ - devtoolset-2-gcc-c++.i686 \ - devtoolset-2-binutils.i686 \ - devtoolset-2-libstdc++-devel.i686 \ - devtoolset-2-libatomic-devel.i686 \ - libatomic.i686 && \ - yum clean all - -COPY scl-enable-devtoolset.sh /var/local/ - -# Start in devtoolset environment that uses GCC 4.7 -ENTRYPOINT ["/var/local/scl-enable-devtoolset.sh"] diff --git a/protoc-artifacts/README.md b/protoc-artifacts/README.md index 8fc366935d..5511f9aedf 100644 --- a/protoc-artifacts/README.md +++ b/protoc-artifacts/README.md @@ -43,13 +43,13 @@ for how to set up the build environment. ## Building from a freshly checked-out source If you just checked out the Protobuf source from github, you need to -generate the configure script. +pull in any submodules. Under the protobuf project directory: ``` -$ ./autogen.sh +git submodule update --init --recursive ``` ### Build the artifact for each platform diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh index 4602842622..d304d5f419 100755 --- a/protoc-artifacts/build-protoc.sh +++ b/protoc-artifacts/build-protoc.sh @@ -19,28 +19,20 @@ # macos osx x86_64 # mingw windows x86_32 # mingw windows x86_64 -# -# Before running this script, make sure you have generated the configure script -# in the parent directory (i.e., run ./autogen.sh there). OS=$1 ARCH=$2 -MAKE_TARGET=$3 +BAZEL_TARGET=$3 if [[ $# < 3 ]]; then echo "Not enough arguments provided." exit 1 fi -case $MAKE_TARGET in - protoc-gen-javalite) - ;; - protoc) - ;; - *) - echo "Target ""$MAKE_TARGET"" invalid." +if [[ $BAZEL_TARGET != protoc ]]; then + echo "Target ""$BAZEL_TARGET"" invalid." exit 1 -esac +fi # Under Cygwin, bash doesn't have these in PATH when called from Maven which # runs in Windows version of Java. @@ -146,22 +138,22 @@ checkDependencies () host_machine="$(uname -m)"; dump_cmd='ldd '"$1" if [[ "$ARCH" == x86_32 ]]; then - white_list="linux-gate\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux\.so\.2" + white_list="linux-gate\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|libgcc_s\.so\.1\|libstdc++\.so\.6\|ld-linux\.so\.2" elif [[ "$ARCH" == x86_64 ]]; then - white_list="linux-vdso\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux-x86-64\.so\.2" + white_list="linux-vdso\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|libgcc_s\.so\.1\|libstdc++\.so\.6\|ld-linux-x86-64\.so\.2" elif [[ "$ARCH" == s390_64 ]]; then if [[ $host_machine != s390x ]];then dump_cmd='objdump -p '"$1"' | grep NEEDED' fi - white_list="linux-vdso64\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|libz\.so\.1\|ld64\.so\.1" + white_list="linux-vdso64\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|libgcc_s\.so\.1\|libstdc++\.so\.6\|libz\.so\.1\|ld64\.so\.1" elif [[ "$ARCH" == ppcle_64 ]]; then if [[ $host_machine != ppc64le ]];then dump_cmd='objdump -p '"$1"' | grep NEEDED' fi - white_list="linux-vdso64\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|libz\.so\.1\|ld64\.so\.2" + white_list="linux-vdso64\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|libgcc_s\.so\.1\|libstdc++\.so\.6\|libz\.so\.1\|ld64\.so\.2" elif [[ "$ARCH" == aarch_64 ]]; then dump_cmd='objdump -p '"$1"' | grep NEEDED' - white_list="libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux-aarch64\.so\.1" + white_list="libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|libgcc_s\.so\.1\|libstdc++\.so\.6\|ld-linux-aarch64\.so\.1" fi elif [[ "$OS" == osx ]]; then dump_cmd='otool -L '"$1"' | fgrep dylib' @@ -185,19 +177,14 @@ checkDependencies () } ############################################################################ -echo "Building protoc, OS=$OS ARCH=$ARCH TARGET=$MAKE_TARGET" +echo "Building protoc, OS=$OS ARCH=$ARCH TARGET=$BAZEL_TARGET" -CONFIGURE_ARGS="--disable-shared" +BAZEL_ARGS=("--dynamic_mode=off" "--compilation_mode=opt" "--copt=-g0" "--copt=-fpic") if [[ "$OS" == windows ]]; then - MAKE_TARGET="${MAKE_TARGET}.exe" + BAZEL_TARGET="${BAZEL_TARGET}.exe" fi -# Override the default value set in configure.ac that has '-g' which produces -# huge binary. -CXXFLAGS="-DNDEBUG" -LDFLAGS="" - if [[ "$(uname)" == CYGWIN* ]]; then assertEq "$OS" windows $LINENO # Use mingw32 compilers because executables produced by Cygwin compiler @@ -217,28 +204,13 @@ elif [[ "$(uname)" == MINGW64* ]]; then assertEq "$ARCH" x86_64 $LINENO elif [[ "$(uname)" == Linux* ]]; then if [[ "$OS" == linux ]]; then - if [[ "$ARCH" == x86_64 ]]; then - CXXFLAGS="$CXXFLAGS -m64" - elif [[ "$ARCH" == x86_32 ]]; then - CXXFLAGS="$CXXFLAGS -m32" - elif [[ "$ARCH" == aarch_64 ]]; then - CONFIGURE_ARGS="$CONFIGURE_ARGS --host=aarch64-linux-gnu" - elif [[ "$ARCH" == ppcle_64 ]]; then - CXXFLAGS="$CXXFLAGS -m64" - CONFIGURE_ARGS="$CONFIGURE_ARGS --host=powerpc64le-linux-gnu" - elif [[ "$ARCH" == s390_64 ]]; then - CXXFLAGS="$CXXFLAGS -m64" - CONFIGURE_ARGS="$CONFIGURE_ARGS --host=s390x-linux-gnu" - else - fail "Unsupported arch: $ARCH" - fi + BAZEL_ARGS+=("--config=linux-$ARCH") elif [[ "$OS" == windows ]]; then # Cross-compilation for Windows - CONFIGURE_ARGS="$CONFIGURE_ARGS" if [[ "$ARCH" == x86_64 ]]; then - CONFIGURE_ARGS="$CONFIGURE_ARGS --host=x86_64-w64-mingw32" + BAZEL_ARGS+=("--config=win64") elif [[ "$ARCH" == x86_32 ]]; then - CONFIGURE_ARGS="$CONFIGURE_ARGS --host=i686-w64-mingw32" + BAZEL_ARGS+=("--config=win32") else fail "Unsupported arch: $ARCH" fi @@ -248,43 +220,24 @@ elif [[ "$(uname)" == Linux* ]]; then elif [[ "$(uname)" == Darwin* ]]; then assertEq "$OS" osx $LINENO # Make the binary compatible with OSX 10.7 and later - CXXFLAGS="$CXXFLAGS -mmacosx-version-min=10.7" - if [[ "$ARCH" == x86_64 ]]; then - CXXFLAGS="$CXXFLAGS -m64" - elif [[ "$ARCH" == x86_32 ]]; then - CXXFLAGS="$CXXFLAGS -m32" - else - fail "Unsupported arch: $ARCH" - fi + BAZEL_ARGS+=("--config=osx-$ARCH" "--macos_minimum_os=10.7") else fail "Unsupported system: $(uname)" fi -# Statically link libgcc and libstdc++. -# -s to produce stripped binary. -if [[ "$OS" == windows ]]; then - # Also static link libpthread required by mingw64 - LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -s" -elif [[ "$OS" != osx ]]; then - # And they don't work under Mac. - LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++ -s" -fi - -export CXXFLAGS LDFLAGS - # Nested double quotes are unintuitive, but it works. cd "$(dirname "$0")" WORKING_DIR="$(pwd)" -BUILD_DIR="build/$OS/$ARCH" -TARGET_FILE="target/$OS/$ARCH/$MAKE_TARGET.exe" +TARGET_FILE="target/$OS/$ARCH/$BAZEL_TARGET.exe" +DOCKER_IMAGE=gcr.io/protobuf-build/bazel/linux@sha256:2bfd061284eff8234f2fcca16d71d43c69ccf3a22206628b54c204a6a9aac277 -mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR" && - ../../../../configure $CONFIGURE_ARGS && - cd src && make $MAKE_TARGET -j8 && - cd "$WORKING_DIR" && mkdir -p $(dirname $TARGET_FILE) && - cp $BUILD_DIR/src/$MAKE_TARGET $TARGET_FILE || - exit 1 +tmpfile=$(mktemp -u) && +docker run --cidfile $tmpfile -v $WORKING_DIR/..:/workspace $DOCKER_IMAGE \ + build //:$BAZEL_TARGET "${BAZEL_ARGS[@]}" && +mkdir -p $(dirname $TARGET_FILE) && +docker cp \ + `cat $tmpfile`:/workspace/bazel-bin/$BAZEL_TARGET $TARGET_FILE || exit 1 if [[ "$OS" == osx ]]; then # Since Mac linker doesn't accept "-s", we need to run strip diff --git a/python/BUILD.bazel b/python/BUILD.bazel index 06c8a5dff9..75d3a5d91d 100644 --- a/python/BUILD.bazel +++ b/python/BUILD.bazel @@ -9,8 +9,9 @@ load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") load("@rules_proto//proto:defs.bzl", "proto_library") load("@rules_python//python:defs.bzl", "py_library") -load("//:protobuf.bzl", "py_proto_library") +load("//:protobuf.bzl", "internal_py_proto_library") load("//build_defs:cpp_opts.bzl", "COPTS") +load("//conformance:defs.bzl", "conformance_test") load(":internal.bzl", "internal_copy_files") py_library( @@ -36,7 +37,7 @@ config_setting( }, ) -py_proto_library( +internal_py_proto_library( name = "well_known_types_py_pb2", srcs = [":copied_wkt_proto_files"], include = ".", @@ -167,7 +168,25 @@ internal_copy_files( strip_prefix = "src", ) -py_proto_library( +internal_copy_files( + name = "copied_test_messages_proto2_files", + testonly = 1, + srcs = [ + "//src/google/protobuf:test_messages_proto2.proto", + ], + strip_prefix = "src", +) + +internal_copy_files( + name = "copied_test_messages_proto3_files", + testonly = 1, + srcs = [ + "//src/google/protobuf:test_messages_proto3.proto", + ], + strip_prefix = "src", +) + +internal_py_proto_library( name = "python_common_test_protos", testonly = 1, srcs = [":copied_test_proto_files"], @@ -179,7 +198,7 @@ py_proto_library( deps = [":well_known_types_py_pb2"], ) -py_proto_library( +internal_py_proto_library( name = "python_specific_test_protos", testonly = 1, srcs = glob([ @@ -194,6 +213,33 @@ py_proto_library( deps = [":python_common_test_protos"], ) +internal_py_proto_library( + name = "test_messages_proto2_py_proto", + testonly = 1, + visibility = [ + "//conformance:__pkg__", + "//python:__subpackages__", + ], + srcs = [":copied_test_messages_proto2_files"], + include = ".", + default_runtime = "//:protobuf_python", + protoc = "//:protoc", +) + +internal_py_proto_library( + name = "test_messages_proto3_py_proto", + testonly = 1, + visibility = [ + "//conformance:__pkg__", + "//python:__subpackages__", + ], + srcs = [":copied_test_messages_proto3_files"], + deps = [":well_known_types_py_pb2"], + include = ".", + default_runtime = "//:protobuf_python", + protoc = "//:protoc", +) + py_library( name = "python_test_lib", testonly = 1, @@ -236,6 +282,13 @@ py_test( deps = [":python_test_lib"], ) +py_test( + name = "import_test", + srcs = ["google/protobuf/internal/import_test.py"], + imports = ["."], + deps = [":python_test_lib"], +) + py_test( name = "json_format_test", srcs = ["google/protobuf/internal/json_format_test.py"], @@ -243,6 +296,13 @@ py_test( deps = [":python_test_lib"], ) +py_test( + name = "keywords_test", + srcs = ["google/protobuf/internal/keywords_test.py"], + imports = ["."], + deps = [":python_test_lib"], +) + py_test( name = "message_factory_test", srcs = ["google/protobuf/internal/message_factory_test.py"], @@ -310,6 +370,13 @@ py_test( deps = [":python_test_lib"], ) +py_test( + name = "well_known_types_test", + srcs = ["google/protobuf/internal/well_known_types_test.py"], + imports = ["."], + deps = [":python_test_lib"], +) + py_test( name = "wire_format_test", srcs = ["google/protobuf/internal/wire_format_test.py"], @@ -319,13 +386,43 @@ py_test( cc_library( name = "proto_api", - hdrs = ["python/google/protobuf/proto_api.h"], + hdrs = ["google/protobuf/proto_api.h"], visibility = ["//visibility:public"], deps = [ "//external:python_headers", ], ) +py_test( + name = "python_version", + srcs = ["python_version.py"], +) + +conformance_test( + name = "conformance_test", + failure_list = "//conformance:failure_list_python.txt", + testee = "//conformance:conformance_python", + text_format_failure_list = "//conformance:text_format_failure_list_python.txt", + env = {"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": "python"}, + target_compatible_with = select({ + ":use_fast_cpp_protos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), +) + +# Note: this requires --define=use_fast_cpp_protos=true +conformance_test( + name = "conformance_test_cpp", + failure_list = "//conformance:failure_list_python.txt", + testee = "//conformance:conformance_python", + text_format_failure_list = "//conformance:text_format_failure_list_python_cpp.txt", + env = {"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": "cpp"}, + target_compatible_with = select({ + ":use_fast_cpp_protos": [], + "//conditions:default": ["@platforms//:incompatible"], + }), +) + ################################################################################ # Distribution files ################################################################################ @@ -347,6 +444,7 @@ pkg_files( "google/protobuf/python_protobuf.h", "internal.bzl", "mox.py", + "python_version.py", "release.sh", "setup.cfg", "setup.py", diff --git a/python/README.md b/python/README.md index c7f7828e0b..6549fb6700 100644 --- a/python/README.md +++ b/python/README.md @@ -30,33 +30,33 @@ Installation $ python -V -2) If you do not have setuptools installed, note that it will be +2) Make sure you have Bazel 0.5.4 or later (or CMake 3.5 or later). + +3) If you do not have setuptools installed, note that it will be downloaded and installed automatically as soon as you run `setup.py`. If you would rather install it manually, you may do so by following the instructions on [this page](https://packaging.python.org/en/latest/tutorials/installing-packages/). -3) Build the C++ code, or install a binary distribution of `protoc`. If +4) Build the C++ code, or install a binary distribution of `protoc`. If you install a binary distribution, make sure that it is the same version as this package. If in doubt, run: $ protoc --version -4) Build and run the tests: +5) Build and run the tests: $ python setup.py build $ python setup.py test To build, test, and use the C++ implementation, you must first compile - `libprotobuf.so`: - - $ (cd .. && make) + `libprotobuf.so` using either [Bazel](../README.md) or [CMake](../src/README.md): On OS X: If you are running a Homebrew-provided Python, you must make sure another version of protobuf is not already installed, as Homebrew's Python will - search `/usr/local/lib` for `libprotobuf.so` before it searches - `../src/.libs`. + search `/usr/local/lib` for `libprotobuf.so` before it searches the compiled + binaries. You can either unlink Homebrew's protobuf or install the `libprotobuf` you built earlier: @@ -65,18 +65,18 @@ Installation or - $ (cd .. && make install) + $ (cd .. && cmake . && make install) On other *nix: You must make `libprotobuf.so` dynamically available. You can either install libprotobuf you built earlier, or set `LD_LIBRARY_PATH`: - $ export LD_LIBRARY_PATH=../src/.libs + $ (cd .. && cmake . && make -j20 install) or - $ (cd .. && make install) + $ export LD_LIBRARY_PATH=../bazel-bin To build the C++ implementation run: @@ -98,7 +98,7 @@ Installation We do not know if or when it might be fixed. We also do not know how likely it is that this bug will affect users in practice. -5) Install: +6) Install: $ python setup.py install diff --git a/python/python_version.py b/python/python_version.py new file mode 100644 index 0000000000..5c2b5a6257 --- /dev/null +++ b/python/python_version.py @@ -0,0 +1,51 @@ +# Protocol Buffers - Google's data interchange format +# Copyright 2008 Google Inc. All rights reserved. +# https://developers.google.com/protocol-buffers/ +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +"""Test that Kokoro is using the expected version of python.""" + +import os +import unittest +import sys + +class PythonVersionTest(unittest.TestCase): + + def testPython3(self): + """Test that we can import nested import public messages.""" + + exp = os.getenv('KOKORO_PYTHON_VERSION', '') + if exp == '': + print("No kokoro python version found, skipping check", file=sys.stderr) + return + self.assertTrue(sys.version.startswith(exp), + "Expected Python %s but found Python %s" % (exp, sys.version)) + + +if __name__ == '__main__': + unittest.main() diff --git a/python/setup.py b/python/setup.py index 302c82bf64..283c99af60 100755 --- a/python/setup.py +++ b/python/setup.py @@ -29,10 +29,14 @@ from distutils.spawn import find_executable # Find the Protocol Compiler. if 'PROTOC' in os.environ and os.path.exists(os.environ['PROTOC']): protoc = os.environ['PROTOC'] -elif os.path.exists('../src/protoc'): - protoc = '../src/protoc' -elif os.path.exists('../src/protoc.exe'): - protoc = '../src/protoc.exe' +elif os.path.exists('../bazel-bin/protoc'): + protoc = '../bazel-bin/protoc' +elif os.path.exists('../bazel-bin/protoc.exe'): + protoc = '../bazel-bin/protoc.exe' +elif os.path.exists('protoc'): + protoc = '../protoc' +elif os.path.exists('protoc.exe'): + protoc = '../protoc.exe' elif os.path.exists('../vsprojects/Debug/protoc.exe'): protoc = '../vsprojects/Debug/protoc.exe' elif os.path.exists('../vsprojects/Release/protoc.exe'): @@ -203,13 +207,13 @@ class BuildExtCmd(_build_ext): class TestConformanceCmd(_build_py): - target = 'test_python' + target = '//python:conformance_test' def run(self): # Python 2.6 dodges these extra failures. os.environ['CONFORMANCE_PYTHON_EXTRA_FAILURES'] = ( '--failure_list failure_list_python-post26.txt') - cmd = 'cd ../conformance && make %s' % (TestConformanceCmd.target,) + cmd = 'bazel test %s' % (TestConformanceCmd.target,) subprocess.check_call(cmd, shell=True) @@ -289,16 +293,20 @@ if __name__ == '__main__': libraries = None library_dirs = None if not HasStaticLibprotobufOpt(): - extra_objects = ['../src/.libs/libprotobuf.a', - '../src/.libs/libprotobuf-lite.a'] + if os.path.exists('../bazel-bin/src/google/protobuf/libprotobuf.a'): + extra_objects = ['../bazel-bin/src/google/protobuf/libprotobuf.a'] + else: + extra_objects = ['../libprotobuf.a'] else: libraries = ['protobuf'] if HasLibraryDirsOpt(): library_dirs = None + elif os.path.exists('../bazel-bin/src/google/protobuf/libprotobuf.a'): + library_dirs = ['../bazel-bin/src/google/protobuf'] else: - library_dirs = ['../src/.libs'] + library_dirs = ['..'] - TestConformanceCmd.target = 'test_python_cpp' + TestConformanceCmd.target = '//python:conformance_test_cpp --define=use_fast_cpp_protos=true' extra_compile_args = [] diff --git a/python/tox.ini b/python/tox.ini index b923a4a58e..346ce21abd 100644 --- a/python/tox.ini +++ b/python/tox.ini @@ -5,10 +5,10 @@ envlist = [testenv] usedevelop=true passenv = - CC KOKORO_BUILD_ID KOKORO_BUILD_NUMBER + CC PYTHONPATH KOKORO_BUILD_ID KOKORO_BUILD_NUMBER setenv = - cpp: LD_LIBRARY_PATH={toxinidir}/../src/.libs - cpp: DYLD_LIBRARY_PATH={toxinidir}/../src/.libs + cpp: LD_LIBRARY_PATH={toxinidir}/../bazel-bin/src/google + cpp: DYLD_LIBRARY_PATH={toxinidir}/../bazel-bin/src/google cpp: PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp python: PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python commands = diff --git a/ruby/BUILD.bazel b/ruby/BUILD.bazel index fe336e549b..d014402f45 100644 --- a/ruby/BUILD.bazel +++ b/ruby/BUILD.bazel @@ -3,30 +3,180 @@ # See also code generation logic under /src/google/protobuf/compiler/ruby. load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") +load("//build_defs:internal_shell.bzl", "inline_sh_test") +load("//conformance:defs.bzl", "conformance_test") +load("//:protobuf.bzl", "internal_ruby_proto_library") +load(":internal.bzl", "internal_ruby_extension") + +################################################################################ +# Ruby Runtime +################################################################################ + +config_setting( + name = "java_ruby", + values = {"define": "ruby_platform=java"}, +) + +config_setting( + name = "c_ruby", + values = {"define": "ruby_platform=c"}, +) + +filegroup( + name = "srcs", + srcs = glob([ + "lib/**/*.rb", + "src/**/*.proto", + ]) + [ + "Gemfile", + "Rakefile", + "google-protobuf.gemspec", + "pom.xml", + ], +) + +internal_ruby_extension( + name = "protobuf_c_mac", + extension = "lib/google/protobuf_c.bundle", + deps = glob(["ext/google/protobuf_c/*"]), + target_compatible_with = select({ + ":java_ruby": ["@platforms//:incompatible"], + "//conditions:default": ["@platforms//os:osx"], + }), +) + +internal_ruby_extension( + name = "protobuf_c", + extension = "lib/google/protobuf_c.so", + deps = glob(["ext/google/protobuf_c/*"]), + target_compatible_with = select({ + ":java_ruby": ["@platforms//:incompatible"], + "@platforms//os:osx": ["@platforms//:incompatible"], + "//conditions:default": [], + }), +) + +internal_ruby_extension( + name = "protobuf_java", + extension = "lib/google/protobuf_java.jar", + deps = glob(["src/**/*.java"]), + target_compatible_with = select({ + ":java_ruby": [], + "//conditions:default": ["@platforms//:incompatible"], + }), +) + +filegroup( + name = "protobuf", + srcs = [ + ":srcs", + "//third_party/utf8_range:all_files", + ] + select({ + ":java_ruby": [":protobuf_java"], + "@bazel_tools//src/conditions:darwin": [":protobuf_c_mac"], + "//conditions:default": [":protobuf_c"], + }), + visibility = [ + "//conformance:__subpackages__", + "//ruby:__subpackages__", + ], +) + +################################################################################ +# Tests +################################################################################ + +filegroup( + name = "tests", + srcs = glob(["tests/*.rb"]), +) + +filegroup( + name = "test_protos", + srcs = glob(["tests/*.proto"]), +) + +internal_ruby_proto_library( + name = "test_ruby_protos", + srcs = [":test_protos"], + proto_deps = ["//:well_known_protos"], + includes = [".", "src", "ruby/tests"], +) + +inline_sh_test( + name = "test", + srcs = [ + "Rakefile", + ], + deps = [ + ":protobuf", + ":test_ruby_protos", + ":tests", + "//:well_known_ruby_protos", + ], + cmd = """ + pushd `dirname $(location Rakefile)` + RUBYLIB=../src:tests:. BAZEL=true rake test + popd + """, +) + +inline_sh_test( + name = "gc_test", + srcs = [ + "Rakefile", + ], + deps = [ + ":protobuf", + ":test_ruby_protos", + ":tests", + "//:well_known_ruby_protos", + ], + cmd = """ + pushd `dirname $(location Rakefile)` + RUBYLIB=../src:tests:. BAZEL=true rake gc_test + popd + """, +) + +conformance_test( + name = "conformance_test", + failure_list = "//conformance:failure_list_ruby.txt", + testee = "//conformance:conformance_ruby", + text_format_failure_list = "//conformance:text_format_failure_list_ruby.txt", + target_compatible_with = select({ + ":java_ruby": ["@platforms//:incompatible"], + "//conditions:default": [], + }), +) + +conformance_test( + name = "conformance_test_jruby", + failure_list = "//conformance:failure_list_jruby.txt", + testee = "//conformance:conformance_ruby", + text_format_failure_list = "//conformance:text_format_failure_list_jruby.txt", + target_compatible_with = select({ + ":java_ruby": [], + "//conditions:default": ["@platforms//:incompatible"], + }), +) + +################################################################################ +# Distribution files +################################################################################ pkg_files( name = "dist_files", srcs = glob([ - "compatibility_tests/v3.0.0/**/*", - "ext/google/protobuf_c/*", - "src/main/java/com/google/protobuf/jruby/*.java", "tests/*.proto", "tests/*.rb", ]) + [ + ":srcs", ".gitignore", "BUILD.bazel", + "internal.bzl", "Gemfile", "README.md", - "Rakefile", - "google-protobuf.gemspec", - "lib/google/protobuf.rb", - "lib/google/protobuf/descriptor_dsl.rb", - "lib/google/protobuf/message_exts.rb", - "lib/google/protobuf/repeated_field.rb", - "lib/google/protobuf/well_known_types.rb", - "pom.xml", - "src/main/java/google/ProtobufJavaService.java", - "src/main/sentinel.proto", "travis-test.sh", ], strip_prefix = strip_prefix.from_root(""), diff --git a/ruby/Rakefile b/ruby/Rakefile index d8ac763e09..89a00e1ddb 100644 --- a/ruby/Rakefile +++ b/ruby/Rakefile @@ -39,8 +39,8 @@ proto2_protos = %w[ if !ENV['PROTOC'].nil? protoc_command = ENV['PROTOC'] -elsif system('../src/protoc --version') - protoc_command = '../src/protoc' +elsif system('../bazel-bin/protoc --version') + protoc_command = '../bazel-bin/protoc' else protoc_command = 'protoc' end @@ -49,7 +49,7 @@ genproto_output = [] # We won't have access to .. from within docker, but the proto files # will be there, thanks to the :genproto rule dependency for gem:native. -unless ENV['IN_DOCKER'] == 'true' +unless ENV['IN_DOCKER'] == 'true' or ENV['BAZEL'] == 'true' well_known_protos.each do |proto_file| input_file = "../src/" + proto_file output_file = "lib/" + proto_file.sub(/\.proto$/, "_pb.rb") @@ -153,13 +153,15 @@ end Gem::PackageTask.new(spec) do |pkg| end -Rake::TestTask.new(:test => [:build, :genproto]) do |t| +# Skip build/genproto in Bazel builds, where we expect this to +# be done already. +Rake::TestTask.new(:test => ENV['BAZEL'] == 'true' ? [] : [:build, :genproto]) do |t| t.test_files = FileList["tests/*.rb"].exclude("tests/gc_test.rb", "tests/common_tests.rb") end # gc_test needs to be split out to ensure the generated file hasn't been # imported by other tests. -Rake::TestTask.new(:gc_test => :build) do |t| +Rake::TestTask.new(:gc_test => ENV['BAZEL'] == 'true' ? [] : :build) do |t| t.test_files = FileList["tests/gc_test.rb"] end diff --git a/ruby/compatibility_tests/v3.0.0/BUILD.bazel b/ruby/compatibility_tests/v3.0.0/BUILD.bazel new file mode 100644 index 0000000000..b5fcede943 --- /dev/null +++ b/ruby/compatibility_tests/v3.0.0/BUILD.bazel @@ -0,0 +1,56 @@ +load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") +load("//build_defs:internal_shell.bzl", "inline_sh_test") +load("//:protobuf.bzl", "internal_ruby_proto_library") + +filegroup( + name = "tests", + srcs = glob(["tests/*.rb"]), +) + +filegroup( + name = "test_protos", + srcs = glob(["tests/*.proto"]), +) + +internal_ruby_proto_library( + name = "test_ruby_protos", + srcs = [":test_protos"], + includes = ["."], +) + +inline_sh_test( + name = "test", + srcs = [ + "Rakefile", + ], + deps = [ + ":test_ruby_protos", + ":tests", + "//:well_known_ruby_protos", + "//ruby:protobuf", + ], + cmd = """ + pushd `dirname $(location Rakefile)` + RUBYLIB=.:tests:../../lib:../../../src BAZEL=true rake test + popd + """, +) + +################################################################################ +# Distribution files +############################################################################ + +pkg_files( + name = "dist_files", + srcs = glob([ + "**/*.rb", + "**/*.proto" + ]) + [ + "BUILD.bazel", + "Rakefile", + "README.md", + "test.sh", + ], + strip_prefix = strip_prefix.from_root(""), + visibility = ["//pkg:__pkg__"], +) diff --git a/ruby/compatibility_tests/v3.0.0/Rakefile b/ruby/compatibility_tests/v3.0.0/Rakefile index 19a4ba1280..f72bed2249 100644 --- a/ruby/compatibility_tests/v3.0.0/Rakefile +++ b/ruby/compatibility_tests/v3.0.0/Rakefile @@ -2,14 +2,17 @@ require "rake/testtask" # Proto for tests. genproto_output = [] -genproto_output << "tests/generated_code.rb" -genproto_output << "tests/test_import.rb" -file "tests/generated_code.rb" => "tests/generated_code.proto" do |file_task| - sh "./protoc --ruby_out=. tests/generated_code.proto" -end -file "tests/test_import.rb" => "tests/test_import.proto" do |file_task| - sh "./protoc --ruby_out=. tests/test_import.proto" +unless ENV['BAZEL'] == 'true' + genproto_output << "tests/generated_code.rb" + genproto_output << "tests/test_import.rb" + file "tests/generated_code.rb" => "tests/generated_code.proto" do |file_task| + sh "./protoc --ruby_out=. tests/generated_code.proto" + end + + file "tests/test_import.rb" => "tests/test_import.proto" do |file_task| + sh "./protoc --ruby_out=. tests/test_import.proto" + end end task :genproto => genproto_output diff --git a/ruby/ext/google/protobuf_c/extconf.rb b/ruby/ext/google/protobuf_c/extconf.rb index 8bc96ae84a..5cc45337b8 100755 --- a/ruby/ext/google/protobuf_c/extconf.rb +++ b/ruby/ext/google/protobuf_c/extconf.rb @@ -25,4 +25,4 @@ $srcs = ["protobuf.c", "convert.c", "defs.c", "message.c", "repeated_field.c", "map.c", "ruby-upb.c", "wrap_memcpy.c", "naive.c", "range2-neon.c", "range2-sse.c"] -create_makefile(ext_name) +create_makefile(ext_name, Dir.pwd+"/../../../../ext/google/protobuf_c") diff --git a/ruby/internal.bzl b/ruby/internal.bzl new file mode 100644 index 0000000000..74a2d10ef8 --- /dev/null +++ b/ruby/internal.bzl @@ -0,0 +1,35 @@ +def internal_ruby_extension( + name, + extension, + deps = [], + **kwargs): + """Bazel rule to wrap up a generated ruby extension. + + NOTE: the rule is only an internal workaround. The interface may change and + the rule may be removed when everything is properly "Bazelified". + + Args: + name: the name of the target. + extension: the path of the extension file. + deps: extra dependencies to add. + **kwargs: extra arguments to forward to the genrule. + """ + + + native.genrule( + name = name, + srcs = deps + [ + "Rakefile", + ":srcs", + ":test_ruby_protos", + ":tests", + "//third_party/utf8_range:all_files", + ], + tags = ["manual"], + outs = [extension], + cmd = "pushd `dirname $(location Rakefile)`\n" + + "BAZEL=true rake\n" + + "popd\n" + + "cp `dirname $(location Rakefile)`/%s $(OUTS)\n" % extension, + **kwargs, + ) diff --git a/ruby/tests/ruby_version.rb b/ruby/tests/ruby_version.rb new file mode 100644 index 0000000000..eb98960248 --- /dev/null +++ b/ruby/tests/ruby_version.rb @@ -0,0 +1,33 @@ +#!/usr/bin/ruby + +# Test that Kokoro is using the expected version of ruby. + +require 'test/unit' + +class RubyVersionTest < Test::Unit::TestCase + + def test_ruby_version + return if RUBY_PLATFORM == "java" + if not ENV["KOKORO_RUBY_VERSION"] + STDERR.puts("No kokoro ruby version found, skipping check") + return + end + + actual = RUBY_VERSION + expected = ENV["KOKORO_RUBY_VERSION"].delete_prefix("ruby-") + assert actual.start_with?(expected), "Version #{actual} found, expecting #{expected}" + end + + def test_jruby_version + return if RUBY_PLATFORM != "java" + if not ENV["KOKORO_RUBY_VERSION"] + STDERR.puts("No kokoro ruby version found, skipping check") + return + end + + expected = ENV["KOKORO_RUBY_VERSION"].delete_prefix("jruby-") + actual = JRUBY_VERSION + assert actual.start_with?(expected), "Version #{actual} found, expecting #{expected}" + end + +end diff --git a/ruby/travis-test.sh b/ruby/travis-test.sh index f7fa8155ec..6e9c612380 100755 --- a/ruby/travis-test.sh +++ b/ruby/travis-test.sh @@ -5,8 +5,12 @@ set -ex test_version() { version=$1 - - RUBY_CONFORMANCE=test_ruby + bazel_args=" \ + -k --test_output=streamed \ + --action_env=PATH \ + --action_env=GEM_PATH \ + --action_env=GEM_HOME \ + --test_env=KOKORO_RUBY_VERSION=$version" if [[ $version == jruby-9* ]] ; then bash --login -c \ @@ -14,21 +18,14 @@ test_version() { which ruby && \ git clean -f && \ gem install --no-document bundler && bundle && \ - rake test && \ - rake gc_test && \ - cd ../conformance && make test_jruby && \ - cd ../ruby/compatibility_tests/v3.0.0 && ./test.sh" + bazel test //ruby/... $bazel_args --define=ruby_platform=java" else bash --login -c \ "rvm install $version && rvm use $version && \ which ruby && \ git clean -f && \ gem install --no-document bundler -v 1.17.3 && bundle && \ - rake test && \ - rake gc_test && \ - cd ../conformance && make ${RUBY_CONFORMANCE} && \ - cd ../ruby/compatibility_tests/v3.0.0 && \ - cp -R ../../lib lib && ./test.sh" + bazel test //ruby/... $bazel_args --define=ruby_platform=c" fi } diff --git a/src/BUILD.bazel b/src/BUILD.bazel index bd43afb8f5..a34c0213c2 100644 --- a/src/BUILD.bazel +++ b/src/BUILD.bazel @@ -4,6 +4,7 @@ # Most rules are under google/protobuf. This package exists for convenience. load("@rules_pkg//:mappings.bzl", "pkg_filegroup", "pkg_files", "strip_prefix") +load("//conformance:defs.bzl", "conformance_test") pkg_files( name = "dist_files", @@ -33,3 +34,10 @@ pkg_filegroup( ], visibility = ["//pkg:__pkg__"], ) + +conformance_test( + name = "conformance_test", + failure_list = "//conformance:failure_list_cpp.txt", + testee = "//conformance:conformance_cpp", + text_format_failure_list = "//conformance:text_format_failure_list_cpp.txt", +) diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index dcf43bc8b2..0000000000 --- a/src/Makefile.am +++ /dev/null @@ -1,942 +0,0 @@ -## Process this file with automake to produce Makefile.in - -if HAVE_ZLIB -GZCHECKPROGRAMS = zcgzip zcgunzip -GZHEADERS = google/protobuf/io/gzip_stream.h -GZTESTS = google/protobuf/io/gzip_stream_unittest.sh -ZLIB_DEF = -DHAVE_ZLIB=1 -else -GZCHECKPROGRAMS = -GZHEADERS = -GZTESTS = -ZLIB_DEF = -endif - -if HAVE_PTHREAD -PTHREAD_DEF = -DHAVE_PTHREAD=1 -else -PTHREAD_DEF = -endif - -PROTOBUF_VERSION = 3.21.5 - -if GCC -# Turn on all warnings except for sign comparison (we ignore sign comparison -# in Google so our code base have tons of such warnings). -NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) -Wall -Wno-sign-compare -else -NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) -endif - -AM_CXXFLAGS = $(NO_OPT_CXXFLAGS) $(PROTOBUF_OPT_FLAG) - -AM_LDFLAGS = $(PTHREAD_CFLAGS) ${LIBLOG_LIBS} - -# If I say "dist_include_DATA", automake complains that $(includedir) is not -# a "legitimate" directory for DATA. Screw you, automake. -protodir = $(includedir) - -# If you are adding new files here, also remember to change the build files for -# all other languages, //protoc-artifacts/build-zip.sh and run -# //update_file_list.sh for bazel. -nobase_dist_proto_DATA = \ - google/protobuf/any.proto \ - google/protobuf/api.proto \ - google/protobuf/compiler/plugin.proto \ - google/protobuf/descriptor.proto \ - google/protobuf/duration.proto \ - google/protobuf/empty.proto \ - google/protobuf/field_mask.proto \ - google/protobuf/source_context.proto \ - google/protobuf/struct.proto \ - google/protobuf/timestamp.proto \ - google/protobuf/type.proto \ - google/protobuf/wrappers.proto - -# Not sure why these don't get cleaned automatically. -clean-local: - rm -f *.loT - -CLEANFILES = $(protoc_outputs) unittest_proto_middleman \ - testzip.jar testzip.list testzip.proto testzip.zip \ - no_warning_test.cc - -MAINTAINERCLEANFILES = \ - Makefile.in - -nobase_include_HEADERS = \ - google/protobuf/any.h \ - google/protobuf/any.pb.h \ - google/protobuf/api.pb.h \ - google/protobuf/arena.h \ - google/protobuf/arena_impl.h \ - google/protobuf/arenastring.h \ - google/protobuf/arenaz_sampler.h \ - google/protobuf/compiler/code_generator.h \ - google/protobuf/compiler/command_line_interface.h \ - google/protobuf/compiler/cpp/cpp_generator.h \ - google/protobuf/compiler/cpp/file.h \ - google/protobuf/compiler/cpp/generator.h \ - google/protobuf/compiler/cpp/helpers.h \ - google/protobuf/compiler/cpp/names.h \ - google/protobuf/compiler/csharp/csharp_doc_comment.h \ - google/protobuf/compiler/csharp/csharp_generator.h \ - google/protobuf/compiler/csharp/csharp_names.h \ - google/protobuf/compiler/csharp/csharp_options.h \ - google/protobuf/compiler/importer.h \ - google/protobuf/compiler/java/generator.h \ - google/protobuf/compiler/java/java_generator.h \ - google/protobuf/compiler/java/kotlin_generator.h \ - google/protobuf/compiler/java/names.h \ - google/protobuf/compiler/objectivec/objectivec_generator.h \ - google/protobuf/compiler/objectivec/objectivec_helpers.h \ - google/protobuf/compiler/parser.h \ - google/protobuf/compiler/php/php_generator.h \ - google/protobuf/compiler/plugin.h \ - google/protobuf/compiler/plugin.pb.h \ - google/protobuf/compiler/python/generator.h \ - google/protobuf/compiler/python/pyi_generator.h \ - google/protobuf/compiler/python/python_generator.h \ - google/protobuf/compiler/ruby/ruby_generator.h \ - google/protobuf/descriptor.h \ - google/protobuf/descriptor.pb.h \ - google/protobuf/descriptor_database.h \ - google/protobuf/duration.pb.h \ - google/protobuf/dynamic_message.h \ - google/protobuf/empty.pb.h \ - google/protobuf/endian.h \ - google/protobuf/explicitly_constructed.h \ - google/protobuf/extension_set.h \ - google/protobuf/extension_set_inl.h \ - google/protobuf/field_access_listener.h \ - google/protobuf/field_mask.pb.h \ - google/protobuf/generated_enum_reflection.h \ - google/protobuf/generated_enum_util.h \ - google/protobuf/generated_message_bases.h \ - google/protobuf/generated_message_reflection.h \ - google/protobuf/generated_message_tctable_decl.h \ - google/protobuf/generated_message_tctable_gen.h \ - google/protobuf/generated_message_tctable_impl.h \ - google/protobuf/generated_message_util.h \ - google/protobuf/has_bits.h \ - google/protobuf/implicit_weak_message.h \ - google/protobuf/inlined_string_field.h \ - google/protobuf/io/coded_stream.h \ - $(GZHEADERS) \ - google/protobuf/io/io_win32.h \ - google/protobuf/io/printer.h \ - google/protobuf/io/strtod.h \ - google/protobuf/io/tokenizer.h \ - google/protobuf/io/zero_copy_stream.h \ - google/protobuf/io/zero_copy_stream_impl.h \ - google/protobuf/io/zero_copy_stream_impl_lite.h \ - google/protobuf/map.h \ - google/protobuf/map_entry.h \ - google/protobuf/map_entry_lite.h \ - google/protobuf/map_field.h \ - google/protobuf/map_field_inl.h \ - google/protobuf/map_field_lite.h \ - google/protobuf/map_type_handler.h \ - google/protobuf/message.h \ - google/protobuf/message_lite.h \ - google/protobuf/metadata.h \ - google/protobuf/metadata_lite.h \ - google/protobuf/parse_context.h \ - google/protobuf/port.h \ - google/protobuf/port_def.inc \ - google/protobuf/port_undef.inc \ - google/protobuf/reflection.h \ - google/protobuf/reflection_internal.h \ - google/protobuf/reflection_ops.h \ - google/protobuf/repeated_field.h \ - google/protobuf/repeated_ptr_field.h \ - google/protobuf/service.h \ - google/protobuf/source_context.pb.h \ - google/protobuf/struct.pb.h \ - google/protobuf/stubs/bytestream.h \ - google/protobuf/stubs/callback.h \ - google/protobuf/stubs/casts.h \ - google/protobuf/stubs/common.h \ - google/protobuf/stubs/hash.h \ - google/protobuf/stubs/logging.h \ - google/protobuf/stubs/macros.h \ - google/protobuf/stubs/map_util.h \ - google/protobuf/stubs/mutex.h \ - google/protobuf/stubs/once.h \ - google/protobuf/stubs/platform_macros.h \ - google/protobuf/stubs/port.h \ - google/protobuf/stubs/status.h \ - google/protobuf/stubs/stl_util.h \ - google/protobuf/stubs/stringpiece.h \ - google/protobuf/stubs/strutil.h \ - google/protobuf/stubs/template_util.h \ - google/protobuf/text_format.h \ - google/protobuf/timestamp.pb.h \ - google/protobuf/type.pb.h \ - google/protobuf/unknown_field_set.h \ - google/protobuf/util/delimited_message_util.h \ - google/protobuf/util/field_comparator.h \ - google/protobuf/util/field_mask_util.h \ - google/protobuf/util/json_util.h \ - google/protobuf/util/zero_copy_sink.h \ - google/protobuf/util/message_differencer.h \ - google/protobuf/util/time_util.h \ - google/protobuf/util/type_resolver.h \ - google/protobuf/util/type_resolver_util.h \ - google/protobuf/wire_format.h \ - google/protobuf/wire_format_lite.h \ - google/protobuf/wrappers.pb.h - -lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la - -libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS) $(LIBATOMIC_LIBS) -libprotobuf_lite_la_LDFLAGS = -release $(PROTOBUF_VERSION) -export-dynamic -no-undefined -if HAVE_LD_VERSION_SCRIPT -libprotobuf_lite_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf-lite.map -EXTRA_libprotobuf_lite_la_DEPENDENCIES = libprotobuf-lite.map -endif -libprotobuf_lite_la_SOURCES = \ - google/protobuf/any_lite.cc \ - google/protobuf/arena.cc \ - google/protobuf/arenastring.cc \ - google/protobuf/arenaz_sampler.cc \ - google/protobuf/extension_set.cc \ - google/protobuf/generated_enum_util.cc \ - google/protobuf/generated_message_tctable_lite.cc \ - google/protobuf/generated_message_util.cc \ - google/protobuf/implicit_weak_message.cc \ - google/protobuf/inlined_string_field.cc \ - google/protobuf/io/coded_stream.cc \ - google/protobuf/io/io_win32.cc \ - google/protobuf/io/strtod.cc \ - google/protobuf/io/zero_copy_stream.cc \ - google/protobuf/io/zero_copy_stream_impl.cc \ - google/protobuf/io/zero_copy_stream_impl_lite.cc \ - google/protobuf/map.cc \ - google/protobuf/message_lite.cc \ - google/protobuf/parse_context.cc \ - google/protobuf/repeated_field.cc \ - google/protobuf/repeated_ptr_field.cc \ - google/protobuf/string_member_robber.h \ - google/protobuf/stubs/bytestream.cc \ - google/protobuf/stubs/common.cc \ - google/protobuf/stubs/int128.cc \ - google/protobuf/stubs/int128.h \ - google/protobuf/stubs/mathutil.h \ - google/protobuf/stubs/status.cc \ - google/protobuf/stubs/status_macros.h \ - google/protobuf/stubs/statusor.cc \ - google/protobuf/stubs/statusor.h \ - google/protobuf/stubs/stringpiece.cc \ - google/protobuf/stubs/stringprintf.cc \ - google/protobuf/stubs/stringprintf.h \ - google/protobuf/stubs/structurally_valid.cc \ - google/protobuf/stubs/strutil.cc \ - google/protobuf/stubs/time.cc \ - google/protobuf/stubs/time.h \ - google/protobuf/wire_format_lite.cc - -libprotobuf_la_LIBADD = $(PTHREAD_LIBS) $(LIBATOMIC_LIBS) -libprotobuf_la_LDFLAGS = -release $(PROTOBUF_VERSION) -export-dynamic -no-undefined -if HAVE_LD_VERSION_SCRIPT -libprotobuf_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf.map -EXTRA_libprotobuf_la_DEPENDENCIES = libprotobuf.map -endif -libprotobuf_la_SOURCES = \ - $(libprotobuf_lite_la_SOURCES) \ - google/protobuf/any.cc \ - google/protobuf/any.pb.cc \ - google/protobuf/api.pb.cc \ - google/protobuf/compiler/importer.cc \ - google/protobuf/compiler/parser.cc \ - google/protobuf/descriptor.cc \ - google/protobuf/descriptor.pb.cc \ - google/protobuf/descriptor_database.cc \ - google/protobuf/duration.pb.cc \ - google/protobuf/dynamic_message.cc \ - google/protobuf/empty.pb.cc \ - google/protobuf/extension_set_heavy.cc \ - google/protobuf/field_mask.pb.cc \ - google/protobuf/generated_message_bases.cc \ - google/protobuf/generated_message_reflection.cc \ - google/protobuf/generated_message_tctable_gen.cc \ - google/protobuf/generated_message_tctable_full.cc \ - google/protobuf/io/gzip_stream.cc \ - google/protobuf/io/printer.cc \ - google/protobuf/io/tokenizer.cc \ - google/protobuf/map_field.cc \ - google/protobuf/message.cc \ - google/protobuf/reflection_ops.cc \ - google/protobuf/service.cc \ - google/protobuf/source_context.pb.cc \ - google/protobuf/struct.pb.cc \ - google/protobuf/stubs/substitute.cc \ - google/protobuf/stubs/substitute.h \ - google/protobuf/text_format.cc \ - google/protobuf/timestamp.pb.cc \ - google/protobuf/type.pb.cc \ - google/protobuf/unknown_field_set.cc \ - google/protobuf/util/delimited_message_util.cc \ - google/protobuf/util/field_comparator.cc \ - google/protobuf/util/field_mask_util.cc \ - google/protobuf/util/internal/constants.h \ - google/protobuf/util/internal/datapiece.cc \ - google/protobuf/util/internal/datapiece.h \ - google/protobuf/util/internal/default_value_objectwriter.cc \ - google/protobuf/util/internal/default_value_objectwriter.h \ - google/protobuf/util/internal/error_listener.cc \ - google/protobuf/util/internal/error_listener.h \ - google/protobuf/util/internal/expecting_objectwriter.h \ - google/protobuf/util/internal/field_mask_utility.cc \ - google/protobuf/util/internal/field_mask_utility.h \ - google/protobuf/util/internal/json_escaping.cc \ - google/protobuf/util/internal/json_escaping.h \ - google/protobuf/util/internal/json_objectwriter.cc \ - google/protobuf/util/internal/json_objectwriter.h \ - google/protobuf/util/internal/json_stream_parser.cc \ - google/protobuf/util/internal/json_stream_parser.h \ - google/protobuf/util/internal/location_tracker.h \ - google/protobuf/util/internal/mock_error_listener.h \ - google/protobuf/util/internal/object_location_tracker.h \ - google/protobuf/util/internal/object_source.h \ - google/protobuf/util/internal/object_writer.cc \ - google/protobuf/util/internal/object_writer.h \ - google/protobuf/util/internal/proto_writer.cc \ - google/protobuf/util/internal/proto_writer.h \ - google/protobuf/util/internal/protostream_objectsource.cc \ - google/protobuf/util/internal/protostream_objectsource.h \ - google/protobuf/util/internal/protostream_objectwriter.cc \ - google/protobuf/util/internal/protostream_objectwriter.h \ - google/protobuf/util/internal/structured_objectwriter.h \ - google/protobuf/util/internal/type_info.cc \ - google/protobuf/util/internal/type_info.h \ - google/protobuf/util/internal/type_info_test_helper.h \ - google/protobuf/util/internal/utility.cc \ - google/protobuf/util/internal/utility.h \ - google/protobuf/util/json_util.cc \ - google/protobuf/util/zero_copy_sink.cc \ - google/protobuf/util/message_differencer.cc \ - google/protobuf/util/time_util.cc \ - google/protobuf/util/type_resolver_util.cc \ - google/protobuf/wire_format.cc \ - google/protobuf/wrappers.pb.cc - -nodist_libprotobuf_la_SOURCES = $(nodist_libprotobuf_lite_la_SOURCES) - -libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la -libprotoc_la_LDFLAGS = -release $(PROTOBUF_VERSION) -export-dynamic -no-undefined -if HAVE_LD_VERSION_SCRIPT -libprotoc_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotoc.map -EXTRA_libprotoc_la_DEPENDENCIES = libprotoc.map -endif -libprotoc_la_SOURCES = \ - google/protobuf/compiler/code_generator.cc \ - google/protobuf/compiler/command_line_interface.cc \ - google/protobuf/compiler/cpp/enum.cc \ - google/protobuf/compiler/cpp/enum.h \ - google/protobuf/compiler/cpp/enum_field.cc \ - google/protobuf/compiler/cpp/enum_field.h \ - google/protobuf/compiler/cpp/extension.cc \ - google/protobuf/compiler/cpp/extension.h \ - google/protobuf/compiler/cpp/field.cc \ - google/protobuf/compiler/cpp/field.h \ - google/protobuf/compiler/cpp/file.cc \ - google/protobuf/compiler/cpp/generator.cc \ - google/protobuf/compiler/cpp/helpers.cc \ - google/protobuf/compiler/cpp/map_field.cc \ - google/protobuf/compiler/cpp/map_field.h \ - google/protobuf/compiler/cpp/message.cc \ - google/protobuf/compiler/cpp/message.h \ - google/protobuf/compiler/cpp/message_field.cc \ - google/protobuf/compiler/cpp/message_field.h \ - google/protobuf/compiler/cpp/message_layout_helper.h \ - google/protobuf/compiler/cpp/options.h \ - google/protobuf/compiler/cpp/padding_optimizer.cc \ - google/protobuf/compiler/cpp/padding_optimizer.h \ - google/protobuf/compiler/cpp/parse_function_generator.cc \ - google/protobuf/compiler/cpp/parse_function_generator.h \ - google/protobuf/compiler/cpp/primitive_field.cc \ - google/protobuf/compiler/cpp/primitive_field.h \ - google/protobuf/compiler/cpp/service.cc \ - google/protobuf/compiler/cpp/service.h \ - google/protobuf/compiler/cpp/string_field.cc \ - google/protobuf/compiler/cpp/string_field.h \ - google/protobuf/compiler/csharp/csharp_doc_comment.cc \ - google/protobuf/compiler/csharp/csharp_enum.cc \ - google/protobuf/compiler/csharp/csharp_enum.h \ - google/protobuf/compiler/csharp/csharp_enum_field.cc \ - google/protobuf/compiler/csharp/csharp_enum_field.h \ - google/protobuf/compiler/csharp/csharp_field_base.cc \ - google/protobuf/compiler/csharp/csharp_field_base.h \ - google/protobuf/compiler/csharp/csharp_generator.cc \ - google/protobuf/compiler/csharp/csharp_helpers.cc \ - google/protobuf/compiler/csharp/csharp_helpers.h \ - google/protobuf/compiler/csharp/csharp_map_field.cc \ - google/protobuf/compiler/csharp/csharp_map_field.h \ - google/protobuf/compiler/csharp/csharp_message.cc \ - google/protobuf/compiler/csharp/csharp_message.h \ - google/protobuf/compiler/csharp/csharp_message_field.cc \ - google/protobuf/compiler/csharp/csharp_message_field.h \ - google/protobuf/compiler/csharp/csharp_primitive_field.cc \ - google/protobuf/compiler/csharp/csharp_primitive_field.h \ - google/protobuf/compiler/csharp/csharp_reflection_class.cc \ - google/protobuf/compiler/csharp/csharp_reflection_class.h \ - google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc \ - google/protobuf/compiler/csharp/csharp_repeated_enum_field.h \ - google/protobuf/compiler/csharp/csharp_repeated_message_field.cc \ - google/protobuf/compiler/csharp/csharp_repeated_message_field.h \ - google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc \ - google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h \ - google/protobuf/compiler/csharp/csharp_source_generator_base.cc \ - google/protobuf/compiler/csharp/csharp_source_generator_base.h \ - google/protobuf/compiler/csharp/csharp_wrapper_field.cc \ - google/protobuf/compiler/csharp/csharp_wrapper_field.h \ - google/protobuf/compiler/java/context.cc \ - google/protobuf/compiler/java/context.h \ - google/protobuf/compiler/java/doc_comment.cc \ - google/protobuf/compiler/java/doc_comment.h \ - google/protobuf/compiler/java/enum.cc \ - google/protobuf/compiler/java/enum.h \ - google/protobuf/compiler/java/enum_field.cc \ - google/protobuf/compiler/java/enum_field.h \ - google/protobuf/compiler/java/enum_field_lite.cc \ - google/protobuf/compiler/java/enum_field_lite.h \ - google/protobuf/compiler/java/enum_lite.cc \ - google/protobuf/compiler/java/enum_lite.h \ - google/protobuf/compiler/java/extension.cc \ - google/protobuf/compiler/java/extension.h \ - google/protobuf/compiler/java/extension_lite.cc \ - google/protobuf/compiler/java/extension_lite.h \ - google/protobuf/compiler/java/field.cc \ - google/protobuf/compiler/java/field.h \ - google/protobuf/compiler/java/file.cc \ - google/protobuf/compiler/java/file.h \ - google/protobuf/compiler/java/generator.cc \ - google/protobuf/compiler/java/generator_factory.cc \ - google/protobuf/compiler/java/generator_factory.h \ - google/protobuf/compiler/java/helpers.cc \ - google/protobuf/compiler/java/helpers.h \ - google/protobuf/compiler/java/kotlin_generator.cc \ - google/protobuf/compiler/java/map_field.cc \ - google/protobuf/compiler/java/map_field.h \ - google/protobuf/compiler/java/map_field_lite.cc \ - google/protobuf/compiler/java/map_field_lite.h \ - google/protobuf/compiler/java/message.cc \ - google/protobuf/compiler/java/message.h \ - google/protobuf/compiler/java/message_builder.cc \ - google/protobuf/compiler/java/message_builder.h \ - google/protobuf/compiler/java/message_builder_lite.cc \ - google/protobuf/compiler/java/message_builder_lite.h \ - google/protobuf/compiler/java/message_field.cc \ - google/protobuf/compiler/java/message_field.h \ - google/protobuf/compiler/java/message_field_lite.cc \ - google/protobuf/compiler/java/message_field_lite.h \ - google/protobuf/compiler/java/message_lite.cc \ - google/protobuf/compiler/java/message_lite.h \ - google/protobuf/compiler/java/message_serialization.cc \ - google/protobuf/compiler/java/message_serialization.h \ - google/protobuf/compiler/java/name_resolver.cc \ - google/protobuf/compiler/java/name_resolver.h \ - google/protobuf/compiler/java/options.h \ - google/protobuf/compiler/java/primitive_field.cc \ - google/protobuf/compiler/java/primitive_field.h \ - google/protobuf/compiler/java/primitive_field_lite.cc \ - google/protobuf/compiler/java/primitive_field_lite.h \ - google/protobuf/compiler/java/service.cc \ - google/protobuf/compiler/java/service.h \ - google/protobuf/compiler/java/shared_code_generator.cc \ - google/protobuf/compiler/java/shared_code_generator.h \ - google/protobuf/compiler/java/string_field.cc \ - google/protobuf/compiler/java/string_field.h \ - google/protobuf/compiler/java/string_field_lite.cc \ - google/protobuf/compiler/java/string_field_lite.h \ - google/protobuf/compiler/objectivec/objectivec_enum.cc \ - google/protobuf/compiler/objectivec/objectivec_enum.h \ - google/protobuf/compiler/objectivec/objectivec_enum_field.cc \ - google/protobuf/compiler/objectivec/objectivec_enum_field.h \ - google/protobuf/compiler/objectivec/objectivec_extension.cc \ - google/protobuf/compiler/objectivec/objectivec_extension.h \ - google/protobuf/compiler/objectivec/objectivec_field.cc \ - google/protobuf/compiler/objectivec/objectivec_field.h \ - google/protobuf/compiler/objectivec/objectivec_file.cc \ - google/protobuf/compiler/objectivec/objectivec_file.h \ - google/protobuf/compiler/objectivec/objectivec_generator.cc \ - google/protobuf/compiler/objectivec/objectivec_helpers.cc \ - google/protobuf/compiler/objectivec/objectivec_map_field.cc \ - google/protobuf/compiler/objectivec/objectivec_map_field.h \ - google/protobuf/compiler/objectivec/objectivec_message.cc \ - google/protobuf/compiler/objectivec/objectivec_message.h \ - google/protobuf/compiler/objectivec/objectivec_message_field.cc \ - google/protobuf/compiler/objectivec/objectivec_message_field.h \ - google/protobuf/compiler/objectivec/objectivec_nsobject_methods.h \ - google/protobuf/compiler/objectivec/objectivec_oneof.cc \ - google/protobuf/compiler/objectivec/objectivec_oneof.h \ - google/protobuf/compiler/objectivec/objectivec_primitive_field.cc \ - google/protobuf/compiler/objectivec/objectivec_primitive_field.h \ - google/protobuf/compiler/php/php_generator.cc \ - google/protobuf/compiler/plugin.cc \ - google/protobuf/compiler/plugin.pb.cc \ - google/protobuf/compiler/python/generator.cc \ - google/protobuf/compiler/python/helpers.cc \ - google/protobuf/compiler/python/helpers.h \ - google/protobuf/compiler/python/pyi_generator.cc \ - google/protobuf/compiler/ruby/ruby_generator.cc \ - google/protobuf/compiler/scc.h \ - google/protobuf/compiler/subprocess.cc \ - google/protobuf/compiler/subprocess.h \ - google/protobuf/compiler/zip_writer.cc \ - google/protobuf/compiler/zip_writer.h - -bin_PROGRAMS = protoc -protoc_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la -protoc_SOURCES = google/protobuf/compiler/main.cc - -# Tests ============================================================== - -protoc_inputs = \ - google/protobuf/any_test.proto \ - google/protobuf/compiler/cpp/test_bad_identifiers.proto \ - google/protobuf/compiler/cpp/test_large_enum_value.proto \ - google/protobuf/map_lite_unittest.proto \ - google/protobuf/map_proto2_unittest.proto \ - google/protobuf/map_unittest.proto \ - google/protobuf/unittest.proto \ - google/protobuf/unittest_arena.proto \ - google/protobuf/unittest_custom_options.proto \ - google/protobuf/unittest_drop_unknown_fields.proto \ - google/protobuf/unittest_embed_optimize_for.proto \ - google/protobuf/unittest_empty.proto \ - google/protobuf/unittest_enormous_descriptor.proto \ - google/protobuf/unittest_import.proto \ - google/protobuf/unittest_import_lite.proto \ - google/protobuf/unittest_import_public.proto \ - google/protobuf/unittest_import_public_lite.proto \ - google/protobuf/unittest_lazy_dependencies.proto \ - google/protobuf/unittest_lazy_dependencies_custom_option.proto \ - google/protobuf/unittest_lazy_dependencies_enum.proto \ - google/protobuf/unittest_lite.proto \ - google/protobuf/unittest_lite_imports_nonlite.proto \ - google/protobuf/unittest_mset.proto \ - google/protobuf/unittest_mset_wire_format.proto \ - google/protobuf/unittest_no_field_presence.proto \ - google/protobuf/unittest_no_generic_services.proto \ - google/protobuf/unittest_optimize_for.proto \ - google/protobuf/unittest_preserve_unknown_enum.proto \ - google/protobuf/unittest_preserve_unknown_enum2.proto \ - google/protobuf/unittest_proto3.proto \ - google/protobuf/unittest_proto3_arena.proto \ - google/protobuf/unittest_proto3_arena_lite.proto \ - google/protobuf/unittest_proto3_lite.proto \ - google/protobuf/unittest_proto3_optional.proto \ - google/protobuf/unittest_well_known_types.proto \ - google/protobuf/util/internal/testdata/anys.proto \ - google/protobuf/util/internal/testdata/books.proto \ - google/protobuf/util/internal/testdata/default_value.proto \ - google/protobuf/util/internal/testdata/default_value_test.proto \ - 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.proto \ - google/protobuf/util/json_format_proto3.proto \ - google/protobuf/util/message_differencer_unittest.proto - -EXTRA_DIST = \ - $(protoc_inputs) \ - BUILD.bazel \ - README.md \ - file_lists.cmake \ - google/protobuf/BUILD.bazel \ - google/protobuf/compiler/BUILD.bazel \ - google/protobuf/compiler/cpp/BUILD.bazel \ - google/protobuf/compiler/csharp/BUILD.bazel \ - google/protobuf/compiler/java/BUILD.bazel \ - google/protobuf/compiler/objectivec/BUILD.bazel \ - google/protobuf/compiler/package_info.h \ - google/protobuf/compiler/php/BUILD.bazel \ - google/protobuf/compiler/python/BUILD.bazel \ - google/protobuf/compiler/ruby/BUILD.bazel \ - google/protobuf/compiler/ruby/ruby_generated_code.proto \ - google/protobuf/compiler/ruby/ruby_generated_code_pb.rb \ - google/protobuf/compiler/ruby/ruby_generated_code_proto2.proto \ - google/protobuf/compiler/ruby/ruby_generated_code_proto2_import.proto \ - google/protobuf/compiler/ruby/ruby_generated_code_proto2_pb.rb \ - google/protobuf/compiler/ruby/ruby_generated_pkg_explicit.proto \ - google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_legacy.proto \ - google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_legacy_pb.rb \ - google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_pb.rb \ - google/protobuf/compiler/ruby/ruby_generated_pkg_implicit.proto \ - google/protobuf/compiler/ruby/ruby_generated_pkg_implicit_pb.rb \ - google/protobuf/compiler/zip_output_unittest.sh \ - google/protobuf/io/BUILD.bazel \ - google/protobuf/io/gzip_stream.h \ - google/protobuf/io/gzip_stream_unittest.sh \ - google/protobuf/io/package_info.h \ - google/protobuf/package_info.h \ - google/protobuf/stubs/BUILD.bazel \ - google/protobuf/test_messages_proto2.proto \ - google/protobuf/test_messages_proto3.proto \ - google/protobuf/testdata/bad_utf8_string \ - google/protobuf/testdata/golden_message \ - google/protobuf/testdata/golden_message_maps \ - google/protobuf/testdata/golden_message_oneof_implemented \ - google/protobuf/testdata/golden_message_proto3 \ - google/protobuf/testdata/golden_packed_fields_message \ - google/protobuf/testdata/map_test_data.txt \ - google/protobuf/testdata/text_format_unittest_data.txt \ - google/protobuf/testdata/text_format_unittest_data_oneof_implemented.txt \ - google/protobuf/testdata/text_format_unittest_data_pointy.txt \ - google/protobuf/testdata/text_format_unittest_data_pointy_oneof.txt \ - google/protobuf/testdata/text_format_unittest_extensions_data.txt \ - google/protobuf/testdata/text_format_unittest_extensions_data_pointy.txt \ - google/protobuf/testing/BUILD.bazel \ - google/protobuf/util/BUILD.bazel \ - google/protobuf/util/internal/BUILD.bazel \ - google/protobuf/util/package_info.h \ - libprotobuf-lite.map \ - libprotobuf.map \ - libprotoc.map \ - solaris/libstdc++.la - -protoc_lite_outputs = \ - google/protobuf/map_lite_unittest.pb.cc \ - google/protobuf/map_lite_unittest.pb.h \ - google/protobuf/unittest_import_lite.pb.cc \ - google/protobuf/unittest_import_lite.pb.h \ - google/protobuf/unittest_import_public_lite.pb.cc \ - google/protobuf/unittest_import_public_lite.pb.h \ - google/protobuf/unittest_lite.pb.cc \ - google/protobuf/unittest_lite.pb.h - -protoc_outputs = \ - $(protoc_lite_outputs) \ - google/protobuf/any_test.pb.cc \ - google/protobuf/any_test.pb.h \ - google/protobuf/compiler/cpp/test_bad_identifiers.pb.cc \ - google/protobuf/compiler/cpp/test_bad_identifiers.pb.h \ - google/protobuf/compiler/cpp/test_large_enum_value.pb.cc \ - google/protobuf/compiler/cpp/test_large_enum_value.pb.h \ - google/protobuf/map_proto2_unittest.pb.cc \ - google/protobuf/map_proto2_unittest.pb.h \ - google/protobuf/map_unittest.pb.cc \ - google/protobuf/map_unittest.pb.h \ - google/protobuf/unittest.pb.cc \ - google/protobuf/unittest.pb.h \ - google/protobuf/unittest_arena.pb.cc \ - google/protobuf/unittest_arena.pb.h \ - google/protobuf/unittest_custom_options.pb.cc \ - google/protobuf/unittest_custom_options.pb.h \ - google/protobuf/unittest_drop_unknown_fields.pb.cc \ - google/protobuf/unittest_drop_unknown_fields.pb.h \ - google/protobuf/unittest_embed_optimize_for.pb.cc \ - google/protobuf/unittest_embed_optimize_for.pb.h \ - google/protobuf/unittest_empty.pb.cc \ - google/protobuf/unittest_empty.pb.h \ - google/protobuf/unittest_enormous_descriptor.pb.cc \ - google/protobuf/unittest_enormous_descriptor.pb.h \ - google/protobuf/unittest_import.pb.cc \ - google/protobuf/unittest_import.pb.h \ - google/protobuf/unittest_import_public.pb.cc \ - google/protobuf/unittest_import_public.pb.h \ - google/protobuf/unittest_lazy_dependencies.pb.cc \ - google/protobuf/unittest_lazy_dependencies.pb.h \ - google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc \ - google/protobuf/unittest_lazy_dependencies_custom_option.pb.h \ - google/protobuf/unittest_lazy_dependencies_enum.pb.cc \ - google/protobuf/unittest_lazy_dependencies_enum.pb.h \ - google/protobuf/unittest_lite_imports_nonlite.pb.cc \ - google/protobuf/unittest_lite_imports_nonlite.pb.h \ - google/protobuf/unittest_mset.pb.cc \ - google/protobuf/unittest_mset.pb.h \ - google/protobuf/unittest_mset_wire_format.pb.cc \ - google/protobuf/unittest_mset_wire_format.pb.h \ - google/protobuf/unittest_no_field_presence.pb.cc \ - google/protobuf/unittest_no_field_presence.pb.h \ - google/protobuf/unittest_no_generic_services.pb.cc \ - google/protobuf/unittest_no_generic_services.pb.h \ - google/protobuf/unittest_optimize_for.pb.cc \ - google/protobuf/unittest_optimize_for.pb.h \ - google/protobuf/unittest_preserve_unknown_enum.pb.cc \ - google/protobuf/unittest_preserve_unknown_enum.pb.h \ - google/protobuf/unittest_preserve_unknown_enum2.pb.cc \ - google/protobuf/unittest_preserve_unknown_enum2.pb.h \ - google/protobuf/unittest_proto3.pb.cc \ - google/protobuf/unittest_proto3.pb.h \ - google/protobuf/unittest_proto3_arena.pb.cc \ - google/protobuf/unittest_proto3_arena.pb.h \ - google/protobuf/unittest_proto3_arena_lite.pb.cc \ - google/protobuf/unittest_proto3_arena_lite.pb.h \ - google/protobuf/unittest_proto3_lite.pb.cc \ - google/protobuf/unittest_proto3_lite.pb.h \ - google/protobuf/unittest_proto3_optional.pb.cc \ - google/protobuf/unittest_proto3_optional.pb.h \ - google/protobuf/unittest_well_known_types.pb.cc \ - google/protobuf/unittest_well_known_types.pb.h \ - google/protobuf/util/internal/testdata/anys.pb.cc \ - google/protobuf/util/internal/testdata/anys.pb.h \ - google/protobuf/util/internal/testdata/books.pb.cc \ - google/protobuf/util/internal/testdata/books.pb.h \ - google/protobuf/util/internal/testdata/default_value.pb.cc \ - google/protobuf/util/internal/testdata/default_value.pb.h \ - google/protobuf/util/internal/testdata/default_value_test.pb.cc \ - google/protobuf/util/internal/testdata/default_value_test.pb.h \ - google/protobuf/util/internal/testdata/field_mask.pb.cc \ - google/protobuf/util/internal/testdata/field_mask.pb.h \ - google/protobuf/util/internal/testdata/maps.pb.cc \ - google/protobuf/util/internal/testdata/maps.pb.h \ - google/protobuf/util/internal/testdata/oneofs.pb.cc \ - google/protobuf/util/internal/testdata/oneofs.pb.h \ - google/protobuf/util/internal/testdata/proto3.pb.cc \ - google/protobuf/util/internal/testdata/proto3.pb.h \ - google/protobuf/util/internal/testdata/struct.pb.cc \ - google/protobuf/util/internal/testdata/struct.pb.h \ - google/protobuf/util/internal/testdata/timestamp_duration.pb.cc \ - google/protobuf/util/internal/testdata/timestamp_duration.pb.h \ - google/protobuf/util/internal/testdata/wrappers.pb.cc \ - google/protobuf/util/internal/testdata/wrappers.pb.h \ - google/protobuf/util/json_format.pb.cc \ - google/protobuf/util/json_format.pb.h \ - google/protobuf/util/json_format_proto3.pb.cc \ - google/protobuf/util/json_format_proto3.pb.h \ - google/protobuf/util/message_differencer_unittest.pb.cc \ - google/protobuf/util/message_differencer_unittest.pb.h - -if USE_EXTERNAL_PROTOC - -unittest_proto_middleman: $(protoc_inputs) - $(PROTOC) -I$(srcdir) --cpp_out=. $^ - touch unittest_proto_middleman - -else - -# We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is -# relative to srcdir, which may not be the same as the current directory when -# building out-of-tree. -unittest_proto_middleman: protoc$(EXEEXT) $(protoc_inputs) - oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/protoc$(EXEEXT) -I. --cpp_out=$$oldpwd $(protoc_inputs) --experimental_allow_proto3_optional ) - touch unittest_proto_middleman - -endif - -$(protoc_outputs): unittest_proto_middleman - -COMMON_TEST_SOURCES = \ - $(COMMON_LITE_TEST_SOURCES) \ - google/protobuf/compiler/cpp/unittest.h \ - google/protobuf/map_test_util.h \ - google/protobuf/map_test_util.inc \ - google/protobuf/reflection_tester.cc \ - google/protobuf/reflection_tester.h \ - google/protobuf/test_util.cc \ - google/protobuf/test_util.h \ - google/protobuf/test_util.inc \ - google/protobuf/test_util2.h \ - google/protobuf/testing/file.cc \ - google/protobuf/testing/file.h \ - google/protobuf/testing/googletest.cc \ - google/protobuf/testing/googletest.h - -GOOGLETEST_BUILD_DIR=../third_party/googletest/googletest -GOOGLEMOCK_BUILD_DIR=../third_party/googletest/googlemock -GOOGLETEST_SRC_DIR=$(srcdir)/../third_party/googletest/googletest -GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock -check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \ - protobuf-lite-test test_plugin protobuf-lite-arena-test \ - no-warning-test $(GZCHECKPROGRAMS) -protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \ - $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la -protobuf_test_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include \ - -I$(GOOGLEMOCK_SRC_DIR)/include -# Disable optimization for tests unless the user explicitly asked for it, -# since test_util.cc takes forever to compile with optimization (with GCC). -# See configure.ac for more info. -protobuf_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) -protobuf_test_SOURCES = \ - $(COMMON_TEST_SOURCES) \ - google/protobuf/any_test.cc \ - google/protobuf/arena_unittest.cc \ - google/protobuf/arenastring_unittest.cc \ - google/protobuf/arenaz_sampler_test.cc \ - google/protobuf/compiler/annotation_test_util.cc \ - google/protobuf/compiler/annotation_test_util.h \ - google/protobuf/compiler/command_line_interface_unittest.cc \ - google/protobuf/compiler/cpp/bootstrap_unittest.cc \ - google/protobuf/compiler/cpp/message_size_unittest.cc \ - google/protobuf/compiler/cpp/metadata_test.cc \ - google/protobuf/compiler/cpp/move_unittest.cc \ - google/protobuf/compiler/cpp/plugin_unittest.cc \ - google/protobuf/compiler/cpp/unittest.cc \ - google/protobuf/compiler/cpp/unittest.inc \ - google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc \ - google/protobuf/compiler/csharp/csharp_generator_unittest.cc \ - google/protobuf/compiler/importer_unittest.cc \ - google/protobuf/compiler/java/doc_comment_unittest.cc \ - google/protobuf/compiler/java/message_serialization_unittest.cc \ - google/protobuf/compiler/java/plugin_unittest.cc \ - google/protobuf/compiler/mock_code_generator.cc \ - google/protobuf/compiler/mock_code_generator.h \ - google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc \ - google/protobuf/compiler/parser_unittest.cc \ - google/protobuf/compiler/python/plugin_unittest.cc \ - google/protobuf/compiler/ruby/ruby_generator_unittest.cc \ - google/protobuf/descriptor_database_unittest.cc \ - google/protobuf/descriptor_unittest.cc \ - google/protobuf/drop_unknown_fields_test.cc \ - google/protobuf/dynamic_message_unittest.cc \ - google/protobuf/extension_set_unittest.cc \ - google/protobuf/generated_message_reflection_unittest.cc \ - google/protobuf/generated_message_tctable_lite_test.cc \ - google/protobuf/inlined_string_field_unittest.cc \ - google/protobuf/io/coded_stream_unittest.cc \ - google/protobuf/io/io_win32_unittest.cc \ - google/protobuf/io/printer_unittest.cc \ - google/protobuf/io/tokenizer_unittest.cc \ - google/protobuf/io/zero_copy_stream_unittest.cc \ - google/protobuf/map_field_test.cc \ - google/protobuf/map_test.cc \ - google/protobuf/map_test.inc \ - google/protobuf/message_unittest.cc \ - google/protobuf/message_unittest.inc \ - google/protobuf/no_field_presence_test.cc \ - google/protobuf/preserve_unknown_enum_test.cc \ - google/protobuf/proto3_arena_lite_unittest.cc \ - google/protobuf/proto3_arena_unittest.cc \ - google/protobuf/proto3_lite_unittest.cc \ - google/protobuf/proto3_lite_unittest.inc \ - google/protobuf/reflection_ops_unittest.cc \ - google/protobuf/repeated_field_reflection_unittest.cc \ - google/protobuf/repeated_field_unittest.cc \ - google/protobuf/stubs/bytestream_unittest.cc \ - google/protobuf/stubs/common_unittest.cc \ - google/protobuf/stubs/int128_unittest.cc \ - google/protobuf/stubs/status_test.cc \ - google/protobuf/stubs/statusor_test.cc \ - google/protobuf/stubs/stringpiece_unittest.cc \ - google/protobuf/stubs/stringprintf_unittest.cc \ - google/protobuf/stubs/structurally_valid_unittest.cc \ - google/protobuf/stubs/strutil_unittest.cc \ - google/protobuf/stubs/template_util_unittest.cc \ - google/protobuf/stubs/time_test.cc \ - google/protobuf/text_format_unittest.cc \ - google/protobuf/unknown_field_set_unittest.cc \ - google/protobuf/util/delimited_message_util_test.cc \ - google/protobuf/util/field_comparator_test.cc \ - google/protobuf/util/field_mask_util_test.cc \ - google/protobuf/util/internal/default_value_objectwriter_test.cc \ - google/protobuf/util/internal/json_objectwriter_test.cc \ - google/protobuf/util/internal/json_stream_parser_test.cc \ - google/protobuf/util/internal/protostream_objectsource_test.cc \ - google/protobuf/util/internal/protostream_objectwriter_test.cc \ - google/protobuf/util/internal/type_info_test_helper.cc \ - google/protobuf/util/json_util_test.cc \ - google/protobuf/util/zero_copy_sink_test.cc \ - google/protobuf/util/message_differencer_unittest.cc \ - google/protobuf/util/time_util_test.cc \ - google/protobuf/util/type_resolver_util_test.cc \ - google/protobuf/well_known_types_unittest.cc \ - google/protobuf/wire_format_unittest.cc \ - google/protobuf/wire_format_unittest.inc - -nodist_protobuf_test_SOURCES = $(protoc_outputs) -$(am_protobuf_test_OBJECTS): unittest_proto_middleman - -# Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined. -protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \ - libprotoc.la \ - $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la -protobuf_lazy_descriptor_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \ - -I$(GOOGLETEST_SRC_DIR)/include \ - -DPROTOBUF_TEST_NO_DESCRIPTORS -protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) -protobuf_lazy_descriptor_test_SOURCES = \ - google/protobuf/compiler/cpp/unittest.cc \ - $(COMMON_TEST_SOURCES) -nodist_protobuf_lazy_descriptor_test_SOURCES = $(protoc_outputs) -$(am_protobuf_lazy_descriptor_test_OBJECTS): unittest_proto_middleman - -COMMON_LITE_TEST_SOURCES = \ - google/protobuf/arena_test_util.cc \ - google/protobuf/arena_test_util.h \ - google/protobuf/map_lite_test_util.cc \ - google/protobuf/map_lite_test_util.h \ - google/protobuf/map_test_util_impl.h \ - google/protobuf/test_util_lite.cc \ - google/protobuf/test_util_lite.h - -# Build lite_unittest separately, since it doesn't use gtest. It can't -# depend on gtest because our internal version of gtest depend on proto -# full runtime and we want to make sure this test builds without full -# runtime. -protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \ - $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la -protobuf_lite_test_CPPFLAGS= -I$(GOOGLEMOCK_SRC_DIR)/include \ - -I$(GOOGLETEST_SRC_DIR)/include -protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) -protobuf_lite_test_SOURCES = \ - google/protobuf/lite_unittest.cc \ - $(COMMON_LITE_TEST_SOURCES) -nodist_protobuf_lite_test_SOURCES = $(protoc_lite_outputs) -$(am_protobuf_lite_test_OBJECTS): unittest_proto_middleman - -# lite_arena_unittest depends on gtest because teboring@ found that without -# gtest when building the test internally our memory sanitizer doesn't detect -# memory leaks (don't know why). -protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \ - $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \ - $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la -protobuf_lite_arena_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \ - -I$(GOOGLETEST_SRC_DIR)/include -protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) -protobuf_lite_arena_test_SOURCES = \ - google/protobuf/lite_arena_unittest.cc \ - $(COMMON_LITE_TEST_SOURCES) -nodist_protobuf_lite_arena_test_SOURCES = $(protoc_lite_outputs) -$(am_protobuf_lite_arena_test_OBJECTS): unittest_proto_middleman - -# Test plugin binary. -test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \ - $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la -test_plugin_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include -test_plugin_SOURCES = \ - google/protobuf/compiler/mock_code_generator.cc \ - google/protobuf/compiler/test_plugin.cc \ - google/protobuf/testing/file.cc \ - google/protobuf/testing/file.h - -if HAVE_ZLIB -zcgzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la -zcgzip_SOURCES = google/protobuf/testing/zcgzip.cc - -zcgunzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la -zcgunzip_SOURCES = google/protobuf/testing/zcgunzip.cc -endif - -# This test target is to ensure all our public header files and generated -# code is free from warnings. We have to be more pedantic about these -# files because they are compiled by users with different compiler flags. -no_warning_test.cc: - echo "// Generated from Makefile.am" > no_warning_test.cc - for FILE in $(nobase_include_HEADERS); do \ - case $$FILE in *.inc) continue;; esac; \ - echo "#include <$${FILE}>" >> no_warning_test.cc; \ - done - echo "int main(int, char**) { return 0; }" >> no_warning_test.cc - -no_warning_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la -no_warning_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) \ - -Wall -Wextra -Werror -Wno-unused-parameter -nodist_no_warning_test_SOURCES = no_warning_test.cc $(protoc_outputs) - -TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \ - google/protobuf/compiler/zip_output_unittest.sh $(GZTESTS) \ - protobuf-lite-arena-test no-warning-test diff --git a/src/README.md b/src/README.md index cf843d7595..3592f4f272 100644 --- a/src/README.md +++ b/src/README.md @@ -5,26 +5,31 @@ Copyright 2008 Google Inc. https://developers.google.com/protocol-buffers/ -C++ Installation - Unix +CMake Installation +----------------------- + +To compile or install protobuf from source using CMake, see +[cmake/README.md](../cmake/README.md). + +C++ Protobuf - Unix ----------------------- To build protobuf from source, the following tools are needed: - * autoconf - * automake - * libtool - * make + * bazel + * git * g++ - * unzip -On Ubuntu/Debian, you can install them with: +On Ubuntu/Debian, for example, you can install them with: - sudo apt-get install autoconf automake libtool curl make g++ unzip + sudo apt-get install g++ git bazel On other platforms, please use the corresponding package managing tool to -install them before proceeding. +install them before proceeding. See https://bazel.build/install for further +instructions on installing Bazel, or to build from source using CMake, see +[cmake/README.md](../cmake/README.md). -To get the source, download one of the release .tar.gz or .zip packages in the +To get the source, download the release .tar.gz or .zip package in the release page: https://github.com/protocolbuffers/protobuf/releases/latest @@ -41,79 +46,23 @@ if you are using a release .tar.gz or .zip package): git clone https://github.com/protocolbuffers/protobuf.git cd protobuf git submodule update --init --recursive - ./autogen.sh -To build and install the C++ Protocol Buffer runtime and the Protocol -Buffer compiler (protoc) execute the following: +To build the C++ Protocol Buffer runtime and the Protocol Buffer compiler +(protoc) execute the following: + bazel build :protoc :protobuf - ./configure - make -j$(nproc) # $(nproc) ensures it uses all cores for compilation - make check - sudo make install - sudo ldconfig # refresh shared library cache. +The compiler can then be installed, for example on Linux: -If "make check" fails, you can still install, but it is likely that -some features of this library will not work correctly on your system. -Proceed at your own risk. + cp bazel-bin/protoc /usr/local/bin -For advanced usage information on configure and make, please refer to the -autoconf documentation: - - http://www.gnu.org/software/autoconf/manual/autoconf.html#Running-configure-Scripts - -**Hint on install location** - -By default, the package will be installed to /usr/local. However, -on many platforms, /usr/local/lib is not part of LD_LIBRARY_PATH. -You can add it, but it may be easier to just install to /usr -instead. To do this, invoke configure as follows: - - ./configure --prefix=/usr - -If you already built the package with a different prefix, make sure -to run "make clean" before building again. +For more usage information on Bazel, please refer to http://bazel.build. **Compiling dependent packages** -To compile a package that uses Protocol Buffers, you need to pass -various flags to your compiler and linker. As of version 2.2.0, -Protocol Buffers integrates with pkg-config to manage this. If you -have pkg-config installed, then you can invoke it to get a list of -flags like so: - - - pkg-config --cflags protobuf # print compiler flags - pkg-config --libs protobuf # print linker flags - pkg-config --cflags --libs protobuf # print both - - -For example: - - c++ my_program.cc my_proto.pb.cc `pkg-config --cflags --libs protobuf` - -Note that packages written prior to the 2.2.0 release of Protocol -Buffers may not yet integrate with pkg-config to get flags, and may -not pass the correct set of flags to correctly link against -libprotobuf. If the package in question uses autoconf, you can -often fix the problem by invoking its configure script like: - - - configure CXXFLAGS="$(pkg-config --cflags protobuf)" \ - LIBS="$(pkg-config --libs protobuf)" - -This will force it to use the correct flags. - -If you are writing an autoconf-based package that uses Protocol -Buffers, you should probably use the PKG_CHECK_MODULES macro in your -configure script like: - - PKG_CHECK_MODULES([protobuf], [protobuf]) - -See the pkg-config man page for more info. - -If you only want protobuf-lite, substitute "protobuf-lite" in place -of "protobuf" in these examples. +To compile a package that uses Protocol Buffers, you need to setup a Bazel +WORKSPACE that's hooked up to the protobuf repository and loads its +dependencies. For an example, see [WORKSPACE](examples/WORKSPACE). **Note for Mac users** @@ -127,64 +76,16 @@ To install Unix tools, you can install "port" following the instructions at https://www.macports.org . This will reside in /opt/local/bin/port for most Mac installations. - sudo /opt/local/bin/port install autoconf automake libtool + sudo /opt/local/bin/port install bazel Alternative for Homebrew users: - brew install autoconf automake libtool + brew install bazel Then follow the Unix instructions above. -**Note for cross-compiling** -The makefiles normally invoke the protoc executable that they just -built in order to build tests. When cross-compiling, the protoc -executable may not be executable on the host machine. In this case, -you must build a copy of protoc for the host machine first, then use -the --with-protoc option to tell configure to use it instead. For -example: - - ./configure --with-protoc=protoc - -This will use the installed protoc (found in your $PATH) instead of -trying to execute the one built during the build process. You can -also use an executable that hasn't been installed. For example, if -you built the protobuf package for your host machine in ../host, -you might do: - - ./configure --with-protoc=../host/src/protoc - -Either way, you must make sure that the protoc executable you use -has the same version as the protobuf source code you are trying to -use it with. - -**Note for Solaris users** - -Solaris 10 x86 has a bug that will make linking fail, complaining -about libstdc++.la being invalid. We have included a work-around -in this package. To use the work-around, run configure as follows: - - ./configure LDFLAGS=-L$PWD/src/solaris - -See src/solaris/libstdc++.la for more info on this bug. - -**Note for HP C++ Tru64 users** - -To compile invoke configure as follows: - - ./configure CXXFLAGS="-O -std ansi -ieee -D__USE_STD_IOSTREAM" - -Also, you will need to use gmake instead of make. - -**Note for AIX users** - -Compile using the IBM xlC C++ compiler as follows: - - ./configure CXX=xlC - -Also, you will need to use GNU `make` (`gmake`) instead of AIX `make`. - -C++ Installation - Windows +C++ Protobuf - Windows -------------------------- If you only need the protoc binary, you can download it from the release @@ -220,10 +121,10 @@ That is, if you linked an executable against an older version of libprotobuf, it is unlikely to work with a newer version without re-compiling. This problem, when it occurs, will normally be detected immediately on startup of your app. Still, you may want to consider -using static linkage. You can configure this package to install -static libraries only using: +using static linkage. You can configure this in your `cc_binary` Bazel rules +by specifying: - ./configure --disable-shared + linkstatic=True Usage ----- diff --git a/src/google/protobuf/BUILD.bazel b/src/google/protobuf/BUILD.bazel index c65598221b..ac9b420d51 100644 --- a/src/google/protobuf/BUILD.bazel +++ b/src/google/protobuf/BUILD.bazel @@ -458,10 +458,22 @@ proto_library( ], ) +exports_files([ + "test_messages_proto2.proto", + "test_messages_proto3.proto", +], visibility = [ + "//:__pkg__", + "//python:__pkg__", +]) + proto_library( name = "test_messages_proto2_proto", srcs = ["test_messages_proto2.proto"], strip_import_prefix = "/src", + visibility = [ + "//:__pkg__", + "//conformance:__pkg__", + ], ) proto_library( @@ -476,6 +488,10 @@ proto_library( ":timestamp_proto", ":wrappers_proto", ], + visibility = [ + "//:__pkg__", + "//conformance:__pkg__", + ], ) cc_proto_library( diff --git a/src/google/protobuf/compiler/BUILD.bazel b/src/google/protobuf/compiler/BUILD.bazel index 6e5f8da853..e3cb41b0c2 100644 --- a/src/google/protobuf/compiler/BUILD.bazel +++ b/src/google/protobuf/compiler/BUILD.bazel @@ -11,6 +11,7 @@ load( "strip_prefix", ) load("@rules_proto//proto:defs.bzl", "proto_library") +load("//build_defs:arch_tests.bzl", "aarch64_test", "x86_64_test") load("//build_defs:cpp_opts.bzl", "COPTS") proto_library( @@ -115,6 +116,18 @@ alias( visibility = ["//visibility:public"], ) + +# Test that the protoc binary is built for the correct architecture. +aarch64_test( + name = "protoc_aarch64_test", + bazel_binaries = ["//:protoc"], +) + +x86_64_test( + name = "protoc_x86_64_test", + bazel_binaries = ["//:protoc"], +) + ################################################################################ # Tests and support libraries ################################################################################ diff --git a/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc b/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc index 84aacca57e..863e3d5c0b 100644 --- a/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc +++ b/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc @@ -178,12 +178,6 @@ TEST(CsharpBootstrapTest, GeneratedCsharpDescriptorMatches) { "WellKnownTypes/Wrappers.cs", "../csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs"); - generate_test.SetParameter(""); - source_tree.MapPath("", TestSourceDir() + "/../conformance"); - generate_test.Run(importer.Import("conformance.proto"), - "Conformance.cs", - "../csharp/src/Google.Protobuf.Conformance/Conformance.cs"); - EXPECT_EQ("", error_collector.text_); } diff --git a/tests.sh b/tests.sh deleted file mode 100755 index 6508674031..0000000000 --- a/tests.sh +++ /dev/null @@ -1,544 +0,0 @@ -#!/bin/bash -# -# Build and run tests for the protobuf project. We use this script to run -# tests on kokoro (Ubuntu and MacOS). It can run locally as well but you -# need to make sure the required compilers/tools are available. - -internal_build_cpp() { - if [ -f src/protoc ]; then - # Already built. - return - fi - - # Initialize any submodules. - git submodule update --init --recursive - - ./autogen.sh - ./configure CXXFLAGS="-fPIC -std=c++11" # -fPIC is needed for python cpp test. - # See python/setup.py for more details - make -j$(nproc) -} - -build_cpp() { - internal_build_cpp - make check -j$(nproc) || (cat src/test-suite.log; false) - cd conformance && make test_cpp && cd .. - - # The benchmark code depends on cmake, so test if it is installed before - # trying to do the build. - if [[ $(type cmake 2>/dev/null) ]]; then - # Verify benchmarking code can build successfully. - cd benchmarks && make cpp-benchmark && cd .. - else - echo "" - echo "WARNING: Skipping validation of the benchmarking code, cmake isn't installed." - echo "" - fi -} - -build_cpp_tcmalloc() { - internal_build_cpp - ./configure LIBS=-ltcmalloc && make clean && make \ - PTHREAD_CFLAGS='-pthread -DGOOGLE_PROTOBUF_HEAP_CHECK_DRACONIAN' \ - check - cd src - PPROF_PATH=/usr/bin/google-pprof HEAPCHECK=strict ./protobuf-test -} - -build_dist_install() { - # Create a symlink pointing to python2 and put it at the beginning of $PATH. - # This is necessary because the googletest build system involves a Python - # script that is not compatible with Python 3. More recent googletest - # versions have fixed this, but they have also removed the autotools build - # system support that we rely on. This is a temporary workaround to keep the - # googletest build working when the default python binary is Python 3. - mkdir tmp || true - pushd tmp - ln -s /usr/bin/python2 ./python - popd - PATH=$PWD/tmp:$PATH - - # Initialize any submodules. - git submodule update --init --recursive - ./autogen.sh - ./configure - make dist - - # Unzip the dist tar file and install it. - DIST=`ls *.tar.gz` - tar -xf $DIST - pushd ${DIST//.tar.gz} - ./configure && make check -j4 && make install - - export LD_LIBRARY_PATH=/usr/local/lib - - # Try to install Java - pushd java - use_java jdk11 - $MVN install - popd - - # Try to install Python - python3 -m venv venv - source venv/bin/activate - pushd python - python3 setup.py clean build sdist - pip3 install dist/protobuf-*.tar.gz - popd - deactivate - rm -rf python/venv -} - -build_csharp() { - # Required for conformance tests and to regenerate protos. - internal_build_cpp - NUGET=/usr/local/bin/nuget.exe - - # Disable some unwanted dotnet options - export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true - export DOTNET_CLI_TELEMETRY_OPTOUT=true - - # TODO(jtattermusch): is this still needed with "first time experience" - # disabled? - # Perform "dotnet new" once to get the setup preprocessing out of the - # way. That spews a lot of output (including backspaces) into logs - # otherwise, and can cause problems. It doesn't matter if this step - # is performed multiple times; it's cheap after the first time anyway. - # (It also doesn't matter if it's unnecessary, which it will be on some - # systems. It's necessary on Jenkins in order to avoid unprintable - # characters appearing in the JUnit output.) - mkdir dotnettmp - (cd dotnettmp; dotnet new > /dev/null) - rm -rf dotnettmp - - # Check that the protos haven't broken C# codegen. - # TODO(jonskeet): Fail if regenerating creates any changes. - csharp/generate_protos.sh - - csharp/buildall.sh - cd conformance && make test_csharp && cd .. - - # Run csharp compatibility test between 3.0.0 and the current version. - csharp/compatibility_tests/v3.0.0/test.sh 3.0.0 - - # Regression test for https://github.com/protocolbuffers/protobuf/issues/9526 - # - all line endings in .proto and .cs (and .csproj) files should be LF. - if git ls-files --eol csharp | grep -E '\.cs|\.proto' | grep -v w/lf - then - echo "The files listed above have mixed or CRLF line endings; please change to LF." - exit 1 - fi -} - -build_golang() { - # Go build needs `protoc`. - internal_build_cpp - # Add protoc to the path so that the examples build finds it. - export PATH="`pwd`/src:$PATH" - - export GOPATH="$HOME/gocode" - mkdir -p "$GOPATH/src/github.com/protocolbuffers" - mkdir -p "$GOPATH/src/github.com/golang" - rm -f "$GOPATH/src/github.com/protocolbuffers/protobuf" - rm -f "$GOPATH/src/github.com/golang/protobuf" - ln -s "`pwd`" "$GOPATH/src/github.com/protocolbuffers/protobuf" - export PATH="$GOPATH/bin:$PATH" - (cd $GOPATH/src/github.com/golang && git clone https://github.com/golang/protobuf.git && cd protobuf && git checkout v1.3.5) - go install github.com/golang/protobuf/protoc-gen-go - - cd examples && PROTO_PATH="-I../src -I." make gotest && cd .. -} - -use_java() { - version=$1 - case "$version" in - jdk17) - export PATH=/usr/lib/jvm/java-17-openjdk-amd64/bin:$PATH - export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 - ;; - jdk11) - export PATH=/usr/lib/jvm/java-11-openjdk-amd64/bin:$PATH - export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 - ;; - jdk8) - export PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin:$PATH - export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 - ;; - jdk7) - export PATH=/usr/lib/jvm/java-7-openjdk-amd64/bin:$PATH - export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 - ;; - oracle7) - export PATH=/usr/lib/jvm/java-7-oracle/bin:$PATH - export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 - ;; - esac - - MAVEN_LOCAL_REPOSITORY=/var/maven_local_repository - MVN="$MVN -e --quiet -Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$MAVEN_LOCAL_REPOSITORY" - - which java - java -version - $MVN -version -} - -# --batch-mode suppresses download progress output that spams the logs. -MVN="mvn --batch-mode" - -internal_build_java() { - version=$1 - dir=java_$version - # Java build needs `protoc`. - internal_build_cpp - cp -r java $dir - cd $dir && $MVN clean - # Skip tests here - callers will decide what tests they want to run - $MVN install -Dmaven.test.skip=true -} - -build_java() { - version=$1 - internal_build_java $version - # Skip the Kotlin tests on Oracle 7 - if [ "$version" == "oracle7" ]; then - $MVN test -pl bom,lite,core,util - else - $MVN test - fi - cd ../.. -} - -# The conformance tests are hard-coded to work with the $ROOT/java directory -# so this can't run in parallel with two different sets of tests. -build_java_with_conformance_tests() { - # Java build needs `protoc`. - internal_build_cpp - # This local installation avoids the problem caused by a new version not yet in Maven Central - cd java/bom && $MVN install - cd ../.. - cd java/core && $MVN test && $MVN install - cd ../lite && $MVN test && $MVN install - cd ../util && $MVN test && $MVN install && $MVN package assembly:single - if [ "$version" != "jdk7" ]; then - cd ../kotlin && $MVN test && $MVN install - cd ../kotlin-lite && $MVN test && $MVN install - fi - cd ../.. - cd conformance && make test_java && cd .. -} - -build_java_jdk7() { - use_java jdk7 - build_java_with_conformance_tests -} - -build_java_oracle7() { - use_java oracle7 - build_java oracle7 -} - -build_java_jdk8() { - use_java jdk8 - build_java_with_conformance_tests -} - -build_java_jdk11() { - use_java jdk11 - build_java -} - -build_java_jdk17() { - use_java jdk17 - build_java -} - -build_java_linkage_monitor() { - # Linkage Monitor checks compatibility with other Google libraries - # https://github.com/GoogleCloudPlatform/cloud-opensource-java/tree/master/linkage-monitor - - use_java jdk11 - internal_build_cpp - - # Linkage Monitor uses $HOME/.m2 local repository - MVN="mvn -e -B -Dhttps.protocols=TLSv1.2" - cd java - # Installs the snapshot version locally - $MVN install -Dmaven.test.skip=true - - # Linkage Monitor uses the snapshot versions installed in $HOME/.m2 to verify compatibility - JAR=linkage-monitor-latest-all-deps.jar - curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/${JAR}" - # Fails if there's new linkage errors compared with baseline - java -jar $JAR com.google.cloud:libraries-bom -} - -build_objectivec_ios() { - # Reused the build script that takes care of configuring and ensuring things - # are up to date. The OS X test runs the objc conformance test, so skip it - # here. - objectivec/DevTools/full_mac_build.sh \ - --core-only --skip-xcode-osx --skip-xcode-tvos --skip-objc-conformance "$@" -} - -build_objectivec_ios_debug() { - build_objectivec_ios --skip-xcode-release -} - -build_objectivec_ios_release() { - build_objectivec_ios --skip-xcode-debug -} - -build_objectivec_osx() { - # Reused the build script that takes care of configuring and ensuring things - # are up to date. - objectivec/DevTools/full_mac_build.sh \ - --core-only --skip-xcode-ios --skip-xcode-tvos -} - -build_objectivec_tvos() { - # Reused the build script that takes care of configuring and ensuring things - # are up to date. The OS X test runs the objc conformance test, so skip it - # here. - objectivec/DevTools/full_mac_build.sh \ - --core-only --skip-xcode-ios --skip-xcode-osx --skip-objc-conformance "$@" -} - -build_objectivec_tvos_debug() { - build_objectivec_tvos --skip-xcode-release -} - -build_objectivec_tvos_release() { - build_objectivec_tvos --skip-xcode-debug -} - -build_python() { - internal_build_cpp - cd python - tox --skip-missing-interpreters - cd .. -} - -build_python_version() { - internal_build_cpp - cd python - envlist=$1 - tox -e $envlist - cd .. -} - -build_python37() { - build_python_version py37-python -} - -build_python38() { - build_python_version py38-python -} - -build_python39() { - build_python_version py39-python -} - -build_python310() { - build_python_version py310-python -} - -build_python_cpp() { - internal_build_cpp - export LD_LIBRARY_PATH=../src/.libs # for Linux - export DYLD_LIBRARY_PATH=../src/.libs # for OS X - cd python - tox --skip-missing-interpreters - cd .. -} - -build_python_cpp_version() { - internal_build_cpp - export LD_LIBRARY_PATH=../src/.libs # for Linux - export DYLD_LIBRARY_PATH=../src/.libs # for OS X - cd python - envlist=$1 - tox -e $envlist - cd .. -} - -build_python37_cpp() { - build_python_cpp_version py37-cpp -} - -build_python38_cpp() { - build_python_cpp_version py38-cpp -} - -build_python39_cpp() { - build_python_cpp_version py39-cpp -} - -build_python310_cpp() { - build_python_cpp_version py310-cpp -} - -build_ruby23() { - internal_build_cpp # For conformance tests. - cd ruby && bash travis-test.sh ruby-2.3.8 && cd .. -} -build_ruby24() { - internal_build_cpp # For conformance tests. - cd ruby && bash travis-test.sh ruby-2.4 && cd .. -} -build_ruby25() { - internal_build_cpp # For conformance tests. - cd ruby && bash travis-test.sh ruby-2.5.1 && cd .. -} -build_ruby26() { - internal_build_cpp # For conformance tests. - cd ruby && bash travis-test.sh ruby-2.6.0 && cd .. -} -build_ruby27() { - internal_build_cpp # For conformance tests. - cd ruby && bash travis-test.sh ruby-2.7.0 && cd .. -} -build_ruby30() { - internal_build_cpp # For conformance tests. - cd ruby && bash travis-test.sh ruby-3.0.2 && cd .. -} -build_ruby31() { - internal_build_cpp # For conformance tests. - cd ruby && bash travis-test.sh ruby-3.1.0 && cd .. -} - -build_jruby92() { - internal_build_cpp # For conformance tests. - internal_build_java jdk8 && cd .. # For Maven protobuf jar with local changes - cd ruby && bash travis-test.sh jruby-9.2.20.1 && cd .. -} - -build_jruby93() { - internal_build_cpp # For conformance tests. - internal_build_java jdk8 && cd .. # For Maven protobuf jar with local changes - cd ruby && bash travis-test.sh jruby-9.3.4.0 && cd .. -} - -use_php() { - VERSION=$1 - export PATH=/usr/local/php-${VERSION}/bin:$PATH - internal_build_cpp -} - -build_php() { - use_php $1 - pushd php - rm -rf vendor - php -v - php -m - composer update - composer test - popd - (cd conformance && make test_php) -} - -test_php_c() { - pushd php - rm -rf vendor - php -v - php -m - composer update - composer test_c - popd - (cd conformance && make test_php_c) -} - -build_php_c() { - use_php $1 - test_php_c -} - -build_php_mac() { - internal_build_cpp - test_php_c -} - -build_php_compatibility() { - internal_build_cpp -} - -build_php_multirequest() { - use_php 7.4 - php/tests/multirequest.sh -} - -build_php8.0_all() { - build_php 8.0 - build_php 8.1 - build_php_c 8.0 - build_php_c 8.1 -} - -build_php_all_32() { - build_php 7.0 - build_php 7.1 - build_php 7.4 - build_php_c 7.0 - build_php_c 7.1 - build_php_c 7.4 - build_php_c 7.1-zts - build_php_c 7.2-zts - build_php_c 7.5-zts -} - -build_php_all() { - build_php_all_32 - build_php_multirequest - build_php_compatibility -} - -build_benchmark() { - use_php 7.2 - cd kokoro/linux/benchmark && ./run.sh -} - -# -------- main -------- - -if [ "$#" -ne 1 ]; then - echo " -Usage: $0 { cpp | - csharp | - java_jdk7 | - java_oracle7 | - java_jdk8 | - java_jdk11 | - java_jdk17 | - java_linkage_monitor | - objectivec_ios | - objectivec_ios_debug | - objectivec_ios_release | - objectivec_osx | - objectivec_tvos | - objectivec_tvos_debug | - objectivec_tvos_release | - python | - python_cpp | - python_compatibility | - ruby23 | - ruby24 | - ruby25 | - ruby26 | - ruby27 | - ruby30 | - ruby31 | - jruby92 | - jruby93 | - ruby_all | - php_all | - php_all_32 | - php7.0_mac | - php7.3_mac | - dist_install | - benchmark } -" - exit 1 -fi - -set -e # exit immediately on error -set -x # display all commands -cd $(dirname $0) -eval "build_$1" diff --git a/third_party/utf8_range/BUILD.bazel b/third_party/utf8_range/BUILD.bazel index 4a8a82b502..693f390d80 100644 --- a/third_party/utf8_range/BUILD.bazel +++ b/third_party/utf8_range/BUILD.bazel @@ -1,3 +1,4 @@ +load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") # Pulled from: https://github.com/cyb70289/utf8 @@ -13,7 +14,24 @@ cc_library( ) filegroup( - name = "cmake_files", - srcs = glob(["*"]), - visibility = ["//cmake:__pkg__"], + name = "all_files", + srcs = glob([ + "*.h", + "*.c", + ]) + [ + "BUILD.bazel", + "LICENSE", + ], + visibility = [ + "//cmake:__pkg__", + "//php:__pkg__", + "//ruby:__pkg__", + ], +) + +pkg_files( + name = "dist_files", + srcs = [":all_files"], + strip_prefix = strip_prefix.from_root(""), + visibility = ["//pkg:__pkg__"], ) diff --git a/toolchain/toolchains.bazelrc b/toolchain/toolchains.bazelrc index fbd655b279..908a26e12e 100644 --- a/toolchain/toolchains.bazelrc +++ b/toolchain/toolchains.bazelrc @@ -2,9 +2,12 @@ build:cross_config --crosstool_top=//toolchain:clang_suite build:cross_config --host_crosstool_top=@bazel_tools//tools/cpp:toolchain build:linux-aarch_64 --config=cross_config --cpu=linux-aarch_64 +build:linux-aarch64 --config=cross_config --cpu=linux-aarch_64 build:linux-ppcle_64 --config=cross_config --cpu=linux-ppcle_64 +build:linux-ppc64le --config=cross_config --cpu=linux-ppcle_64 build:linux-s390_64 --config=cross_config --cpu=linux-s390_64 build:linux-x86_32 --config=cross_config --cpu=linux-x86_32 +build:linux-i386 --config=cross_config --cpu=linux-x86_32 build:linux-x86_64 --config=cross_config --cpu=linux-x86_64 build:osx-aarch_64 --config=cross_config --action_env=MACOSX_DEPLOYMENT_TARGET=10.9 --cpu=osx-aarch_64 build:osx-x86_64 --config=cross_config --action_env=MACOSX_DEPLOYMENT_TARGET=10.9 --cpu=osx-x86_64 diff --git a/update_compatibility_version.py b/update_compatibility_version.py deleted file mode 100755 index f93479bd76..0000000000 --- a/update_compatibility_version.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python -"""Compatibility tests between last released and the current version. - -Usage: ./update_compatibility_version.py .. [] -Example: ./update_compatibility_version.py 3.7.1 -""" - -from __future__ import print_function -import re -import sys - -if len(sys.argv) < 2 or len(sys.argv) > 3: - print(""" -[ERROR] Please specify a version. - -./update_compatibility_version.py.py .. [] - -Example: -./update_compatibility_version.py.py 3.7.1 2 -""") - exit(1) - -NEW_VERSION = sys.argv[1] -NEW_VERSION_INFO = NEW_VERSION.split('.') -if len(NEW_VERSION_INFO) != 3: - print(""" -[ERROR] Version must be in the format .. - -Example: -./update_compatibility_version.py.py 3.7.3 -""") - exit(1) - -if len(sys.argv) > 2: - RC_VERSION = int(sys.argv[2]) - # Do not update compatibility versions for rc release - if RC_VERSION != 0: - exit(0) - - -def RewriteTextFile(filename, line_rewriter): - lines = open(filename, 'r').readlines() - updated_lines = [] - for line in lines: - updated_lines.append(line_rewriter(line)) - if lines == updated_lines: - print('%s was not updated. Please double check.' % filename) - f = open(filename, 'w') - f.write(''.join(updated_lines)) - f.close() - - -def ReplaceVersion(line): - return re.sub(r'LAST_RELEASED=.*$', 'LAST_RELEASED=%s' % NEW_VERSION, line) - -RewriteTextFile('tests.sh', ReplaceVersion) diff --git a/util/python/BUILD.bazel b/util/python/BUILD.bazel deleted file mode 100644 index 071efd20b0..0000000000 --- a/util/python/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -load("@rules_cc//cc:defs.bzl", "cc_library") - -exports_files(["BUILD.bazel"]) - -# This is a placeholder for python headers. Projects needing to use -# fast cpp protos in protobuf's python interface should build with -# --define=use_fast_cpp_protos=true, and in addition, provide -# //external:python_headers dependency that in turn provides Python.h. -# -# Projects that include protobuf using a Bazel external repository will need to -# add a workspace rule to their WORKSPACE files to add an external workspace -# that includes the Python headers. For example, the protobuf WORKSPACE file -# includes the following local_repository rule that points to this directory: -# -# new_local_repository( -# name = "python_headers", -# path = __workspace_dir__ + "/util/python", -# ) -cc_library( - name = "python_headers", - visibility = ["//visibility:public"], -)