Skip to content

Commit

Permalink
Upgrade to Abseil LTS 20230117 (#11622)
Browse files Browse the repository at this point in the history
Closes #11622

PiperOrigin-RevId: 503588252
  • Loading branch information
mkruskal-google authored and copybara-github committed Jan 21, 2023
1 parent 8934957 commit 7930cd1
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions build_defs/cpp_opts.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
})

Expand Down
4 changes: 1 addition & 3 deletions cmake/abseil-cpp.cmake
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -68,4 +66,4 @@ else()
absl::utility
absl::variant
)
endif ()
endif ()
4 changes: 2 additions & 2 deletions cmake/tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions protobuf_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
7 changes: 7 additions & 0 deletions python/google/protobuf/pyext/descriptor_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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*>( \
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -826,3 +831,5 @@ PyObject* PyDescriptorPool_FromPool(const DescriptorPool* pool) {
} // namespace python
} // namespace protobuf
} // namespace google

#include "google/protobuf/port_undef.inc"
2 changes: 2 additions & 0 deletions src/google/protobuf/arena_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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
{
Expand Down
2 changes: 2 additions & 0 deletions src/google/protobuf/descriptor_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions src/google/protobuf/repeated_field_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion third_party/abseil-cpp
Submodule abseil-cpp updated 523 files
1 change: 1 addition & 0 deletions third_party/zlib.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand Down

0 comments on commit 7930cd1

Please sign in to comment.