From 04363f7baea4bba704dc0d5b00d07f1cb6ac394a Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Fri, 7 Oct 2022 11:49:51 -0700 Subject: [PATCH] Update workspace_deps.bzl protobuf main commit PiperOrigin-RevId: 479635174 --- .bazelrc | 3 +++ .github/workflows/python_tests.yml | 2 ++ BUILD | 10 +++++----- WORKSPACE | 7 +++++++ bazel/workspace_deps.bzl | 2 +- benchmarks/benchmark.cc | 4 ++-- cmake/make_cmakelists.py | 3 +++ upb/bindings/lua/BUILD.bazel | 4 ++-- upb/port_def.inc | 4 ++-- 9 files changed, 27 insertions(+), 12 deletions(-) diff --git a/.bazelrc b/.bazelrc index 23492c03de..4d8efe7676 100644 --- a/.bazelrc +++ b/.bazelrc @@ -3,6 +3,9 @@ build --features=-debug_prefix_map_pwd_is_dot build --extra_toolchains=@system_python//:python_toolchain +# Pin to C++14 +build --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 + # Use our custom-configured c++ toolchain. build:m32 --copt=-m32 --linkopt=-m32 diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index 68b7ac43c1..f0bbcc24b1 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -129,6 +129,8 @@ jobs: python -m venv env source env/bin/activate echo "VIRTUAL ENV:" $VIRTUAL_ENV + - name: Install numpy + run: pip install numpy - name: Install Protobuf Wheels run: pip install -vvv --no-index --find-links wheels protobuf protobuftests - name: Run the unit tests diff --git a/BUILD b/BUILD index 197cb8b996..b510096fb7 100644 --- a/BUILD +++ b/BUILD @@ -610,13 +610,13 @@ upb_proto_reflection_library( upb_proto_library( name = "test_messages_proto2_proto_upb", testonly = 1, - deps = ["@com_google_protobuf//:test_messages_proto2_proto"], + deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto2_proto"], ) upb_proto_library( name = "test_messages_proto3_proto_upb", testonly = 1, - deps = ["@com_google_protobuf//:test_messages_proto3_proto"], + deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto3_proto"], ) proto_library( @@ -685,7 +685,7 @@ proto_library( name = "msg_test_proto", testonly = 1, srcs = ["upb/msg_test.proto"], - deps = ["@com_google_protobuf//:test_messages_proto3_proto"], + deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto3_proto"], ) upb_proto_library( @@ -817,13 +817,13 @@ upb_proto_reflection_library( upb_proto_reflection_library( name = "test_messages_proto2_upbdefs", testonly = 1, - deps = ["@com_google_protobuf//:test_messages_proto2_proto"], + deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto2_proto"], ) upb_proto_reflection_library( name = "test_messages_proto3_upbdefs", testonly = 1, - deps = ["@com_google_protobuf//:test_messages_proto3_proto"], + deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto3_proto"], ) cc_binary( diff --git a/WORKSPACE b/WORKSPACE index 6054b018af..af72add63f 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -59,3 +59,10 @@ rules_fuzzing_dependencies() load("@rules_fuzzing//fuzzing:init.bzl", "rules_fuzzing_init") rules_fuzzing_init() + +load("@rules_python//python:pip.bzl", "pip_install") + +pip_install( + name="pip_deps", + requirements = "@com_google_protobuf//python:requirements.txt" +) diff --git a/bazel/workspace_deps.bzl b/bazel/workspace_deps.bzl index 0f13d13b5b..84ad53a780 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 = "5407aa62af5f8d71c344ef10877806232a137991", + commit = "d938afd6e35676f6b8c8012d9eacd1dc0bb693b4", patches = ["@upb//bazel:protobuf.patch"], ) diff --git a/benchmarks/benchmark.cc b/benchmarks/benchmark.cc index e4c3a0cba1..b435604a80 100644 --- a/benchmarks/benchmark.cc +++ b/benchmarks/benchmark.cc @@ -169,7 +169,7 @@ static void BM_LoadAdsDescriptor_Proto2(benchmark::State& state) { protobuf::Arena arena; protobuf::DescriptorPool pool; for (auto file : serialized_files) { - protobuf::StringPiece input(file.data, file.size); + absl::string_view input(file.data, file.size); auto proto = protobuf::Arena::CreateMessage(&arena); bool ok = proto->ParseFrom(input) && @@ -284,7 +284,7 @@ void BM_Parse_Proto2(benchmark::State& state) { for (auto _ : state) { Proto2Factory proto_factory; auto proto = proto_factory.GetProto(); - protobuf::StringPiece input(descriptor.data, descriptor.size); + absl::string_view input(descriptor.data, descriptor.size); bool ok = proto->template ParseFrom(input); if (!ok) { printf("Failed to parse.\n"); diff --git a/cmake/make_cmakelists.py b/cmake/make_cmakelists.py index 9aff9e4520..2d5901e100 100755 --- a/cmake/make_cmakelists.py +++ b/cmake/make_cmakelists.py @@ -227,6 +227,9 @@ class WorkspaceFileFunctions(object): def protobuf_deps(self): pass + def pip_install(self, **kwargs): + pass + def rules_fuzzing_dependencies(self): pass diff --git a/upb/bindings/lua/BUILD.bazel b/upb/bindings/lua/BUILD.bazel index ccdd741c41..ec3a5978f8 100644 --- a/upb/bindings/lua/BUILD.bazel +++ b/upb/bindings/lua/BUILD.bazel @@ -119,11 +119,11 @@ lua_proto_library( lua_proto_library( name = "test_messages_proto3_proto_lua", testonly = 1, - deps = ["@com_google_protobuf//:test_messages_proto3_proto"], + deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto3_proto"], ) lua_proto_library( name = "test_messages_proto2_proto_lua", testonly = 1, - deps = ["@com_google_protobuf//:test_messages_proto2_proto"], + deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto2_proto"], ) diff --git a/upb/port_def.inc b/upb/port_def.inc index 25efa7911d..f335737fe9 100644 --- a/upb/port_def.inc +++ b/upb/port_def.inc @@ -49,9 +49,9 @@ */ #if !((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ - (defined(__cplusplus) && __cplusplus >= 201103L) || \ + (defined(__cplusplus) && __cplusplus >= 201402L) || \ (defined(_MSC_VER) && _MSC_VER >= 1900)) -#error upb requires C99 or C++11 or MSVC >= 2015. +#error upb requires C99 or C++14 or MSVC >= 2015. #endif // Portable check for GCC minimum version: