Simplify ChromeOS build configuration

Lacros is no longer supported.

- Remove any IS_CHROMEOS_LACROS uses.
- Replace any IS_CHROMEOS_ASH uses with IS_CHROMEOS.
- Remove dependencies on build/chromeos_buildflags.h.

Change-Id: Ia8b522a14370f2309f2e66eee505cabbf2c95542
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/6275984
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
Georg Neis 2025-02-17 08:08:29 +00:00 committed by Crashpad LUCI CQ
parent 0945d59629
commit 4d14c1be03
9 changed files with 23 additions and 54 deletions

View File

@ -79,10 +79,7 @@ crashpad_static_library("client") {
"../util", "../util",
] ]
deps = [ deps = [ ":common" ]
":common",
"$mini_chromium_source_parent:chromeos_buildflags",
]
if (crashpad_is_win) { if (crashpad_is_win) {
libs = [ "rpcrt4.lib" ] libs = [ "rpcrt4.lib" ]

View File

@ -25,7 +25,6 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "util/file/file_io.h" #include "util/file/file_io.h"
#if !BUILDFLAG(IS_FUCHSIA) #if !BUILDFLAG(IS_FUCHSIA)
@ -799,7 +798,7 @@ class CrashpadClient {
static void UseSystemDefaultHandler(); static void UseSystemDefaultHandler();
#endif #endif
#if BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(IS_CHROMEOS)
//! \brief Sets a timestamp on the signal handler to be passed on to //! \brief Sets a timestamp on the signal handler to be passed on to
//! crashpad_handler and then eventually Chrome OS's crash_reporter. //! crashpad_handler and then eventually Chrome OS's crash_reporter.
//! //!

View File

@ -34,7 +34,6 @@
#include "base/logging.h" #include "base/logging.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "client/client_argv_handling.h" #include "client/client_argv_handling.h"
#include "third_party/lss/lss.h" #include "third_party/lss/lss.h"
#include "util/file/file_io.h" #include "util/file/file_io.h"
@ -406,7 +405,7 @@ class RequestCrashDumpHandler : public SignalHandler {
ExceptionHandlerProtocol::ClientInformation info = {}; ExceptionHandlerProtocol::ClientInformation info = {};
info.exception_information_address = info.exception_information_address =
FromPointerCast<VMAddress>(&GetExceptionInfo()); FromPointerCast<VMAddress>(&GetExceptionInfo());
#if BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(IS_CHROMEOS)
info.crash_loop_before_time = crash_loop_before_time_; info.crash_loop_before_time = crash_loop_before_time_;
#endif #endif
@ -414,7 +413,7 @@ class RequestCrashDumpHandler : public SignalHandler {
client.RequestCrashDump(info); client.RequestCrashDump(info);
} }
#if BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(IS_CHROMEOS)
void SetCrashLoopBefore(uint64_t crash_loop_before_time) { void SetCrashLoopBefore(uint64_t crash_loop_before_time) {
crash_loop_before_time_ = crash_loop_before_time; crash_loop_before_time_ = crash_loop_before_time;
} }
@ -436,7 +435,7 @@ class RequestCrashDumpHandler : public SignalHandler {
ScopedFileHandle sock_to_handler_; ScopedFileHandle sock_to_handler_;
pid_t handler_pid_ = -1; pid_t handler_pid_ = -1;
#if BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(IS_CHROMEOS)
// An optional UNIX timestamp passed to us from Chrome. // An optional UNIX timestamp passed to us from Chrome.
// This will pass to crashpad_handler and then to Chrome OS crash_reporter. // This will pass to crashpad_handler and then to Chrome OS crash_reporter.
// This should really be a time_t, but it's basically an opaque value (we // This should really be a time_t, but it's basically an opaque value (we
@ -763,7 +762,7 @@ void CrashpadClient::SetUnhandledSignals(const std::set<int>& signals) {
unhandled_signals_ = signals; unhandled_signals_ = signals;
} }
#if BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(IS_CHROMEOS)
// static // static
void CrashpadClient::SetCrashLoopBefore(uint64_t crash_loop_before_time) { void CrashpadClient::SetCrashLoopBefore(uint64_t crash_loop_before_time) {
auto request_crash_dump_handler = RequestCrashDumpHandler::Get(); auto request_crash_dump_handler = RequestCrashDumpHandler::Get();

View File

@ -74,7 +74,6 @@ static_library("handler") {
":common", ":common",
"../minidump", "../minidump",
"../snapshot", "../snapshot",
"../third_party/mini_chromium:chromeos_buildflags",
"../tools:tool_support", "../tools:tool_support",
] ]

View File

@ -38,7 +38,6 @@
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "client/crash_report_database.h" #include "client/crash_report_database.h"
#include "client/crashpad_client.h" #include "client/crashpad_client.h"
#include "client/crashpad_info.h" #include "client/crashpad_info.h"
@ -57,7 +56,7 @@
#include "util/string/split_string.h" #include "util/string/split_string.h"
#include "util/synchronization/semaphore.h" #include "util/synchronization/semaphore.h"
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) #if BUILDFLAG(IS_CHROMEOS)
#include "handler/linux/cros_crash_report_exception_handler.h" #include "handler/linux/cros_crash_report_exception_handler.h"
#endif #endif
@ -192,7 +191,7 @@ void Usage(const base::FilePath& me) {
" --url=URL send crash reports to this Breakpad server URL,\n" " --url=URL send crash reports to this Breakpad server URL,\n"
" only if uploads are enabled for the database\n" " only if uploads are enabled for the database\n"
// clang-format on // clang-format on
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) #if BUILDFLAG(IS_CHROMEOS)
// clang-format off // clang-format off
" --use-cros-crash-reporter\n" " --use-cros-crash-reporter\n"
" pass crash reports to /sbin/crash_reporter\n" " pass crash reports to /sbin/crash_reporter\n"
@ -205,7 +204,7 @@ void Usage(const base::FilePath& me) {
" crash_reporter, thus skipping metrics consent\n" " crash_reporter, thus skipping metrics consent\n"
" checks\n" " checks\n"
// clang-format on // clang-format on
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) #endif // BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_ANDROID)
// clang-format off // clang-format off
" --write-minidump-to-log write minidump to log\n" " --write-minidump-to-log write minidump to log\n"
@ -248,11 +247,11 @@ struct Options {
bool periodic_tasks; bool periodic_tasks;
bool rate_limit; bool rate_limit;
bool upload_gzip; bool upload_gzip;
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) #if BUILDFLAG(IS_CHROMEOS)
bool use_cros_crash_reporter = false; bool use_cros_crash_reporter = false;
base::FilePath minidump_dir_for_tests; base::FilePath minidump_dir_for_tests;
bool always_allow_feedback = false; bool always_allow_feedback = false;
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) #endif // BUILDFLAG(IS_CHROMEOS)
#if defined(ATTACHMENTS_SUPPORTED) #if defined(ATTACHMENTS_SUPPORTED)
std::vector<base::FilePath> attachments; std::vector<base::FilePath> attachments;
#endif // ATTACHMENTS_SUPPORTED #endif // ATTACHMENTS_SUPPORTED
@ -551,7 +550,7 @@ class ScopedStoppable {
void InitCrashpadLogging() { void InitCrashpadLogging() {
logging::LoggingSettings settings; logging::LoggingSettings settings;
#if BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(IS_CHROMEOS)
settings.logging_dest = logging::LOG_TO_FILE; settings.logging_dest = logging::LOG_TO_FILE;
settings.log_file_path = "/var/log/chrome/chrome"; settings.log_file_path = "/var/log/chrome/chrome";
#elif BUILDFLAG(IS_WIN) #elif BUILDFLAG(IS_WIN)
@ -622,11 +621,11 @@ int HandlerMain(int argc,
kOptionTraceParentWithException, kOptionTraceParentWithException,
#endif #endif
kOptionURL, kOptionURL,
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) #if BUILDFLAG(IS_CHROMEOS)
kOptionUseCrosCrashReporter, kOptionUseCrosCrashReporter,
kOptionMinidumpDirForTests, kOptionMinidumpDirForTests,
kOptionAlwaysAllowFeedback, kOptionAlwaysAllowFeedback,
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) #endif // BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_ANDROID)
kOptionWriteMinidumpToLog, kOptionWriteMinidumpToLog,
#endif // BUILDFLAG(IS_ANDROID) #endif // BUILDFLAG(IS_ANDROID)
@ -706,7 +705,7 @@ int HandlerMain(int argc,
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
// BUILDFLAG(IS_ANDROID) // BUILDFLAG(IS_ANDROID)
{"url", required_argument, nullptr, kOptionURL}, {"url", required_argument, nullptr, kOptionURL},
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) #if BUILDFLAG(IS_CHROMEOS)
{"use-cros-crash-reporter", {"use-cros-crash-reporter",
no_argument, no_argument,
nullptr, nullptr,
@ -716,7 +715,7 @@ int HandlerMain(int argc,
nullptr, nullptr,
kOptionMinidumpDirForTests}, kOptionMinidumpDirForTests},
{"always-allow-feedback", no_argument, nullptr, kOptionAlwaysAllowFeedback}, {"always-allow-feedback", no_argument, nullptr, kOptionAlwaysAllowFeedback},
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) #endif // BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_ANDROID)
{"write-minidump-to-log", no_argument, nullptr, kOptionWriteMinidumpToLog}, {"write-minidump-to-log", no_argument, nullptr, kOptionWriteMinidumpToLog},
#endif // BUILDFLAG(IS_ANDROID) #endif // BUILDFLAG(IS_ANDROID)
@ -879,7 +878,7 @@ int HandlerMain(int argc,
options.url = optarg; options.url = optarg;
break; break;
} }
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) #if BUILDFLAG(IS_CHROMEOS)
case kOptionUseCrosCrashReporter: { case kOptionUseCrosCrashReporter: {
options.use_cros_crash_reporter = true; options.use_cros_crash_reporter = true;
break; break;
@ -893,7 +892,7 @@ int HandlerMain(int argc,
options.always_allow_feedback = true; options.always_allow_feedback = true;
break; break;
} }
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) #endif // BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_ANDROID)
case kOptionWriteMinidumpToLog: { case kOptionWriteMinidumpToLog: {
options.write_minidump_to_log = true; options.write_minidump_to_log = true;
@ -1042,7 +1041,7 @@ int HandlerMain(int argc,
std::unique_ptr<CrashReportExceptionHandler> exception_handler; std::unique_ptr<CrashReportExceptionHandler> exception_handler;
#endif #endif
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) #if BUILDFLAG(IS_CHROMEOS)
if (options.use_cros_crash_reporter) { if (options.use_cros_crash_reporter) {
auto cros_handler = std::make_unique<CrosCrashReportExceptionHandler>( auto cros_handler = std::make_unique<CrosCrashReportExceptionHandler>(
database.get(), database.get(),
@ -1085,7 +1084,7 @@ int HandlerMain(int argc,
false, false,
#endif // BUILDFLAG(IS_LINUX) #endif // BUILDFLAG(IS_LINUX)
user_stream_sources); user_stream_sources);
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) #endif // BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
if (options.exception_information_address) { if (options.exception_information_address) {

View File

@ -257,8 +257,6 @@ bool CrosCrashReportExceptionHandler::HandleExceptionWithConnection(
constexpr int32_t kFixedVersion = 15363; constexpr int32_t kFixedVersion = 15363;
// TODO(https://crbug.com/1420445): Remove this check (and the // TODO(https://crbug.com/1420445): Remove this check (and the
// CRASHPAD_IS_IN_CHROMIUM defines) when M115 branches. // CRASHPAD_IS_IN_CHROMIUM defines) when M115 branches.
// (Lacros is guaranteed not to be more than 2 milestones ahead of ash, and
// M113 on ash has the relevant crash_reporter change.)
if (major_version >= kFixedVersion) { if (major_version >= kFixedVersion) {
// Used to distinguish between non-fatal and fatal crashes. // Used to distinguish between non-fatal and fatal crashes.
const ExceptionSnapshot* const exception_snapshot = snapshot->Exception(); const ExceptionSnapshot* const exception_snapshot = snapshot->Exception();

View File

@ -49,17 +49,3 @@ group("build") {
public_deps = [ "//third_party/mini_chromium/mini_chromium/build" ] public_deps = [ "//third_party/mini_chromium/mini_chromium/build" ]
} }
} }
group("chromeos_buildflags") {
if (crashpad_is_in_chromium) {
public_deps = [ "//build:chromeos_buildflags" ]
} else if (crashpad_is_standalone) {
public_deps = [ "mini_chromium/build:chromeos_buildflags" ]
} else if (crashpad_is_in_fuchsia) {
public_deps = [ mini_chromium_import_root + "/build:chromeos_buildflags" ]
} else if (crashpad_is_external) {
public_deps = [ "../../../../mini_chromium/mini_chromium/build:chromeos_buildflags" ]
} else if (crashpad_is_in_dart) {
public_deps = [ "//third_party/mini_chromium/mini_chromium/build:chromeos_buildflags" ]
}
}

View File

@ -573,10 +573,7 @@ crashpad_static_library("util") {
"../third_party/zlib", "../third_party/zlib",
] ]
deps += [ deps = [ "$mini_chromium_source_parent:base" ]
"$mini_chromium_source_parent:base",
"$mini_chromium_source_parent:chromeos_buildflags",
]
configs = [ "../build:flock_always_supported_defines" ] configs = [ "../build:flock_always_supported_defines" ]

View File

@ -24,19 +24,14 @@
#include "base/numerics/safe_conversions.h" #include "base/numerics/safe_conversions.h"
#include "base/numerics/safe_math.h" #include "base/numerics/safe_math.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "build/chromeos_buildflags.h"
// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is #if BUILDFLAG(IS_LINUX)
// complete.
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
#include "third_party/lss/lss.h" #include "third_party/lss/lss.h"
#endif #endif
namespace { namespace {
// TODO(crbug.com/1052397): Revisit once build flag switch of lacros-chrome is #if BUILDFLAG(IS_LINUX)
// complete.
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
void* CallMmap(void* addr, void* CallMmap(void* addr,
size_t len, size_t len,
int prot, int prot,