Upgrade to Abseil LTS 20230117 (#11622)

Closes #11622

PiperOrigin-RevId: 503588252
pull/11622/head^2
Mike Kruskal 2 years ago committed by Copybara-Service
parent 89349575f4
commit 7930cd1f9d
  1. 2
      .gitmodules
  2. 3
      build_defs/cpp_opts.bzl
  3. 4
      cmake/abseil-cpp.cmake
  4. 4
      cmake/tests.cmake
  5. 4
      protobuf_deps.bzl
  6. 7
      python/google/protobuf/pyext/descriptor_pool.cc
  7. 2
      src/google/protobuf/arena_unittest.cc
  8. 2
      src/google/protobuf/descriptor_unittest.cc
  9. 2
      src/google/protobuf/repeated_field_unittest.cc
  10. 2
      third_party/abseil-cpp
  11. 1
      third_party/zlib.BUILD

2
.gitmodules vendored

@ -5,7 +5,7 @@
[submodule "third_party/abseil-cpp"]
path = third_party/abseil-cpp
url = https://github.com/abseil/abseil-cpp.git
branch = lts_2022_06_23
branch = lts_2023_01_17
[submodule "third_party/jsoncpp"]
path = third_party/jsoncpp
url = https://github.com/open-source-parsers/jsoncpp.git

@ -19,9 +19,8 @@ COPTS = select({
"-DHAVE_ZLIB",
"-Woverloaded-virtual",
"-Wno-sign-compare",
"-Wno-nonnull",
"-Werror",
# TODO(b/265232445) This is required due to https://github.com/abseil/abseil-cpp/issues/1201.
"-Wno-deprecated",
],
})

@ -1,7 +1,5 @@
# Setup our dependency on Abseil.
set(ABSL_PROPAGATE_CXX_STD ON)
if(TARGET absl::strings)
# If Abseil is included already, skip including it.
# (https://github.com/protocolbuffers/protobuf/issues/10435)
@ -68,4 +66,4 @@ else()
absl::utility
absl::variant
)
endif ()
endif ()

@ -165,12 +165,12 @@ target_link_libraries(lite-test
add_test(NAME lite-test
COMMAND lite-test ${protobuf_GTEST_ARGS})
add_custom_target(check
add_custom_target(full-test
COMMAND tests
DEPENDS tests lite-test test_plugin
WORKING_DIRECTORY ${protobuf_SOURCE_DIR})
add_test(NAME check
add_test(NAME full-test
COMMAND tests ${protobuf_GTEST_ARGS})
# For test purposes, remove headers that should already be installed. This

@ -41,8 +41,8 @@ def protobuf_deps():
_github_archive(
name = "com_google_absl",
repo = "https://github.com/abseil/abseil-cpp",
commit = "273292d1cfc0a94a65082ee350509af1d113344d",
sha256 = "6764f226bd6e2d8ab9fe2f3cab5f45fb1a4a15c04b58b87ba7fa87456054f98b",
commit = "10b627fbe944110d1672bdf3f8e23b5909721399",
sha256 = "138ec814b4b72a79a41b2ae6526150467ff7749d8a792a63742207a5d8578ed1",
)
if not native.existing_rule("zlib"):

@ -48,6 +48,9 @@
#include "absl/strings/string_view.h"
#include "absl/strings/str_replace.h"
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PyString_AsStringAndSize(ob, charpp, sizep) \
(PyUnicode_Check(ob) \
? ((*(charpp) = const_cast<char*>( \
@ -172,7 +175,9 @@ static PyDescriptorPool* PyDescriptorPool_NewWithDatabase(
cpool->is_mutable = true;
}
if (use_deprecated_legacy_json_field_conflicts) {
PROTOBUF_IGNORE_DEPRECATION_START
pool->UseDeprecatedLegacyJsonFieldConflicts();
PROTOBUF_IGNORE_DEPRECATION_STOP
}
cpool->pool = pool;
cpool->is_owned = true;
@ -826,3 +831,5 @@ PyObject* PyDescriptorPool_FromPool(const DescriptorPool* pool) {
} // namespace python
} // namespace protobuf
} // namespace google
#include "google/protobuf/port_undef.inc"

@ -809,6 +809,7 @@ TEST(ArenaTest, AddAllocatedWithReflection) {
TEST(ArenaTest, RepeatedPtrFieldAddClearedTest) {
#ifndef PROTOBUF_FUTURE_REMOVE_CLEARED_API
{
PROTOBUF_IGNORE_DEPRECATION_START
RepeatedPtrField<TestAllTypes> repeated_field;
EXPECT_TRUE(repeated_field.empty());
EXPECT_EQ(0, repeated_field.size());
@ -817,6 +818,7 @@ TEST(ArenaTest, RepeatedPtrFieldAddClearedTest) {
repeated_field.AddCleared(cleared);
EXPECT_TRUE(repeated_field.empty());
EXPECT_EQ(0, repeated_field.size());
PROTOBUF_IGNORE_DEPRECATION_STOP
}
#endif // !PROTOBUF_FUTURE_REMOVE_CLEARED_API
{

@ -1277,8 +1277,10 @@ class StylizedFieldNamesTest : public testing::Test {
AddExtensionRange(AddMessage(&file, "ExtendableMessage"), 1, 1000);
DescriptorProto* message = AddMessage(&file, "TestMessage");
PROTOBUF_IGNORE_DEPRECATION_START
message->mutable_options()->set_deprecated_legacy_json_field_conflicts(
true);
PROTOBUF_IGNORE_DEPRECATION_STOP
AddField(message, "foo_foo", 1, FieldDescriptorProto::LABEL_OPTIONAL,
FieldDescriptorProto::TYPE_INT32);
AddField(message, "FooBar", 2, FieldDescriptorProto::LABEL_OPTIONAL,

@ -1386,6 +1386,7 @@ TEST(RepeatedPtrField, ClearedElements) {
field.Clear();
EXPECT_EQ(field.ClearedCount(), 2);
#ifndef PROTOBUF_FUTURE_REMOVE_CLEARED_API
PROTOBUF_IGNORE_DEPRECATION_START
EXPECT_EQ(field.ReleaseCleared(), original); // Take ownership again.
EXPECT_EQ(field.ClearedCount(), 1);
EXPECT_NE(field.Add(), original);
@ -1397,6 +1398,7 @@ TEST(RepeatedPtrField, ClearedElements) {
EXPECT_EQ(field.ClearedCount(), 1);
EXPECT_EQ(field.Add(), original);
EXPECT_EQ(field.ClearedCount(), 0);
PROTOBUF_IGNORE_DEPRECATION_STOP
#endif // !PROTOBUF_FUTURE_REMOVE_CLEARED_API
}

@ -1 +1 @@
Subproject commit 273292d1cfc0a94a65082ee350509af1d113344d
Subproject commit 10b627fbe944110d1672bdf3f8e23b5909721399

@ -60,6 +60,7 @@ cc_library(
copts = select({
"@bazel_tools//src/conditions:windows": [],
"//conditions:default": [
"-Wno-deprecated-non-prototype",
"-Wno-unused-variable",
"-Wno-implicit-function-declaration",
],

Loading…
Cancel
Save