Commit 16fe8fef authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Final tweaks for "Abseil is allowed in first-party code":

* Improve comments
* Make DEPS block "third_party/abseil-cpp" and "absl" both
* Update formal "allowed on" date to date this lands
* Remove visibility restrictions

Bug: 1096380
Change-Id: I10f615cfd02c397a988f73e4548cdf2309b44b81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2327638
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarDirk Pranke <dpranke@google.com>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#793629}
parent 8db68d3e
...@@ -4097,8 +4097,11 @@ include_rules = [ ...@@ -4097,8 +4097,11 @@ include_rules = [
'+third_party/icu/source/i18n/unicode', '+third_party/icu/source/i18n/unicode',
'+url', '+url',
# Chromium cannot directly depend on Abseil. # Abseil features must be allowlisted explicitly for now. See
# //styleguide/c++/c++11.html. Allowed features' headers will be listed
# explicitly here.
'-absl', '-absl',
'-third_party/abseil-cpp',
] ]
......
...@@ -27,8 +27,7 @@ declare_args() { ...@@ -27,8 +27,7 @@ declare_args() {
# TODO(crbug/1006769): Switch to perfetto's client library. # TODO(crbug/1006769): Switch to perfetto's client library.
use_perfetto_client_library = false use_perfetto_client_library = false
# If true, it assumes that //third_party/abseil-cpp is an available # Allows googletest to pretty-print various absl types.
# dependency for googletest.
gtest_enable_absl_printers = false gtest_enable_absl_printers = false
} }
......
...@@ -51,7 +51,7 @@ The current status of existing standards and Abseil features is: ...@@ -51,7 +51,7 @@ The current status of existing standards and Abseil features is:
<li><b>C++14:</b> <i>Default allowed; see banned features below</i></li> <li><b>C++14:</b> <i>Default allowed; see banned features below</i></li>
<li><b>C++17:</b> <i>Not yet supported in Chromium, unlikely before mid-2021; <a href="http://crbug.com/752720">tracking bug</a></i></li> <li><b>C++17:</b> <i>Not yet supported in Chromium, unlikely before mid-2021; <a href="http://crbug.com/752720">tracking bug</a></i></li>
<li><b>C++20:</b> <i>Not yet standardized</i></li> <li><b>C++20:</b> <i>Not yet standardized</i></li>
<li><b>Abseil:</b> Initially supported July 27, 2020; see allowed/banned/TBD features below</li> <li><b>Abseil:</b> Initially supported July 31, 2020; see allowed/banned/TBD features below</li>
</ul></p> </ul></p>
......
...@@ -53,14 +53,6 @@ component("absl") { ...@@ -53,14 +53,6 @@ component("absl") {
} }
} }
} }
# Usage of Abseil in Chromium is guarded by an explicit opt-in list, before
# adding projects to this list please reach out to cxx@chromium.org and CC:
# - https://cs.chromium.org/chromium/src/third_party/abseil-cpp/OWNERS
#
# More information can be found at:
# https://docs.google.com/document/d/1DgS1-A3rzboTLjpf4m1sqkJgWjnY_Ru2dokk1X1vBDU
visibility = absl_visibility
} }
group("absl_component_deps") { group("absl_component_deps") {
...@@ -69,8 +61,8 @@ group("absl_component_deps") { ...@@ -69,8 +61,8 @@ group("absl_component_deps") {
"//third_party/abseil-cpp/absl/base", "//third_party/abseil-cpp/absl/base",
"//third_party/abseil-cpp/absl/base:config", "//third_party/abseil-cpp/absl/base:config",
"//third_party/abseil-cpp/absl/base:core_headers", "//third_party/abseil-cpp/absl/base:core_headers",
"//third_party/abseil-cpp/absl/container:flat_hash_map",
"//third_party/abseil-cpp/absl/container:fixed_array", "//third_party/abseil-cpp/absl/container:fixed_array",
"//third_party/abseil-cpp/absl/container:flat_hash_map",
"//third_party/abseil-cpp/absl/container:flat_hash_set", "//third_party/abseil-cpp/absl/container:flat_hash_set",
"//third_party/abseil-cpp/absl/container:inlined_vector", "//third_party/abseil-cpp/absl/container:inlined_vector",
"//third_party/abseil-cpp/absl/debugging:failure_signal_handler", "//third_party/abseil-cpp/absl/debugging:failure_signal_handler",
......
...@@ -9,8 +9,10 @@ Security Critical: yes ...@@ -9,8 +9,10 @@ Security Critical: yes
Description: Description:
This directory contains the source code of Abseil for C++. This can be used by This directory contains the source code of Abseil for C++. This can be used by
Chromium's dependencies, but shouldn't be used by Chromium itself. Chromium, subject to the guidance at https://chromium-cpp.appspot.com/; it can
See: https://goo.gl/TgnJb8. be used without restriction by Chromium's dependencies, except that objects
compiled into Chromium itself cannot use anything relying on
absl::base_internal::FastTypeId (see https://crbug.com/1096380).
How to update Abseil: How to update Abseil:
......
...@@ -7,9 +7,6 @@ ...@@ -7,9 +7,6 @@
# This template will correctly set "configs" and "public_configs" in order # This template will correctly set "configs" and "public_configs" in order
# to correctly compile abseil in Chromium. # to correctly compile abseil in Chromium.
# #
# Targets that set visibility should set it to something more restrictive than
# `absl_visibility` (defined below).
#
# Usage: # Usage:
# Most of the times its usage will be similar to the example below but all # Most of the times its usage will be similar to the example below but all
# the arguments avilable in source_set are also available for absl_source_set. # the arguments avilable in source_set are also available for absl_source_set.
...@@ -22,35 +19,6 @@ ...@@ -22,35 +19,6 @@
import("//build_overrides/build.gni") import("//build_overrides/build.gni")
# Usage of Abseil in Chromium is guarded by an explicit opt-in list, before
# adding projects to this list please reach out to cxx@chromium.org and CC:
# - https://cs.chromium.org/chromium/src/third_party/abseil-cpp/OWNERS
#
# More information can be found at:
# https://docs.google.com/document/d/1DgS1-A3rzboTLjpf4m1sqkJgWjnY_Ru2dokk1X1vBDU
declare_args() {
# Additional targets that can depend on absl.
additional_absl_clients = []
}
_chromium_absl_clients = [
"//chrome/services/sharing/nearby/platform_v2/*",
"//third_party/blink/renderer/modules/peerconnection",
"//third_party/blink/renderer/platform",
"//third_party/googletest:gtest",
"//third_party/openscreen/src/third_party/abseil/*",
"//third_party/private_membership/*",
"//third_party/shell-encryption/*",
"//third_party/webrtc/*",
"//third_party/nearby/*",
]
# When adding a new package to `absl_visibility`, please check that all the
# Abseil dependencies that are required are listed in the dependencies of
# //third_party/abseil-cpp:absl. If not, please add them and run:
# //third_party/abseil-cpp/generate_def_file.py.
absl_visibility = _chromium_absl_clients + additional_absl_clients
template("absl_source_set") { template("absl_source_set") {
source_set(target_name) { source_set(target_name) {
forward_variables_from(invoker, "*") forward_variables_from(invoker, "*")
...@@ -75,8 +43,14 @@ template("absl_source_set") { ...@@ -75,8 +43,14 @@ template("absl_source_set") {
public_configs += [ "//third_party/abseil-cpp:absl_include_config" ] public_configs += [ "//third_party/abseil-cpp:absl_include_config" ]
if (!defined(visibility)) { if (!defined(visibility)) {
# Within Chromium builds, restrict direct visibility of Abseil sources, so
# users must depend on //third_party/abseil-cpp:absl. This prevents use of
# banned targets like absl/types:any. A few targets require exceptions.
# TODO(crbug.com/1096380): Consider replacing build_with_chromium with
# is_component_build for a narrower, more accurate condition.
if (build_with_chromium) { if (build_with_chromium) {
visibility = [ visibility = [
# Abseil itself.
"//third_party/abseil-cpp/*", "//third_party/abseil-cpp/*",
# WebRTC binary to run PSNR and SSIM video quality analysis. It # WebRTC binary to run PSNR and SSIM video quality analysis. It
...@@ -85,7 +59,7 @@ template("absl_source_set") { ...@@ -85,7 +59,7 @@ template("absl_source_set") {
# component because it uses absl/flags. # component because it uses absl/flags.
"//third_party/webrtc/rtc_tools:frame_analyzer", "//third_party/webrtc/rtc_tools:frame_analyzer",
# WebRTC binaries used by //:chromium_builder_asan, they both # WebRTC binaries used by //:chromium_builder_asan. They both
# statically link absl (because they depend on absl/flags) and are # statically link absl (because they depend on absl/flags) and are
# used by Chromium only when is_component_build=false. # used by Chromium only when is_component_build=false.
"//third_party/webrtc/rtc_tools:rtp_generator", "//third_party/webrtc/rtc_tools:rtp_generator",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment