Skip to content

Commit

Permalink
Upgrade to Abseil 3.30
Browse files Browse the repository at this point in the history
  • Loading branch information
benesch committed Jul 22, 2024
1 parent b4b9307 commit e1872d8
Show file tree
Hide file tree
Showing 314 changed files with 17,906 additions and 4,932 deletions.
4 changes: 3 additions & 1 deletion bin/update-protobuf
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ index 6973bc993d..122218fb81 100644
EOF

curl -fsSL "https://github.com/abseil/abseil-cpp/releases/download/20240116.2/abseil-cpp-20240116.2.tar.gz" > abseil.tar.gz
# TODO: switch back to Abseil LTS once https://github.com/abseil/abseil-cpp/pull/1536
# makes it into a release.
curl -fsSL "https://github.com/abseil/abseil-cpp/archive/3cb4988999d2f16e11d86f9921e9526486ef1960.tar.gz" > abseil.tar.gz
rm -rf protobuf/third_party/abseil-cpp
mkdir -p protobuf/third_party/abseil-cpp
tar --strip-components=1 -C protobuf/third_party/abseil-cpp -xf abseil.tar.gz
Expand Down
3 changes: 3 additions & 0 deletions protobuf-src/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Versioning].
## [Unreleased] <!-- #release:date -->

* Upgrade to libprotobuf v27.2.
* Upgrade to Abseil [3cb498899](https://github.com/abseil/abseil-cpp/commit/3cb4988999d2f16e11d86f9921e9526486ef1960).

This fixes an incompatibility with CMake 3.30.

## [2.0.1] - 2024-05-23

Expand Down
12 changes: 11 additions & 1 deletion protobuf-src/protobuf/third_party/abseil-cpp/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#
# Copyright 2020 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -23,3 +22,14 @@ exports_files([
"AUTHORS",
"LICENSE",
])

# For building with clang-cl.
# https://bazel.build/configure/windows#clang
platform(
name = "x64_windows-clang-cl",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
],
)
101 changes: 86 additions & 15 deletions protobuf-src/protobuf/third_party/abseil-cpp/CMake/AbseilDll.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ set(ABSL_INTERNAL_DLL_FILES
"base/internal/low_level_scheduling.h"
"base/internal/nullability_impl.h"
"base/internal/per_thread_tls.h"
"base/internal/poison.cc"
"base/internal/poison.h"
"base/prefetch.h"
"base/internal/pretty_function.h"
"base/internal/raw_logging.cc"
Expand Down Expand Up @@ -66,6 +68,7 @@ set(ABSL_INTERNAL_DLL_FILES
"cleanup/internal/cleanup.h"
"container/btree_map.h"
"container/btree_set.h"
"container/hash_container_defaults.h"
"container/fixed_array.h"
"container/flat_hash_map.h"
"container/flat_hash_set.h"
Expand Down Expand Up @@ -121,8 +124,13 @@ set(ABSL_INTERNAL_DLL_FILES
"debugging/symbolize.h"
"debugging/internal/address_is_readable.cc"
"debugging/internal/address_is_readable.h"
"debugging/internal/bounded_utf8_length_sequence.h"
"debugging/internal/decode_rust_punycode.cc"
"debugging/internal/decode_rust_punycode.h"
"debugging/internal/demangle.cc"
"debugging/internal/demangle.h"
"debugging/internal/demangle_rust.cc"
"debugging/internal/demangle_rust.h"
"debugging/internal/elf_mem_image.cc"
"debugging/internal/elf_mem_image.h"
"debugging/internal/examine_stack.cc"
Expand All @@ -131,6 +139,8 @@ set(ABSL_INTERNAL_DLL_FILES
"debugging/internal/stack_consumption.h"
"debugging/internal/stacktrace_config.h"
"debugging/internal/symbolize.h"
"debugging/internal/utf8_for_code_point.cc"
"debugging/internal/utf8_for_code_point.h"
"debugging/internal/vdso_support.cc"
"debugging/internal/vdso_support.h"
"functional/any_invocable.h"
Expand Down Expand Up @@ -311,7 +321,6 @@ set(ABSL_INTERNAL_DLL_FILES
"strings/internal/string_constant.h"
"strings/internal/stringify_sink.h"
"strings/internal/stringify_sink.cc"
"strings/internal/has_absl_stringify.h"
"strings/has_absl_stringify.h"
"strings/has_ostream_operator.h"
"strings/match.cc"
Expand Down Expand Up @@ -437,6 +446,43 @@ set(ABSL_INTERNAL_DLL_FILES
"debugging/leak_check.cc"
)

if(NOT MSVC)
list(APPEND ABSL_INTERNAL_DLL_FILES
"flags/commandlineflag.cc"
"flags/commandlineflag.h"
"flags/config.h"
"flags/declare.h"
"flags/flag.h"
"flags/internal/commandlineflag.cc"
"flags/internal/commandlineflag.h"
"flags/internal/flag.cc"
"flags/internal/flag.h"
"flags/internal/parse.h"
"flags/internal/path_util.h"
"flags/internal/private_handle_accessor.cc"
"flags/internal/private_handle_accessor.h"
"flags/internal/program_name.cc"
"flags/internal/program_name.h"
"flags/internal/registry.h"
"flags/internal/sequence_lock.h"
"flags/internal/usage.cc"
"flags/internal/usage.h"
"flags/marshalling.cc"
"flags/marshalling.h"
"flags/parse.cc"
"flags/parse.h"
"flags/reflection.cc"
"flags/reflection.h"
"flags/usage.cc"
"flags/usage.h"
"flags/usage_config.cc"
"flags/usage_config.h"
"log/flags.cc"
"log/flags.h"
"log/internal/flags.h"
)
endif()

set(ABSL_INTERNAL_DLL_TARGETS
"absl_check"
"absl_log"
Expand Down Expand Up @@ -505,6 +551,7 @@ set(ABSL_INTERNAL_DLL_TARGETS
"log_internal_check_op"
"log_internal_conditions"
"log_internal_config"
"log_internal_fnmatch"
"log_internal_format"
"log_internal_globals"
"log_internal_log_impl"
Expand Down Expand Up @@ -584,6 +631,7 @@ set(ABSL_INTERNAL_DLL_TARGETS
"strerror"
"strings"
"strings_internal"
"string_view"
"symbolize"
"synchronization"
"thread_pool"
Expand All @@ -594,8 +642,29 @@ set(ABSL_INTERNAL_DLL_TARGETS
"type_traits"
"utility"
"variant"
"vlog_config_internal"
)

if(NOT MSVC)
list(APPEND ABSL_INTERNAL_DLL_TARGETS
"flags"
"flags_commandlineflag"
"flags_commandlineflag_internal"
"flags_config"
"flags_internal"
"flags_marshalling"
"flags_parse"
"flags_path_util"
"flags_private_handle_accessor"
"flags_program_name"
"flags_reflection"
"flags_usage"
"flags_usage_internal"
"log_internal_flags"
"log_flags"
)
endif()

set(ABSL_INTERNAL_TEST_DLL_FILES
"hash/hash_testing.h"
"log/scoped_mock_log.cc"
Expand All @@ -608,6 +677,9 @@ set(ABSL_INTERNAL_TEST_DLL_FILES
"random/internal/mock_overload_set.h"
"random/mocking_bit_gen.h"
"random/mock_distributions.h"
"status/status_matchers.h"
"status/internal/status_matchers.cc"
"status/internal/status_matchers.h"
"strings/cordz_test_helpers.h"
"strings/cord_test_helpers.h"
)
Expand All @@ -620,6 +692,7 @@ set(ABSL_INTERNAL_TEST_DLL_TARGETS
"random_internal_distribution_test_util"
"random_internal_mock_overload_set"
"scoped_mock_log"
"status_matchers"
)

include(CheckCXXSourceCompiles)
Expand Down Expand Up @@ -668,12 +741,7 @@ function(absl_internal_dll_contains)

STRING(REGEX REPLACE "^absl::" "" _target ${ABSL_INTERNAL_DLL_TARGET})

list(FIND
ABSL_INTERNAL_DLL_TARGETS
"${_target}"
_index)

if (${_index} GREATER -1)
if (_target IN_LIST ABSL_INTERNAL_DLL_TARGETS)
set(${ABSL_INTERNAL_DLL_OUTPUT} 1 PARENT_SCOPE)
else()
set(${ABSL_INTERNAL_DLL_OUTPUT} 0 PARENT_SCOPE)
Expand All @@ -690,12 +758,7 @@ function(absl_internal_test_dll_contains)

STRING(REGEX REPLACE "^absl::" "" _target ${ABSL_INTERNAL_TEST_DLL_TARGET})

list(FIND
ABSL_INTERNAL_TEST_DLL_TARGETS
"${_target}"
_index)

if (${_index} GREATER -1)
if (_target IN_LIST ABSL_INTERNAL_TEST_DLL_TARGETS)
set(${ABSL_INTERNAL_TEST_DLL_OUTPUT} 1 PARENT_SCOPE)
else()
set(${ABSL_INTERNAL_TEST_DLL_OUTPUT} 0 PARENT_SCOPE)
Expand Down Expand Up @@ -747,7 +810,12 @@ function(absl_make_dll)
else()
set(_dll "abseil_dll")
set(_dll_files ${ABSL_INTERNAL_DLL_FILES})
set(_dll_libs "")
set(_dll_libs
Threads::Threads
# TODO(#1495): Use $<LINK_LIBRARY:FRAMEWORK,CoreFoundation> once our
# minimum CMake version >= 3.24
$<$<PLATFORM_ID:Darwin>:-Wl,-framework,CoreFoundation>
)
set(_dll_compile_definitions "")
set(_dll_includes "")
set(_dll_consume "ABSL_CONSUME_DLL")
Expand All @@ -765,7 +833,10 @@ function(absl_make_dll)
${_dll_libs}
${ABSL_DEFAULT_LINKOPTS}
)
set_property(TARGET ${_dll} PROPERTY LINKER_LANGUAGE "CXX")
set_target_properties(${_dll} PROPERTIES
LINKER_LANGUAGE "CXX"
SOVERSION ${ABSL_SOVERSION}
)
target_include_directories(
${_dll}
PUBLIC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,16 @@ function(absl_cc_library)
endif()
endif()
endforeach()
set(skip_next_cflag OFF)
foreach(cflag ${ABSL_CC_LIB_COPTS})
if(${cflag} MATCHES "^(-Wno|/wd)")
if(skip_next_cflag)
set(skip_next_cflag OFF)
elseif(${cflag} MATCHES "^-Xarch_")
# An -Xarch_ flag implies that its successor only applies to the
# specified platform. Filter both of them out before the successor
# reaches the "^-m" filter.
set(skip_next_cflag ON)
elseif(${cflag} MATCHES "^(-Wno|/wd)")
# These flags are needed to suppress warnings that might fire in our headers.
set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
elseif(${cflag} MATCHES "^(-W|/w[1234eo])")
Expand Down Expand Up @@ -298,7 +306,7 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
if(ABSL_ENABLE_INSTALL)
set_target_properties(${_NAME} PROPERTIES
OUTPUT_NAME "absl_${_NAME}"
SOVERSION "2401.0.0"
SOVERSION "${ABSL_SOVERSION}"
)
endif()
else()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.16)

project(googletest-external NONE)

Expand Down
4 changes: 2 additions & 2 deletions protobuf-src/protobuf/third_party/abseil-cpp/CMake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ section of your executable or of your library.<br>
Here is a short CMakeLists.txt example of an application project using Abseil.

```cmake
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.16)
project(my_app_project)
# Pick the C++ standard to compile with.
Expand All @@ -62,7 +62,7 @@ will control Abseil library targets) is set to at least that minimum. For
example:

```cmake
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.16)
project(my_lib_project)
# Leave C++ standard up to the root application, so set it only if this is the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# A simple CMakeLists.txt for testing cmake installation

cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.16)
project(absl_cmake_testing CXX)

add_executable(simple simple.cc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ set -euox pipefail
absl_dir=/abseil-cpp
absl_build_dir=/buildfs
googletest_builddir=/googletest_builddir
project_dir="${absl_dir}"/CMake/install_test_project
googletest_archive="googletest-${ABSL_GOOGLETEST_VERSION}.tar.gz"
project_dir="${absl_dir}/CMake/install_test_project"
project_build_dir=/buildfs/project-build

build_shared_libs="OFF"
Expand All @@ -33,9 +34,9 @@ fi
# Build and install GoogleTest
mkdir "${googletest_builddir}"
pushd "${googletest_builddir}"
curl -L "${ABSL_GOOGLETEST_DOWNLOAD_URL}" --output "${ABSL_GOOGLETEST_COMMIT}".zip
unzip "${ABSL_GOOGLETEST_COMMIT}".zip
pushd "googletest-${ABSL_GOOGLETEST_COMMIT}"
curl -L "${ABSL_GOOGLETEST_DOWNLOAD_URL}" --output "${googletest_archive}"
tar -xz -f "${googletest_archive}"
pushd "googletest-${ABSL_GOOGLETEST_VERSION}"
mkdir build
pushd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS="${build_shared_libs}" ..
Expand Down
Loading

0 comments on commit e1872d8

Please sign in to comment.