From 32f45b5f33d4399f27f1f6db2ad0ccacb5cabaaf Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Mon, 9 May 2022 22:00:33 -0700 Subject: [PATCH] Update to the latest protobuf. PiperOrigin-RevId: 447642349 --- BUILD | 12 ++++++------ bazel/protobuf.patch | 5 ++--- bazel/workspace_deps.bzl | 2 +- python/dist/BUILD.bazel | 8 ++++---- upb/bindings/lua/BUILD.bazel | 2 +- upb/conformance_upb.c | 8 ++++---- upb/mini_table_accessors_test.cc | 4 ++-- upb/msg_test.cc | 2 +- upb/msg_test.proto | 2 +- upb/test_generated_code.cc | 4 ++-- 10 files changed, 24 insertions(+), 25 deletions(-) diff --git a/BUILD b/BUILD index 79e3e51600..d691a55475 100644 --- a/BUILD +++ b/BUILD @@ -494,13 +494,13 @@ cc_test( upb_proto_library( name = "conformance_proto_upb", testonly = 1, - deps = ["@com_google_protobuf//:conformance_proto"], + deps = ["@com_google_protobuf//conformance:conformance_proto"], ) upb_proto_reflection_library( name = "conformance_proto_upbdefs", testonly = 1, - deps = ["@com_google_protobuf//:conformance_proto"], + deps = ["@com_google_protobuf//conformance:conformance_proto"], ) upb_proto_reflection_library( @@ -537,7 +537,7 @@ cc_binary( make_shell_script( name = "gen_test_conformance_upb", out = "test_conformance_upb.sh", - contents = "external/com_google_protobuf/conformance_test_runner " + + contents = "external/com_google_protobuf/conformance/conformance_test_runner " + " --enforce_recommended " + " --failure_list ./upb/conformance_upb_failures.txt" + " ./conformance_upb", @@ -549,7 +549,7 @@ sh_test( data = [ "upb/conformance_upb_failures.txt", ":conformance_upb", - "@com_google_protobuf//:conformance_test_runner", + "@com_google_protobuf//conformance:conformance_test_runner", ], deps = ["@bazel_tools//tools/bash/runfiles"], ) @@ -578,7 +578,7 @@ cc_binary( make_shell_script( name = "gen_test_conformance_upb_dynamic_minitable", out = "test_conformance_upb_dynamic_minitable.sh", - contents = "external/com_google_protobuf/conformance_test_runner " + + contents = "external/com_google_protobuf/conformance/conformance_test_runner " + " --enforce_recommended " + " --failure_list ./upb/conformance_upb_failures.txt" + " ./conformance_upb_dynamic_minitable", @@ -590,7 +590,7 @@ sh_test( data = [ "upb/conformance_upb_failures.txt", ":conformance_upb_dynamic_minitable", - "@com_google_protobuf//:conformance_test_runner", + "@com_google_protobuf//conformance:conformance_test_runner", ], deps = ["@bazel_tools//tools/bash/runfiles"], ) diff --git a/bazel/protobuf.patch b/bazel/protobuf.patch index 0de47b231d..b942a2ab2b 100644 --- a/bazel/protobuf.patch +++ b/bazel/protobuf.patch @@ -1,5 +1,5 @@ ---- BUILD -+++ BUILD +--- BUILD.bazel ++++ BUILD.bazel @@ -896,6 +896,10 @@ py_library( [ "python/google/protobuf/**/*.py", @@ -52,4 +52,3 @@ # Search internally. path = '.' - diff --git a/bazel/workspace_deps.bzl b/bazel/workspace_deps.bzl index a20a49e45c..8c1b844521 100644 --- a/bazel/workspace_deps.bzl +++ b/bazel/workspace_deps.bzl @@ -24,7 +24,7 @@ def upb_deps(): _github_archive, name = "com_google_protobuf", repo = "https://github.com/protocolbuffers/protobuf", - commit = "ec79d0d328c7e6cea15cc27fbeb9b018ca289590", + commit = "b180b2809f7e77fdf7dd075d26a7421085bac58f", patches = ["//bazel:protobuf.patch"], ) diff --git a/python/dist/BUILD.bazel b/python/dist/BUILD.bazel index 13eb6c75af..6aa62e1dd5 100644 --- a/python/dist/BUILD.bazel +++ b/python/dist/BUILD.bazel @@ -26,7 +26,7 @@ load("//bazel:py_proto_library.bzl", "py_proto_library") load(":dist.bzl", "py_dist", "py_dist_module") load("@bazel_skylib//lib:selects.bzl", "selects") -load("@com_google_protobuf//:protobuf_version.bzl", "PROTOBUF_VERSION") +load("@com_google_protobuf//:protobuf_version.bzl", "PROTOBUF_PYTHON_VERSION") load("@rules_python//python:packaging.bzl", "py_wheel") load("@system_python//:version.bzl", "SYSTEM_PYTHON_VERSION") @@ -119,7 +119,7 @@ py_wheel( "python/dist/", "python/", ], - version = PROTOBUF_VERSION, + version = PROTOBUF_PYTHON_VERSION, deps = [ ":message_mod", ":well_known_proto_py_pb2", @@ -136,7 +136,7 @@ py_wheel( strip_path_prefixes = [ "python/", ], - version = PROTOBUF_VERSION, + version = PROTOBUF_PYTHON_VERSION, deps = [ ":well_known_proto_py_pb2", "@com_google_protobuf//:python_srcs", @@ -150,7 +150,7 @@ py_wheel( platform = "any", python_tag = "py3", strip_path_prefixes = ["python/"], - version = PROTOBUF_VERSION, + version = PROTOBUF_PYTHON_VERSION, deps = [ "//python/pb_unit_tests:test_files", "@com_google_protobuf//:python_common_test_protos", diff --git a/upb/bindings/lua/BUILD.bazel b/upb/bindings/lua/BUILD.bazel index 9bb14f5ae2..d5ca32dbf6 100644 --- a/upb/bindings/lua/BUILD.bazel +++ b/upb/bindings/lua/BUILD.bazel @@ -83,8 +83,8 @@ cc_test( "//:third_party/lunit/console.lua", "//:third_party/lunit/lunit.lua", "//upb/bindings/lua:upb.lua", - "@com_google_protobuf//:conformance_proto", "@com_google_protobuf//:descriptor_proto", + "@com_google_protobuf//conformance:conformance_proto", ], linkstatic = 1, deps = [ diff --git a/upb/conformance_upb.c b/upb/conformance_upb.c index b64c112c86..3a63cb6276 100644 --- a/upb/conformance_upb.c +++ b/upb/conformance_upb.c @@ -37,8 +37,8 @@ #include "conformance/conformance.upb.h" #include "conformance/conformance.upbdefs.h" -#include "src/google/protobuf/test_messages_proto2.upbdefs.h" -#include "src/google/protobuf/test_messages_proto3.upbdefs.h" +#include "google/protobuf/test_messages_proto2.upbdefs.h" +#include "google/protobuf/test_messages_proto3.upbdefs.h" #include "upb/decode.h" #include "upb/encode.h" #include "upb/json_decode.h" @@ -325,9 +325,9 @@ int main(void) { #ifdef REBUILD_MINITABLES _upb_DefPool_LoadDefInitEx( - symtab, &src_google_protobuf_test_messages_proto2_proto_upbdefinit, true); + symtab, &google_protobuf_test_messages_proto2_proto_upbdefinit, true); _upb_DefPool_LoadDefInitEx( - symtab, &src_google_protobuf_test_messages_proto3_proto_upbdefinit, true); + symtab, &google_protobuf_test_messages_proto3_proto_upbdefinit, true); #else protobuf_test_messages_proto2_TestAllTypesProto2_getmsgdef(symtab); protobuf_test_messages_proto3_TestAllTypesProto3_getmsgdef(symtab); diff --git a/upb/mini_table_accessors_test.cc b/upb/mini_table_accessors_test.cc index 498471692f..7b29da6dd4 100644 --- a/upb/mini_table_accessors_test.cc +++ b/upb/mini_table_accessors_test.cc @@ -34,8 +34,8 @@ #include "upb/mini_table_accessors.h" #include "gtest/gtest.h" -#include "src/google/protobuf/test_messages_proto2.upb.h" -#include "src/google/protobuf/test_messages_proto3.upb.h" +#include "google/protobuf/test_messages_proto2.upb.h" +#include "google/protobuf/test_messages_proto3.upb.h" #include "upb/collections.h" #include "upb/mini_table.h" #include "upb/test.upb.h" diff --git a/upb/msg_test.cc b/upb/msg_test.cc index 2f33b4dd88..625fc4c2c1 100644 --- a/upb/msg_test.cc +++ b/upb/msg_test.cc @@ -27,7 +27,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "src/google/protobuf/test_messages_proto3.upb.h" +#include "google/protobuf/test_messages_proto3.upb.h" #include "upb/def.hpp" #include "upb/json_decode.h" #include "upb/json_encode.h" diff --git a/upb/msg_test.proto b/upb/msg_test.proto index 011fb82e6c..237f132381 100644 --- a/upb/msg_test.proto +++ b/upb/msg_test.proto @@ -31,7 +31,7 @@ syntax = "proto2"; package upb_test; -import "src/google/protobuf/test_messages_proto3.proto"; +import "google/protobuf/test_messages_proto3.proto"; message TestExtensions { extensions 1000 to max; diff --git a/upb/test_generated_code.cc b/upb/test_generated_code.cc index 7e36729d43..cb876fce78 100644 --- a/upb/test_generated_code.cc +++ b/upb/test_generated_code.cc @@ -31,8 +31,8 @@ */ #include "gtest/gtest.h" -#include "src/google/protobuf/test_messages_proto2.upb.h" -#include "src/google/protobuf/test_messages_proto3.upb.h" +#include "google/protobuf/test_messages_proto2.upb.h" +#include "google/protobuf/test_messages_proto3.upb.h" #include "upb/test.upb.h" #include "upb/upb.hpp"