Skip to content

Commit

Permalink
Abseil LTS 20200923
Browse files Browse the repository at this point in the history
What's New:
* `absl::StatusOr<T>` has been released. See our [blog
  post](https://abseil.io/blog/2020-091021-status) for more
  information.
* Abseil Flags reflection interfaces have been released.
* Abseil Flags memory usage has been significantly optimized.
* Abseil now supports a "hardened" build mode. This build mode enables
  runtime checks that guard against programming errors that may lead
  to security vulnerabilities.

Notable Fixes:
* Sanitizer dynamic annotations like `AnnotateRWLockCreate` that are
  also defined by the compiler sanitizer implementation are no longer
  also defined by Abseil.
* Sanitizer macros are now prefixed with `ABSL_` to avoid naming collisions.
* Sanitizer usage is now automatically detected and no longer requires
  macros like `ADDRESS_SANITIZER` to be defined on the command line.

Breaking Changes:
* Abseil no longer contains a `dynamic_annotations` library. Users
  using a supported build system (Bazel or CMake) are unaffected by
  this, but users manually specifying link libraries may get an error
  about a missing linker input.

Baseline: 7680a5f
Cherry picks: None
  • Loading branch information
Abseil Team authored and derekmauro committed Sep 24, 2020
1 parent b832dce commit b56cbdd
Show file tree
Hide file tree
Showing 388 changed files with 21,421 additions and 7,815 deletions.
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/00-bug_report.md
@@ -0,0 +1,41 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug'
assignees: ''
---

**Describe the bug**

Include a clear and concise description of what the problem is, including what
you expected to happen, and what actually happened.

**Steps to reproduce the bug**

It's important that we are able to reproduce the problem that you are
experiencing. Please provide all code and relevant steps to reproduce the
problem, including your `BUILD`/`CMakeLists.txt` file and build commands. Links
to a GitHub branch or [godbolt.org](https://godbolt.org/) that demonstrate the
problem are also helpful.

**What version of Abseil are you using?**

**What operating system and version are you using**

If you are using a Linux distribution please include the name and version of the
distribution as well.

**What compiler and version are you using?**

Please include the output of `gcc -v` or `clang -v`, or the equivalent for your
compiler.

**What build system are you using?**

Please include the output of `bazel --version` or `cmake --version`, or the
equivalent for your build system.

**Additional context**

Add any other context about the problem here.
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/90-question.md
@@ -0,0 +1,7 @@
---
name: Question
about: Have a question? Ask us anything! :-)
title: ''
labels: 'question'
assignees: ''
---
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1 @@
blank_issues_enables: true
25 changes: 25 additions & 0 deletions BUILD.bazel
@@ -0,0 +1,25 @@
#
# Copyright 2020 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

package(default_visibility = ["//visibility:public"])

licenses(["notice"]) # Apache 2.0

# Expose license for external usage through bazel.
exports_files([
"AUTHORS",
"LICENSE",
])
18 changes: 13 additions & 5 deletions CMake/AbseilDll.cmake
Expand Up @@ -8,17 +8,18 @@ set(ABSL_INTERNAL_DLL_FILES
"base/casts.h"
"base/config.h"
"base/const_init.h"
"base/dynamic_annotations.cc"
"base/dynamic_annotations.h"
"base/internal/atomic_hook.h"
"base/internal/bits.h"
"base/internal/cycleclock.cc"
"base/internal/cycleclock.h"
"base/internal/direct_mmap.h"
"base/internal/dynamic_annotations.h"
"base/internal/endian.h"
"base/internal/errno_saver.h"
"base/internal/exponential_biased.cc"
"base/internal/exponential_biased.h"
"base/internal/fast_type_id.h"
"base/internal/hide_ptr.h"
"base/internal/identity.h"
"base/internal/invoke.h"
Expand All @@ -35,6 +36,8 @@ set(ABSL_INTERNAL_DLL_FILES
"base/internal/scheduling_mode.h"
"base/internal/scoped_set_env.cc"
"base/internal/scoped_set_env.h"
"base/internal/strerror.h"
"base/internal/strerror.cc"
"base/internal/spinlock.cc"
"base/internal/spinlock.h"
"base/internal/spinlock_wait.cc"
Expand Down Expand Up @@ -128,18 +131,16 @@ set(ABSL_INTERNAL_DLL_FILES
"random/bit_gen_ref.h"
"random/discrete_distribution.cc"
"random/discrete_distribution.h"
"random/distribution_format_traits.h"
"random/distributions.h"
"random/exponential_distribution.h"
"random/gaussian_distribution.cc"
"random/gaussian_distribution.h"
"random/internal/distributions.h"
"random/internal/distribution_caller.h"
"random/internal/fast_uniform_bits.h"
"random/internal/fastmath.h"
"random/internal/gaussian_distribution_gentables.cc"
"random/internal/fast_uniform_bits.h"
"random/internal/generate_real.h"
"random/internal/iostream_state_saver.h"
"random/internal/mock_helpers.h"
"random/internal/nonsecure_base.h"
"random/internal/pcg_engine.h"
"random/internal/platform.h"
Expand All @@ -152,6 +153,7 @@ set(ABSL_INTERNAL_DLL_FILES
"random/internal/randen_engine.h"
"random/internal/randen_hwaes.cc"
"random/internal/randen_hwaes.h"
"random/internal/randen_round_keys.cc"
"random/internal/randen_slow.cc"
"random/internal/randen_slow.h"
"random/internal/randen_traits.h"
Expand All @@ -172,8 +174,12 @@ set(ABSL_INTERNAL_DLL_FILES
"random/uniform_int_distribution.h"
"random/uniform_real_distribution.h"
"random/zipf_distribution.h"
"status/internal/status_internal.h"
"status/internal/statusor_internal.h"
"status/status.h"
"status/status.cc"
"status/statusor.h"
"status/statusor.cc"
"status/status_payload_printer.h"
"status/status_payload_printer.cc"
"strings/ascii.cc"
Expand Down Expand Up @@ -292,6 +298,8 @@ set(ABSL_INTERNAL_DLL_FILES
"types/internal/conformance_aliases.h"
"types/internal/conformance_archetype.h"
"types/internal/conformance_profile.h"
"types/internal/parentheses.h"
"types/internal/transform_args.h"
"types/internal/variant.h"
"types/optional.h"
"types/internal/optional.h"
Expand Down
4 changes: 3 additions & 1 deletion CMake/AbseilHelpers.cmake
Expand Up @@ -23,7 +23,9 @@ include(AbseilInstallDirs)
# project that sets
# set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# For example, Visual Studio supports folders.
set(ABSL_IDE_FOLDER Abseil)
if(NOT DEFINED ABSL_IDE_FOLDER)
set(ABSL_IDE_FOLDER Abseil)
endif()

# absl_cc_library()
#
Expand Down
4 changes: 2 additions & 2 deletions CMake/AbseilInstallDirs.cmake
Expand Up @@ -10,11 +10,11 @@ if(absl_VERSION)
set(ABSL_SUBDIR "${PROJECT_NAME}_${PROJECT_VERSION}")
set(ABSL_INSTALL_BINDIR "${CMAKE_INSTALL_BINDIR}/${ABSL_SUBDIR}")
set(ABSL_INSTALL_CONFIGDIR "${CMAKE_INSTALL_LIBDIR}/cmake/${ABSL_SUBDIR}")
set(ABSL_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/{ABSL_SUBDIR}")
set(ABSL_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/${ABSL_SUBDIR}")
set(ABSL_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${ABSL_SUBDIR}")
else()
set(ABSL_INSTALL_BINDIR "${CMAKE_INSTALL_BINDIR}")
set(ABSL_INSTALL_CONFIGDIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
set(ABSL_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}")
set(ABSL_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
endif()
endif()
33 changes: 22 additions & 11 deletions CMake/Googletest/CMakeLists.txt.in
@@ -1,15 +1,26 @@
cmake_minimum_required(VERSION 2.8.2)

project(googletest-download NONE)
project(googletest-external NONE)

include(ExternalProject)
ExternalProject_Add(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG master
SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src"
BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
if(${ABSL_USE_GOOGLETEST_HEAD})
ExternalProject_Add(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG master
SOURCE_DIR "${absl_gtest_src_dir}"
BINARY_DIR "${absl_gtest_build_dir}"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
else()
ExternalProject_Add(googletest
SOURCE_DIR "${absl_gtest_src_dir}"
BINARY_DIR "${absl_gtest_build_dir}"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
endif()
19 changes: 9 additions & 10 deletions CMake/Googletest/DownloadGTest.cmake
@@ -1,10 +1,11 @@
# Downloads and unpacks googletest at configure time. Based on the instructions
# at https://github.com/google/googletest/tree/master/googletest#incorporating-into-an-existing-cmake-project
# Integrates googletest at configure time. Based on the instructions at
# https://github.com/google/googletest/tree/master/googletest#incorporating-into-an-existing-cmake-project

# Download the latest googletest from Github master
# Set up the external googletest project, downloading the latest from Github
# master if requested.
configure_file(
${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt.in
${CMAKE_BINARY_DIR}/googletest-download/CMakeLists.txt
${CMAKE_BINARY_DIR}/googletest-external/CMakeLists.txt
)

set(ABSL_SAVE_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
Expand All @@ -14,17 +15,17 @@ if (BUILD_SHARED_LIBS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTEST_CREATE_SHARED_LIBRARY=1")
endif()

# Configure and build the downloaded googletest source
# Configure and build the googletest source.
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download )
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-external )
if(result)
message(FATAL_ERROR "CMake step for googletest failed: ${result}")
endif()

execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download)
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-external)
if(result)
message(FATAL_ERROR "Build step for googletest failed: ${result}")
endif()
Expand All @@ -37,6 +38,4 @@ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

# Add googletest directly to our build. This defines the gtest and gtest_main
# targets.
add_subdirectory(${CMAKE_BINARY_DIR}/googletest-src
${CMAKE_BINARY_DIR}/googletest-build
EXCLUDE_FROM_ALL)
add_subdirectory(${absl_gtest_src_dir} ${absl_gtest_build_dir} EXCLUDE_FROM_ALL)
2 changes: 1 addition & 1 deletion CMake/README.md
Expand Up @@ -93,7 +93,7 @@ absl::flags
absl::memory
absl::meta
absl::numeric
absl::random
absl::random_random
absl::strings
absl::synchronization
absl::time
Expand Down
5 changes: 3 additions & 2 deletions CMake/abslConfig.cmake.in
@@ -1,7 +1,8 @@
# absl CMake configuration file.

include(FindThreads)
include(CMakeFindDependencyMacro)
find_dependency(Threads)

@PACKAGE_INIT@

include ("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
include ("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
51 changes: 36 additions & 15 deletions CMakeLists.txt
Expand Up @@ -22,13 +22,24 @@
cmake_minimum_required(VERSION 3.5)

# Compiler id for Apple Clang is now AppleClang.
cmake_policy(SET CMP0025 NEW)
if (POLICY CMP0025)
cmake_policy(SET CMP0025 NEW)
endif (POLICY CMP0025)

# if command can use IN_LIST
cmake_policy(SET CMP0057 NEW)
if (POLICY CMP0057)
cmake_policy(SET CMP0057 NEW)
endif (POLICY CMP0057)

# Project version variables are the empty std::string if version is unspecified
cmake_policy(SET CMP0048 NEW)
# Project version variables are the empty string if version is unspecified
if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif (POLICY CMP0048)

# option() honor variables
if (POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif (POLICY CMP0077)

project(absl CXX)

Expand All @@ -41,9 +52,9 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# when absl is included as subproject (i.e. using add_subdirectory(abseil-cpp))
# in the source tree of a project that uses it, install rules are disabled.
if(NOT "^${CMAKE_SOURCE_DIR}$" STREQUAL "^${PROJECT_SOURCE_DIR}$")
set(ABSL_ENABLE_INSTALL FALSE)
option(ABSL_ENABLE_INSTALL "Enable install rule" OFF)
else()
set(ABSL_ENABLE_INSTALL TRUE)
option(ABSL_ENABLE_INSTALL "Enable install rule" ON)
endif()

list(APPEND CMAKE_MODULE_PATH
Expand Down Expand Up @@ -81,25 +92,33 @@ endif()
## pthread
find_package(Threads REQUIRED)

option(ABSL_USE_EXTERNAL_GOOGLETEST
"If ON, Abseil will assume that the targets for GoogleTest are already provided by the including project. This makes sense when Abseil is used with add_subproject." OFF)


option(ABSL_USE_GOOGLETEST_HEAD
"If ON, abseil will download HEAD from googletest at config time." OFF)

set(ABSL_LOCAL_GOOGLETEST_DIR "/usr/src/googletest" CACHE PATH
"If ABSL_USE_GOOGLETEST_HEAD is OFF, specifies the directory of a local googletest checkout."
)

option(ABSL_RUN_TESTS "If ON, Abseil tests will be run." OFF)

if(${ABSL_RUN_TESTS})
# enable CTest. This will set BUILD_TESTING to ON unless otherwise specified
# on the command line
include(CTest)
enable_testing()
endif()

## check targets
if(BUILD_TESTING)

if(${ABSL_USE_GOOGLETEST_HEAD})
include(CMake/Googletest/DownloadGTest.cmake)
set(absl_gtest_src_dir ${CMAKE_BINARY_DIR}/googletest-src)
## check targets
if (NOT ABSL_USE_EXTERNAL_GOOGLETEST)
set(absl_gtest_build_dir ${CMAKE_BINARY_DIR}/googletest-build)
if(${ABSL_USE_GOOGLETEST_HEAD})
set(absl_gtest_src_dir ${CMAKE_BINARY_DIR}/googletest-src)
else()
set(absl_gtest_src_dir ${ABSL_LOCAL_GOOGLETEST_DIR})
endif()
include(CMake/Googletest/DownloadGTest.cmake)
endif()

check_target(gtest)
Expand Down Expand Up @@ -152,5 +171,7 @@ if(ABSL_ENABLE_INSTALL)
FILES_MATCHING
PATTERN "*.inc"
PATTERN "*.h"
)
PATTERN "copts" EXCLUDE
PATTERN "testdata" EXCLUDE
)
endif() # ABSL_ENABLE_INSTALL
1 change: 1 addition & 0 deletions LTS.md
Expand Up @@ -13,3 +13,4 @@ The following lists LTS branches and the dates on which they have been released:
* [LTS Branch December 18, 2018](https://github.com/abseil/abseil-cpp/tree/lts_2018_12_18/)
* [LTS Branch June 20, 2018](https://github.com/abseil/abseil-cpp/tree/lts_2018_06_20/)
* [LTS Branch August 8, 2019](https://github.com/abseil/abseil-cpp/tree/lts_2019_08_08/)
* [LTS Branch February 25, 2020](https://github.com/abseil/abseil-cpp/tree/lts_2020_02_25/)

0 comments on commit b56cbdd

Please sign in to comment.