From f9cee5c147db30dc8fa1a048aabd165965b5cb60 Mon Sep 17 00:00:00 2001 From: Justin Cohen Date: Wed, 10 Apr 2024 17:12:05 -0400 Subject: [PATCH] Roll mini_chromium to pick up the latest version of base::span. Also enables C++20 as span now depends on it. Roll buildtools to grab a newer libc++ that supports C++20. Explicitly capture `this` in lambdas in cpp-httplib as the implicit capture through `=` is deprecated and causes an error in C++20. Update the MacOS version to "Mac-13|Mac-14" which is the current value of `os.MAC_DEFAULT` in Chromium infra in order to have C++20 support in the std library on iOS. Moves iOS tests to run on iPhone 13 and includes a mini_chromium roll to fix Xcode 14.3 egtests. Bug: 40284755 Change-Id: Ic078f07d12473f2aaed5e84df0f0a7fb7b8c35c3 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5443384 Commit-Queue: Justin Cohen Reviewed-by: danakj --- DEPS | 4 ++-- build/run_tests.py | 6 +++--- third_party/cpp-httplib/README.crashpad | 1 + third_party/cpp-httplib/cpp-httplib/httplib.h | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/DEPS b/DEPS index 88f7571c..c8936e0e 100644 --- a/DEPS +++ b/DEPS @@ -29,7 +29,7 @@ vars = { deps = { 'buildtools': Var('chromium_git') + '/chromium/src/buildtools.git@' + - '8b16338d17cd71b04a6ba28da7322ab6739892c2', + '8919328651a559f8a974641d40fe712062cc6718', 'buildtools/clang_format/script': Var('chromium_git') + '/external/github.com/llvm/llvm-project/clang/tools/clang-format.git@' + @@ -47,7 +47,7 @@ deps = { '9719c1e1e676814c456b55f5f070eabad6709d31', 'crashpad/third_party/mini_chromium/mini_chromium': Var('chromium_git') + '/chromium/mini_chromium@' + - '203a01130fac64bfdcc8cab2e1798c7b2c0619bf', + 'dce72d97d1c2e9beb5e206c6a05a702269794ca3', 'crashpad/third_party/libfuzzer/src': Var('chromium_git') + '/chromium/llvm-project/compiler-rt/lib/fuzzer.git@' + 'fda403cf93ecb8792cb1d061564d89a6553ca020', diff --git a/build/run_tests.py b/build/run_tests.py index e03e06e7..9079da40 100755 --- a/build/run_tests.py +++ b/build/run_tests.py @@ -313,7 +313,7 @@ def _RunOnAndroidTarget(binary_dir, test, android_device, extra_command_line): def _RunOnIOSTarget(binary_dir, test, is_xcuitest=False, gtest_filter=None): - """Runs the given iOS |test| app on iPhone 8 with the default OS version.""" + """Runs the given iOS |test| app on a simulator with the default OS version.""" def xctest(binary_dir, test, gtest_filter=None): """Returns a dict containing the xctestrun data needed to run an @@ -368,11 +368,11 @@ def _RunOnIOSTarget(binary_dir, test, is_xcuitest=False, gtest_filter=None): with tempfile.NamedTemporaryFile() as f: import plistlib - xctestrun_path = f.name + xctestrun_path = f.name + ".xctestrun" print(xctestrun_path) command = [ 'xcodebuild', 'test-without-building', '-xctestrun', xctestrun_path, - '-destination', 'platform=iOS Simulator,name=iPhone 8', + '-destination', 'platform=iOS Simulator,OS=15.5,name=iPhone 13', ] with open(xctestrun_path, 'wb') as fp: if is_xcuitest: diff --git a/third_party/cpp-httplib/README.crashpad b/third_party/cpp-httplib/README.crashpad index a1ba93aa..8246a735 100644 --- a/third_party/cpp-httplib/README.crashpad +++ b/third_party/cpp-httplib/README.crashpad @@ -14,3 +14,4 @@ Local Modifications: - Exclude test/ and example/ subdirs. - Patch httplib.h to use #include "third_party/zlib/zlib_crashpad.h" instead of . +- Make `this` capture explicit to avoid errors in C++20. diff --git a/third_party/cpp-httplib/cpp-httplib/httplib.h b/third_party/cpp-httplib/cpp-httplib/httplib.h index dadab1d8..1165e260 100644 --- a/third_party/cpp-httplib/cpp-httplib/httplib.h +++ b/third_party/cpp-httplib/cpp-httplib/httplib.h @@ -1684,7 +1684,7 @@ inline bool Server::listen_internal() } // TODO: Use thread pool... - std::thread([=]() { + std::thread([=, this]() { { std::lock_guard guard(running_threads_mutex_); running_threads_++; @@ -1861,7 +1861,7 @@ inline bool Client::is_valid() const inline socket_t Client::create_client_socket() const { return detail::create_socket(host_.c_str(), port_, - [=](socket_t sock, struct addrinfo& ai) -> bool { + [this](socket_t sock, struct addrinfo& ai) -> bool { detail::set_nonblocking(sock, true); auto ret = connect(sock, ai.ai_addr, ai.ai_addrlen);