From c7dfd0d6b92f825a4b9e986b3e948a5ab61c7438 Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Thu, 28 Oct 2021 10:34:54 -0700 Subject: [PATCH 1/6] Align dependency handling with Bazel best practices (#9165) This commit removes the use of bind() since that function goes against Bazel best practices: https://docs.bazel.build/versions/main/external.html#repository-rules-1 The bind() function basically maps a dependency into //external, but there is no good reason to do this. By mapping dependencies into //external and relying on this in our own BUILD files, we're forcing projects that depend on us to do the same. The one bind() call that I did leave in place was //:python_headers. This one seems to be doing something complicated I don't fully understand, and I don't want to risk breaking it. This change also moves our list of required Maven artifacts into a constant in protobuf_deps.bzl. This way, projects that depend on us can refer to this list when they invoke maven_install() and automatically pull in all the necesary dependencies. This fixes #9132. --- WORKSPACE | 63 +++++------------------------------- java/core/BUILD | 81 +++++++++++++++++++++++++---------------------- java/lite/BUILD | 21 ++++++++---- java/util/BUILD | 29 +++++++++-------- protobuf_deps.bzl | 13 +++++++- 5 files changed, 92 insertions(+), 115 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index c88d242db2bea..e500967fe4ed7 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -27,7 +27,7 @@ http_archive( ) # Load common dependencies. -load("//:protobuf_deps.bzl", "protobuf_deps") +load("//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS", "protobuf_deps") protobuf_deps() bind( @@ -36,70 +36,23 @@ bind( ) load("@rules_jvm_external//:defs.bzl", "maven_install") -maven_install( - artifacts = [ - "com.google.code.findbugs:jsr305:3.0.2", - "com.google.code.gson:gson:2.8.6", - "com.google.errorprone:error_prone_annotations:2.3.2", - "com.google.j2objc:j2objc-annotations:1.3", - "com.google.guava:guava:30.1.1-jre", - "com.google.truth:truth:1.1.2", - "junit:junit:4.12", - "org.easymock:easymock:3.2", - ], +maven_install( + artifacts = PROTOBUF_MAVEN_ARTIFACTS, + # For updating instructions, see: + # https://github.com/bazelbuild/rules_jvm_external#updating-maven_installjson + maven_install_json = "//:maven_install.json", repositories = [ "https://repo1.maven.org/maven2", "https://repo.maven.apache.org/maven2", ], - # For updating instructions, see: - # https://github.com/bazelbuild/rules_jvm_external#updating-maven_installjson - maven_install_json = "//:maven_install.json", ) load("@maven//:defs.bzl", "pinned_maven_install") -pinned_maven_install() - -bind( - name = "guava", - actual = "@maven//:com_google_guava_guava", -) - -bind( - name = "gson", - actual = "@maven//:com_google_code_gson_gson", -) - -bind( - name = "error_prone_annotations", - actual = "@maven//:com_google_errorprone_error_prone_annotations", -) -bind( - name = "j2objc_annotations", - actual = "@maven//:com_google_j2objc_j2objc_annotations", -) - -bind( - name = "jsr305", - actual = "@maven//:com_google_code_findbugs_jsr305", -) - -bind( - name = "junit", - actual = "@maven//:junit_junit", -) - -bind( - name = "easymock", - actual = "@maven//:org_easymock_easymock", -) - -bind( - name = "truth", - actual = "@maven//:com_google_truth_truth", -) +pinned_maven_install() # For `cc_proto_blacklist_test` and `build_test`. load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") + bazel_skylib_workspace() diff --git a/java/core/BUILD b/java/core/BUILD index c65f10a4e1a5c..1a37b4e820c4f 100644 --- a/java/core/BUILD +++ b/java/core/BUILD @@ -1,5 +1,5 @@ load("@bazel_skylib//rules:build_test.bzl", "build_test") -load("@rules_java//java:defs.bzl", "java_library", "java_proto_library", "java_lite_proto_library") +load("@rules_java//java:defs.bzl", "java_library", "java_lite_proto_library", "java_proto_library") load("@rules_jvm_external//:defs.bzl", "java_export") load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library") load("//:internal.bzl", "conformance_test") @@ -103,7 +103,7 @@ LITE_SRCS = [ java_library( name = "lite", srcs = LITE_SRCS + [ - "//:gen_well_known_protos_javalite" + "//:gen_well_known_protos_javalite", ], visibility = [ "//java/lite:__pkg__", @@ -115,10 +115,10 @@ java_export( name = "lite_mvn", maven_coordinates = "com.google.protobuf:protobuf-javalite:%s" % PROTOBUF_VERSION, pom_template = "//java/lite:pom_template.xml", - runtime_deps = [":lite"], resources = [ "//:lite_well_known_protos", ], + runtime_deps = [":lite"], ) java_library( @@ -150,25 +150,25 @@ java_export( name = "core_mvn", maven_coordinates = "com.google.protobuf:protobuf-java:%s" % PROTOBUF_VERSION, pom_template = "pom_template.xml", - runtime_deps = [":core"], resources = [ "//:well_known_protos", ], + runtime_deps = [":core"], ) filegroup( name = "release", - visibility = ["//java:__pkg__"], srcs = [ - ":core_mvn-pom", - ":core_mvn-maven-source", ":core_mvn-docs", + ":core_mvn-maven-source", + ":core_mvn-pom", ":core_mvn-project", - ":lite_mvn-pom", - ":lite_mvn-maven-source", ":lite_mvn-docs", + ":lite_mvn-maven-source", + ":lite_mvn-pom", ":lite_mvn-project", - ] + ], + visibility = ["//java:__pkg__"], ) proto_lang_toolchain( @@ -207,22 +207,22 @@ java_library( name = "test_util", srcs = [ "src/test/java/com/google/protobuf/TestUtil.java", - "src/test/java/com/google/protobuf/TestUtilLite.java" + "src/test/java/com/google/protobuf/TestUtilLite.java", ], deps = [ ":core", ":generic_test_protos_java_proto", ":java_test_protos_java_proto", - "//external:guava", - "//external:junit", + "@maven//:com_google_guava_guava", + "@maven//:junit_junit", ], ) test_suite( name = "tests", tests = [ - "core_build_test", "conformance_test", + "core_build_test", "core_tests", ], ) @@ -236,29 +236,32 @@ build_test( conformance_test( name = "conformance_test", - testee = "//:conformance_java", failure_list = "//:conformance/failure_list_java.txt", + testee = "//:conformance_java", text_format_failure_list = "//:conformance/text_format_failure_list_java.txt", ) junit_tests( name = "core_tests", - srcs = glob(["src/test/java/**/*.java"], exclude = [ - "src/test/java/com/google/protobuf/TestUtil.java", - "src/test/java/com/google/protobuf/TestUtilLite.java", - ]), - data = ["//:testdata"], size = "large", + srcs = glob( + ["src/test/java/**/*.java"], + exclude = [ + "src/test/java/com/google/protobuf/TestUtil.java", + "src/test/java/com/google/protobuf/TestUtilLite.java", + ], + ), + data = ["//:testdata"], deps = [ ":core", ":generic_test_protos_java_proto", ":java_test_protos_java_proto", ":test_util", - "//external:easymock", - "//external:guava", - "//external:junit", - "//external:truth", - ] + "@maven//:com_google_guava_guava", + "@maven//:com_google_truth_truth", + "@maven//:junit_junit", + "@maven//:org_easymock_easymock", + ], ) java_lite_proto_library( @@ -281,17 +284,17 @@ genrule( name = "rewrite_javalite_test_util", srcs = [ "//java/lite:lite.awk", - "src/test/java/com/google/protobuf/TestUtil.java" + "src/test/java/com/google/protobuf/TestUtil.java", ], outs = ["TestUtil.java"], - cmd = "awk -f $(location //java/lite:lite.awk) $(location src/test/java/com/google/protobuf/TestUtil.java) > $@" + cmd = "awk -f $(location //java/lite:lite.awk) $(location src/test/java/com/google/protobuf/TestUtil.java) > $@", ) java_library( name = "test_util_lite", srcs = [ + "src/test/java/com/google/protobuf/TestUtilLite.java", ":rewrite_javalite_test_util", - "src/test/java/com/google/protobuf/TestUtilLite.java" ], visibility = [ "//java/lite:__pkg__", @@ -300,8 +303,8 @@ java_library( ":generic_test_protos_java_proto_lite", ":java_test_protos_java_proto_lite", ":lite_runtime_only", - "//external:guava", - "//external:junit", + "@maven//:com_google_guava_guava", + "@maven//:junit_junit", ], ) @@ -350,18 +353,20 @@ LITE_TEST_EXCLUSIONS = [ junit_tests( name = "lite_tests", - srcs = glob(["src/test/java/**/*.java"], exclude = LITE_TEST_EXCLUSIONS), + size = "large", + srcs = glob( + ["src/test/java/**/*.java"], + exclude = LITE_TEST_EXCLUSIONS, + ), data = ["//:testdata"], test_prefix = "Lite", - size = "large", deps = [ - ":lite", ":generic_test_protos_java_proto_lite", ":java_test_protos_java_proto_lite", + ":lite", ":test_util_lite", - "//external:easymock", - "//external:junit", - "//external:truth", - ] + "@maven//:com_google_truth_truth", + "@maven//:junit_junit", + "@maven//:org_easymock_easymock", + ], ) - diff --git a/java/lite/BUILD b/java/lite/BUILD index 7089f958b0b65..17e9667e6ac7d 100644 --- a/java/lite/BUILD +++ b/java/lite/BUILD @@ -3,8 +3,15 @@ load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain") load("//:internal.bzl", "conformance_test") load("//java/internal:testing.bzl", "junit_tests") -exports_files(["lite.awk"], visibility = ["//java/core:__pkg__"]) -exports_files(["pom_template.xml"], visibility = ["//java/core:__pkg__"]) +exports_files( + ["lite.awk"], + visibility = ["//java/core:__pkg__"], +) + +exports_files( + ["pom_template.xml"], + visibility = ["//java/core:__pkg__"], +) alias( name = "lite", @@ -22,8 +29,8 @@ proto_lang_toolchain( test_suite( name = "tests", tests = [ - "lite_build_test", "conformance_test", + "lite_build_test", "lite_tests", "//java/core:lite_tests", ], @@ -38,21 +45,21 @@ build_test( conformance_test( name = "conformance_test", - testee = "//:conformance_java_lite", failure_list = "//:conformance/failure_list_java_lite.txt", + testee = "//:conformance_java_lite", text_format_failure_list = "//:conformance/text_format_failure_list_java_lite.txt", ) junit_tests( name = "lite_tests", - srcs = glob(["src/test/**/*.java"]), size = "small", + srcs = glob(["src/test/**/*.java"]), deps = [ ":lite", - "//external:junit", - "//external:truth", "//java/core:generic_test_protos_java_proto_lite", "//java/core:java_test_protos_java_proto_lite", "//java/core:test_util_lite", + "@maven//:com_google_truth_truth", + "@maven//:junit_junit", ], ) diff --git a/java/util/BUILD b/java/util/BUILD index 3855da96f01d0..ee6ddeaf19337 100644 --- a/java/util/BUILD +++ b/java/util/BUILD @@ -11,33 +11,34 @@ java_library( ]), visibility = ["//visibility:public"], deps = [ - "//external:error_prone_annotations", - "//external:j2objc_annotations", - "//external:gson", - "//external:jsr305", - "//external:guava", "//java/core", "//java/lite", + "@maven//:com_google_code_findbugs_jsr305", + "@maven//:com_google_code_gson_gson", + "@maven//:com_google_errorprone_error_prone_annotations", + "@maven//:com_google_guava_guava", + "@maven//:com_google_j2objc_j2objc_annotations", ], ) + # Bazel users, don't depend on this target, use :util. java_export( name = "util_mvn", maven_coordinates = "com.google.protobuf:protobuf-java-util:%s" % PROTOBUF_VERSION, pom_template = "pom_template.xml", - runtime_deps = [":util"], visibility = ["//java:__pkg__"], + runtime_deps = [":util"], ) filegroup( name = "release", - visibility = ["//java:__pkg__"], srcs = [ - ":util_mvn-pom", - ":util_mvn-maven-source", ":util_mvn-docs", + ":util_mvn-maven-source", + ":util_mvn-pom", ":util_mvn-project", - ] + ], + visibility = ["//java:__pkg__"], ) proto_library( @@ -60,15 +61,15 @@ java_proto_library( junit_tests( name = "tests", - srcs = glob(["src/test/java/**/*.java"]), package_name = "com.google.protobuf.util", + srcs = glob(["src/test/java/**/*.java"]), deps = [ ":test_protos_java_proto", ":util", - "//external:guava", - "//external:junit", - "//external:truth", "//java/core", "//java/core:generic_test_protos_java_proto", + "@maven//:com_google_guava_guava", + "@maven//:com_google_truth_truth", + "@maven//:junit_junit", ], ) diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl index 7420bc1fd78c2..32f38ebb6ea0b 100644 --- a/protobuf_deps.bzl +++ b/protobuf_deps.bzl @@ -2,6 +2,17 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +PROTOBUF_MAVEN_ARTIFACTS = [ + "com.google.code.findbugs:jsr305:3.0.2", + "com.google.code.gson:gson:2.8.6", + "com.google.errorprone:error_prone_annotations:2.3.2", + "com.google.j2objc:j2objc-annotations:1.3", + "com.google.guava:guava:30.1.1-jre", + "com.google.truth:truth:1.1.2", + "junit:junit:4.12", + "org.easymock:easymock:3.2", +] + def protobuf_deps(): """Loads common dependencies needed to compile the protobuf library.""" @@ -56,7 +67,7 @@ def protobuf_deps(): ) if not native.existing_rule("rules_jvm_external"): - http_archive( + http_archive( name = "rules_jvm_external", sha256 = "f36441aa876c4f6427bfb2d1f2d723b48e9d930b62662bf723ddfb8fc80f0140", strip_prefix = "rules_jvm_external-4.1", From e58469bdbedf514988efa86af9e8e7b5b1fa272f Mon Sep 17 00:00:00 2001 From: Marnix Bouhuis Date: Tue, 26 Oct 2021 18:48:47 +0200 Subject: [PATCH 2/6] JS: Fixed `ReferenceError: window is not defined` when getting the global object (#9156) --- src/google/protobuf/compiler/js/js_generator.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/google/protobuf/compiler/js/js_generator.cc b/src/google/protobuf/compiler/js/js_generator.cc index 5542256f38802..d2dac2f606f62 100644 --- a/src/google/protobuf/compiler/js/js_generator.cc +++ b/src/google/protobuf/compiler/js/js_generator.cc @@ -3634,7 +3634,14 @@ void Generator::GenerateFile(const GeneratorOptions& options, // - self: defined inside Web Workers (WorkerGlobalScope) // - Function('return this')(): this will work on most platforms, but it may be blocked by things like CSP. // Function('') is almost the same as eval('') - printer->Print("var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);\n\n"); + printer->Print( + "var global = (function() {\n" + " if (this) { return this; }\n" + " if (typeof window !== 'undefined') { return window; }\n" + " if (typeof global !== 'undefined') { return global; }\n" + " if (typeof self !== 'undefined') { return self; }\n" + " return Function('return this')();\n" + "}.call(null));\n\n"); } for (int i = 0; i < file->dependency_count(); i++) { From b2ac7ced50ed160985ba79bbbdea8bad8f28b039 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Mon, 25 Oct 2021 15:41:19 -0400 Subject: [PATCH 3/6] Fix memory leak in MessageClass.encode If the line above raises an exception, the upb_arena is lost and memory is leaked. --- ruby/ext/google/protobuf_c/message.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ruby/ext/google/protobuf_c/message.c b/ruby/ext/google/protobuf_c/message.c index 59602cf0899da..d07eba760d239 100644 --- a/ruby/ext/google/protobuf_c/message.c +++ b/ruby/ext/google/protobuf_c/message.c @@ -1012,7 +1012,6 @@ static VALUE Message_decode_json(int argc, VALUE* argv, VALUE klass) { */ static VALUE Message_encode(VALUE klass, VALUE msg_rb) { Message* msg = ruby_to_Message(msg_rb); - upb_arena *arena = upb_arena_new(); const char *data; size_t size; @@ -1020,6 +1019,8 @@ static VALUE Message_encode(VALUE klass, VALUE msg_rb) { rb_raise(rb_eArgError, "Message of wrong type."); } + upb_arena *arena = upb_arena_new(); + data = upb_encode(msg->msg, upb_msgdef_layout(msg->msgdef), arena, &size); From 1c8ae2459567388085f5da4b5ef2af7863a003fb Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Thu, 28 Oct 2021 18:02:41 +0000 Subject: [PATCH 4/6] Update changelog for 3.19.1 I also updated CHANGES.txt to include a couple things I forgot to add for 3.19.0. --- CHANGES.txt | 14 ++++++++++++++ php/ext/google/protobuf/package.xml | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index db6194529d803..926eff72dacc4 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,15 @@ +2021-10-28 version 3.19.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + Bazel + * Ensure that release archives contain everything needed for Bazel (#9131) + * Align dependency handling with Bazel best practices (#9165) + + JavaScript + * Fix `ReferenceError: window is not defined` when getting the global object (#9156) + + Ruby + * Fix memory leak in MessageClass.encode (#9150) + 2021-10-15 version 3.19.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) C++ @@ -17,6 +29,7 @@ Kotlin * Switch Kotlin proto DSLs to be implemented with inline value classes + * Fix inlining and deprecation for repeated string fields in kotlin (#9120) Python * Proto2 DecodeError now includes message name in error message @@ -37,6 +50,7 @@ * Add class method Timestamp.from_time to ruby well known types (#8562) * Adopt pure ruby DSL implementation for JRuby (#9047) * Add size to Map class (#8068) + * Fix for descriptor_pb.rb: google/protobuf should be required first (#9121) C# * Correctly set ExtensionRegistry when parsing with MessageParser, but using an already existing CodedInputStream (#7246) diff --git a/php/ext/google/protobuf/package.xml b/php/ext/google/protobuf/package.xml index 76d601f8df242..db45943ba1fe0 100644 --- a/php/ext/google/protobuf/package.xml +++ b/php/ext/google/protobuf/package.xml @@ -22,7 +22,7 @@ 3-Clause BSD License - * Added "object" as a reserved name (#8962) + * No new changes in 3.19.1 From 7c40b2df1fdf6f414c1c18c789715a9c948a0725 Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Thu, 28 Oct 2021 14:07:53 -0700 Subject: [PATCH 5/6] Update protobuf version (#9167) --- Protobuf-C++.podspec | 2 +- Protobuf.podspec | 2 +- configure.ac | 2 +- csharp/Google.Protobuf.Tools.nuspec | 2 +- .../Google.Protobuf/Google.Protobuf.csproj | 2 +- java/README.md | 6 ++--- java/bom/pom.xml | 2 +- java/core/pom.xml | 2 +- java/kotlin-lite/pom.xml | 2 +- java/kotlin/pom.xml | 2 +- java/lite.md | 2 +- java/lite/pom.xml | 2 +- java/pom.xml | 2 +- java/util/pom.xml | 2 +- js/package.json | 2 +- php/ext/google/protobuf/package.xml | 25 +++++++++++++++---- php/ext/google/protobuf/protobuf.h | 2 +- protobuf_version.bzl | 2 +- protoc-artifacts/pom.xml | 2 +- python/google/protobuf/__init__.py | 2 +- ruby/google-protobuf.gemspec | 2 +- ruby/pom.xml | 4 +-- src/Makefile.am | 2 +- src/google/protobuf/any.pb.h | 2 +- src/google/protobuf/api.pb.h | 2 +- src/google/protobuf/compiler/plugin.pb.h | 2 +- src/google/protobuf/descriptor.pb.h | 2 +- src/google/protobuf/duration.pb.h | 2 +- src/google/protobuf/empty.pb.h | 2 +- src/google/protobuf/field_mask.pb.h | 2 +- src/google/protobuf/port_def.inc | 2 +- src/google/protobuf/source_context.pb.h | 2 +- src/google/protobuf/struct.pb.h | 2 +- src/google/protobuf/stubs/common.h | 2 +- src/google/protobuf/timestamp.pb.h | 2 +- src/google/protobuf/type.pb.h | 2 +- src/google/protobuf/wrappers.pb.h | 2 +- 37 files changed, 59 insertions(+), 44 deletions(-) diff --git a/Protobuf-C++.podspec b/Protobuf-C++.podspec index 01c890de4a113..c6f5511cdb2a0 100644 --- a/Protobuf-C++.podspec +++ b/Protobuf-C++.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Protobuf-C++' - s.version = '3.19.0' + s.version = '3.19.1' s.summary = 'Protocol Buffers v3 runtime library for C++.' s.homepage = 'https://github.com/google/protobuf' s.license = '3-Clause BSD License' diff --git a/Protobuf.podspec b/Protobuf.podspec index b1a959478c3c8..ee63ffcb07ac3 100644 --- a/Protobuf.podspec +++ b/Protobuf.podspec @@ -5,7 +5,7 @@ # dependent projects use the :git notation to refer to the library. Pod::Spec.new do |s| s.name = 'Protobuf' - s.version = '3.19.0' + s.version = '3.19.1' s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.' s.homepage = 'https://github.com/protocolbuffers/protobuf' s.license = '3-Clause BSD License' diff --git a/configure.ac b/configure.ac index d076062f2218c..fb5f9d09f3487 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ AC_PREREQ(2.59) # 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.19.0],[protobuf@googlegroups.com],[protobuf]) +AC_INIT([Protocol Buffers],[3.19.1],[protobuf@googlegroups.com],[protobuf]) AM_MAINTAINER_MODE([enable]) diff --git a/csharp/Google.Protobuf.Tools.nuspec b/csharp/Google.Protobuf.Tools.nuspec index 93b8ab40c4586..b2d1417b6c98c 100644 --- a/csharp/Google.Protobuf.Tools.nuspec +++ b/csharp/Google.Protobuf.Tools.nuspec @@ -5,7 +5,7 @@ Google Protocol Buffers tools Tools for Protocol Buffers - Google's data interchange format. See project site for more info. - 3.19.0 + 3.19.1 Google Inc. protobuf-packages https://github.com/protocolbuffers/protobuf/blob/master/LICENSE diff --git a/csharp/src/Google.Protobuf/Google.Protobuf.csproj b/csharp/src/Google.Protobuf/Google.Protobuf.csproj index 4b3a9bb7e1930..ad6f57999bc88 100644 --- a/csharp/src/Google.Protobuf/Google.Protobuf.csproj +++ b/csharp/src/Google.Protobuf/Google.Protobuf.csproj @@ -4,7 +4,7 @@ C# runtime library for Protocol Buffers - Google's data interchange format. Copyright 2015, Google Inc. Google Protocol Buffers - 3.19.0 + 3.19.1 7.2 Google Inc. diff --git a/java/README.md b/java/README.md index 1cfff6afd0112..456ba1c97668c 100644 --- a/java/README.md +++ b/java/README.md @@ -23,7 +23,7 @@ If you are using Maven, use the following: com.google.protobuf protobuf-java - 3.19.0 + 3.19.1 ``` @@ -37,7 +37,7 @@ protobuf-java-util package: com.google.protobuf protobuf-java-util - 3.19.0 + 3.19.1 ``` @@ -45,7 +45,7 @@ protobuf-java-util package: If you are using Gradle, add the following to your `build.gradle` file's dependencies: ``` - implementation 'com.google.protobuf:protobuf-java:3.19.0' + implementation 'com.google.protobuf:protobuf-java:3.19.1' ``` Again, be sure to check that the version number matches (or is newer than) the version number of protoc that you are using. diff --git a/java/bom/pom.xml b/java/bom/pom.xml index d0a93a35ced02..348ea57fccb53 100644 --- a/java/bom/pom.xml +++ b/java/bom/pom.xml @@ -4,7 +4,7 @@ com.google.protobuf protobuf-bom - 3.19.0 + 3.19.1 pom Protocol Buffers [BOM] diff --git a/java/core/pom.xml b/java/core/pom.xml index 4c75eb40cd841..9c020f98dcd98 100644 --- a/java/core/pom.xml +++ b/java/core/pom.xml @@ -4,7 +4,7 @@ com.google.protobuf protobuf-parent - 3.19.0 + 3.19.1 protobuf-java diff --git a/java/kotlin-lite/pom.xml b/java/kotlin-lite/pom.xml index 47e2ab4af5416..23dfc77cc3308 100644 --- a/java/kotlin-lite/pom.xml +++ b/java/kotlin-lite/pom.xml @@ -4,7 +4,7 @@ com.google.protobuf protobuf-parent - 3.19.0 + 3.19.1 protobuf-kotlin-lite diff --git a/java/kotlin/pom.xml b/java/kotlin/pom.xml index d5b4d2e0d93a4..0455d114ed332 100644 --- a/java/kotlin/pom.xml +++ b/java/kotlin/pom.xml @@ -4,7 +4,7 @@ com.google.protobuf protobuf-parent - 3.19.0 + 3.19.1 protobuf-kotlin diff --git a/java/lite.md b/java/lite.md index 9929f19ae245e..8f3ef1e49b5eb 100644 --- a/java/lite.md +++ b/java/lite.md @@ -30,7 +30,7 @@ protobuf Java runtime. If you are using Maven, use the following: com.google.protobuf protobuf-javalite - 3.19.0 + 3.19.1 ``` diff --git a/java/lite/pom.xml b/java/lite/pom.xml index a473948b9fc05..cfd5707f9b80a 100644 --- a/java/lite/pom.xml +++ b/java/lite/pom.xml @@ -4,7 +4,7 @@ com.google.protobuf protobuf-parent - 3.19.0 + 3.19.1 protobuf-javalite diff --git a/java/pom.xml b/java/pom.xml index 6642131f667dd..127fa6287f2a3 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -4,7 +4,7 @@ com.google.protobuf protobuf-parent - 3.19.0 + 3.19.1 pom Protocol Buffers [Parent] diff --git a/java/util/pom.xml b/java/util/pom.xml index 63b53f3df122c..c9ada55804da7 100644 --- a/java/util/pom.xml +++ b/java/util/pom.xml @@ -4,7 +4,7 @@ com.google.protobuf protobuf-parent - 3.19.0 + 3.19.1 protobuf-java-util diff --git a/js/package.json b/js/package.json index 43ae2d70b77be..edccba60976c0 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "google-protobuf", - "version": "3.19.0", + "version": "3.19.1", "description": "Protocol Buffers for JavaScript", "main": "google-protobuf.js", "files": [ diff --git a/php/ext/google/protobuf/package.xml b/php/ext/google/protobuf/package.xml index db45943ba1fe0..12c899ef8556c 100644 --- a/php/ext/google/protobuf/package.xml +++ b/php/ext/google/protobuf/package.xml @@ -1,5 +1,5 @@ - + protobuf pecl.php.net Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data. @@ -10,11 +10,11 @@ protobuf-opensource@google.com yes - 2021-10-19 - + 2021-10-28 + - 3.19.0 - 3.19.0 + 3.19.1 + 3.19.1 stable @@ -1143,5 +1143,20 @@ G A release. + + + 3.19.1 + 3.19.1 + + + stable + stable + + 2021-10-28 + + 3-Clause BSD License + + + diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h index d5eb4faaa2d07..7cbad848614e8 100644 --- a/php/ext/google/protobuf/protobuf.h +++ b/php/ext/google/protobuf/protobuf.h @@ -91,7 +91,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_setter, 0, 0, 1) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -#define PHP_PROTOBUF_VERSION "3.19.0" +#define PHP_PROTOBUF_VERSION "3.19.1" // ptr -> PHP object cache. This is a weak map that caches lazily-created // wrapper objects around upb types: diff --git a/protobuf_version.bzl b/protobuf_version.bzl index bf0d52b18ae44..31ce2e3bace4f 100644 --- a/protobuf_version.bzl +++ b/protobuf_version.bzl @@ -1 +1 @@ -PROTOBUF_VERSION = '3.19.0' +PROTOBUF_VERSION = '3.19.1' diff --git a/protoc-artifacts/pom.xml b/protoc-artifacts/pom.xml index 9f44f5f43fb57..7e5eca83ed3ab 100644 --- a/protoc-artifacts/pom.xml +++ b/protoc-artifacts/pom.xml @@ -8,7 +8,7 @@ com.google.protobuf protoc - 3.19.0 + 3.19.1 pom Protobuf Compiler diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py index 68087e5501ffb..52101b6fe42f3 100644 --- a/python/google/protobuf/__init__.py +++ b/python/google/protobuf/__init__.py @@ -30,4 +30,4 @@ # Copyright 2007 Google Inc. All Rights Reserved. -__version__ = '3.19.0' +__version__ = '3.19.1' diff --git a/ruby/google-protobuf.gemspec b/ruby/google-protobuf.gemspec index c034f3743b00f..7e2dd14aae913 100644 --- a/ruby/google-protobuf.gemspec +++ b/ruby/google-protobuf.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = "google-protobuf" - s.version = "3.19.0" + s.version = "3.19.1" git_tag = "v#{s.version.to_s.sub('.rc.', '-rc')}" # Converts X.Y.Z.rc.N to vX.Y.Z-rcN, used for the git tag s.licenses = ["BSD-3-Clause"] s.summary = "Protocol Buffers" diff --git a/ruby/pom.xml b/ruby/pom.xml index a38d395b73a17..f4c8f66d1ed2d 100644 --- a/ruby/pom.xml +++ b/ruby/pom.xml @@ -9,7 +9,7 @@ com.google.protobuf.jruby protobuf-jruby - 3.19.0 + 3.19.1 Protocol Buffer JRuby native extension Protocol Buffers are a way of encoding structured data in an efficient yet @@ -76,7 +76,7 @@ com.google.protobuf protobuf-java-util - 3.19.0 + 3.19.1 org.jruby diff --git a/src/Makefile.am b/src/Makefile.am index f78c46c579d70..2d6034a0de665 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -18,7 +18,7 @@ else PTHREAD_DEF = endif -PROTOBUF_VERSION = 30:0:0 +PROTOBUF_VERSION = 30:1:0 if GCC # Turn on all warnings except for sign comparison (we ignore sign comparison diff --git a/src/google/protobuf/any.pb.h b/src/google/protobuf/any.pb.h index e90d198cbc96b..ab07cc70d2ed9 100644 --- a/src/google/protobuf/any.pb.h +++ b/src/google/protobuf/any.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/api.pb.h b/src/google/protobuf/api.pb.h index a2fa75a9313cb..26e1946f85657 100644 --- a/src/google/protobuf/api.pb.h +++ b/src/google/protobuf/api.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h index f3e28605bba98..569bb30a69883 100644 --- a/src/google/protobuf/compiler/plugin.pb.h +++ b/src/google/protobuf/compiler/plugin.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h index 4bc09d8e283d5..66d7e264d68a7 100644 --- a/src/google/protobuf/descriptor.pb.h +++ b/src/google/protobuf/descriptor.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/duration.pb.h b/src/google/protobuf/duration.pb.h index 8cd8cd1fe2ff4..6440e9d331132 100644 --- a/src/google/protobuf/duration.pb.h +++ b/src/google/protobuf/duration.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/empty.pb.h b/src/google/protobuf/empty.pb.h index 509443c96b7bd..ba97255ed0a9b 100644 --- a/src/google/protobuf/empty.pb.h +++ b/src/google/protobuf/empty.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/field_mask.pb.h b/src/google/protobuf/field_mask.pb.h index d2cd9d6a374cc..4114740bbedc5 100644 --- a/src/google/protobuf/field_mask.pb.h +++ b/src/google/protobuf/field_mask.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc index 003f75ac7d680..71325c3872d3c 100644 --- a/src/google/protobuf/port_def.inc +++ b/src/google/protobuf/port_def.inc @@ -153,7 +153,7 @@ #ifdef PROTOBUF_VERSION #error PROTOBUF_VERSION was previously defined #endif -#define PROTOBUF_VERSION 3019000 +#define PROTOBUF_VERSION 3019001 #ifdef PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC #error PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC was previously defined diff --git a/src/google/protobuf/source_context.pb.h b/src/google/protobuf/source_context.pb.h index a703bb5316aaa..5f91f3eb8dea6 100644 --- a/src/google/protobuf/source_context.pb.h +++ b/src/google/protobuf/source_context.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/struct.pb.h b/src/google/protobuf/struct.pb.h index 570303e2e7854..6e54bee65b503 100644 --- a/src/google/protobuf/struct.pb.h +++ b/src/google/protobuf/struct.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/stubs/common.h b/src/google/protobuf/stubs/common.h index d9524d2b5f2ee..c32503a6de349 100644 --- a/src/google/protobuf/stubs/common.h +++ b/src/google/protobuf/stubs/common.h @@ -82,7 +82,7 @@ namespace internal { // The current version, represented as a single integer to make comparison // easier: major * 10^6 + minor * 10^3 + micro -#define GOOGLE_PROTOBUF_VERSION 3019000 +#define GOOGLE_PROTOBUF_VERSION 3019001 // A suffix string for alpha, beta or rc releases. Empty for stable releases. #define GOOGLE_PROTOBUF_VERSION_SUFFIX "" diff --git a/src/google/protobuf/timestamp.pb.h b/src/google/protobuf/timestamp.pb.h index 54604acf0d0cc..95036fdea685a 100644 --- a/src/google/protobuf/timestamp.pb.h +++ b/src/google/protobuf/timestamp.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/type.pb.h b/src/google/protobuf/type.pb.h index ae8c144449bc0..b91ab7ce58e0e 100644 --- a/src/google/protobuf/type.pb.h +++ b/src/google/protobuf/type.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. diff --git a/src/google/protobuf/wrappers.pb.h b/src/google/protobuf/wrappers.pb.h index 83d258b03145f..42ffda2eeb3da 100644 --- a/src/google/protobuf/wrappers.pb.h +++ b/src/google/protobuf/wrappers.pb.h @@ -13,7 +13,7 @@ #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3019000 < PROTOBUF_MIN_PROTOC_VERSION +#if 3019001 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. From 31dd7b71cc5ff697e7cc37156b083a1eb5fd4d9b Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Mon, 1 Nov 2021 11:44:58 -0700 Subject: [PATCH 6/6] Fix benchmark by making sure we use Python 3 (#9170) (#9176) The benchmark runs have been failing since we started requiring Python 3, so this changes fixes the benchmarks by ensuring we always use Python 3. --- benchmarks/Makefile.am | 8 +++---- .../python/python_benchmark_messages.cc | 23 +++++++++++-------- benchmarks/util/result_parser.py | 12 +++++----- kokoro/linux/benchmark/run.sh | 8 ++++--- 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/benchmarks/Makefile.am b/benchmarks/Makefile.am index 2b2204d082353..3ab35e37ca871 100644 --- a/benchmarks/Makefile.am +++ b/benchmarks/Makefile.am @@ -165,7 +165,7 @@ python_add_init: protoc_middleman protoc_middleman2 done \ done -python_cpp_pkg_flags = `pkg-config --cflags --libs python` +python_cpp_pkg_flags = `pkg-config --cflags --libs python3` lib_LTLIBRARIES = libbenchmark_messages.la libbenchmark_messages_la_SOURCES = python/python_benchmark_messages.cc @@ -186,7 +186,7 @@ python-pure-python-benchmark: python_add_init @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 python tmp/py_benchmark.py '$$@' >> 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 @@ -196,7 +196,7 @@ python-cpp-reflection-benchmark: python_add_init @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 python tmp/py_benchmark.py '$$@' >> 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 @@ -206,7 +206,7 @@ python-cpp-generated-code-benchmark: python_add_init libbenchmark_messages.la @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 python tmp/py_benchmark.py --cpp_generated '$$@' >> 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 diff --git a/benchmarks/python/python_benchmark_messages.cc b/benchmarks/python/python_benchmark_messages.cc index ded16fe96e952..ef7e8a2e95aa3 100644 --- a/benchmarks/python/python_benchmark_messages.cc +++ b/benchmarks/python/python_benchmark_messages.cc @@ -7,13 +7,19 @@ #include "datasets/google_message3/benchmark_message3.pb.h" #include "datasets/google_message4/benchmark_message4.pb.h" -static PyMethodDef python_benchmark_methods[] = { - {NULL, NULL, 0, NULL} /* Sentinel */ -}; - +static struct PyModuleDef _module = {PyModuleDef_HEAD_INIT, + "libbenchmark_messages", + "Benchmark messages Python module", + -1, + NULL, + NULL, + NULL, + NULL, + NULL}; +extern "C" { PyMODINIT_FUNC -initlibbenchmark_messages() { +PyInit_libbenchmark_messages() { benchmarks::BenchmarkDataset().descriptor(); benchmarks::proto3::GoogleMessage1().descriptor(); benchmarks::proto2::GoogleMessage1().descriptor(); @@ -21,9 +27,6 @@ initlibbenchmark_messages() { benchmarks::google_message3::GoogleMessage3().descriptor(); benchmarks::google_message4::GoogleMessage4().descriptor(); - PyObject *m; - - m = Py_InitModule("libbenchmark_messages", python_benchmark_methods); - if (m == NULL) - return; + return PyModule_Create(&_module); +} } diff --git a/benchmarks/util/result_parser.py b/benchmarks/util/result_parser.py index bdf3a9980a763..d3251a8b260b7 100644 --- a/benchmarks/util/result_parser.py +++ b/benchmarks/util/result_parser.py @@ -61,7 +61,7 @@ def __parse_cpp_result(filename): return if filename[0] != '/': filename = os.path.dirname(os.path.abspath(__file__)) + '/' + filename - with open(filename, "rb") as f: + with open(filename, encoding="utf-8") as f: results = json.loads(f.read()) for benchmark in results["benchmarks"]: data_filename = "".join( @@ -96,7 +96,7 @@ def __parse_synthetic_result(filename): return if filename[0] != "/": filename = os.path.dirname(os.path.abspath(__file__)) + "/" + filename - with open(filename, "rb") as f: + with open(filename, encoding="utf-8") as f: results = json.loads(f.read()) for benchmark in results["benchmarks"]: __results.append({ @@ -126,7 +126,7 @@ def __parse_python_result(filename): return if filename[0] != '/': filename = os.path.dirname(os.path.abspath(__file__)) + '/' + filename - with open(filename, "rb") as f: + with open(filename, encoding="utf-8") as f: results_list = json.loads(f.read()) for results in results_list: for result in results: @@ -176,7 +176,7 @@ def __parse_java_result(filename): return if filename[0] != '/': filename = os.path.dirname(os.path.abspath(__file__)) + '/' + filename - with open(filename, "rb") as f: + with open(filename, encoding="utf-8") as f: results = json.loads(f.read()) for result in results: total_weight = 0 @@ -212,7 +212,7 @@ def __parse_go_result(filename): return if filename[0] != '/': filename = os.path.dirname(os.path.abspath(__file__)) + '/' + filename - with open(filename, "rb") as f: + with open(filename, encoding="utf-8") as f: for line in f: result_list = re.split(r"[\ \t]+", line) if result_list[0][:9] != "Benchmark": @@ -252,7 +252,7 @@ def __parse_custom_result(filename, language): return if filename[0] != '/': filename = os.path.dirname(os.path.abspath(__file__)) + '/' + filename - with open(filename, "rb") as f: + with open(filename, encoding="utf-8") as f: results = json.loads(f.read()) for result in results: _, avg_size = __get_data_size(result["filename"]) diff --git a/kokoro/linux/benchmark/run.sh b/kokoro/linux/benchmark/run.sh index 502f4365366a6..acd8737077343 100755 --- a/kokoro/linux/benchmark/run.sh +++ b/kokoro/linux/benchmark/run.sh @@ -23,8 +23,10 @@ popd ./configure CXXFLAGS="-fPIC -O2" make -j8 pushd python -python setup.py build --cpp_implementation -pip install . --user +virtualenv -p python3 env +source env/bin/activate +python3 setup.py build --cpp_implementation +pip3 install --install-option="--cpp_implementation" . popd # build and run Python benchmark @@ -91,7 +93,7 @@ cat tmp/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" python -m util.result_parser \ +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