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",
]
deps = [
":common",
"$mini_chromium_source_parent:chromeos_buildflags",
]
deps = [ ":common" ]
if (crashpad_is_win) {
libs = [ "rpcrt4.lib" ]

View File

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

View File

@ -34,7 +34,6 @@
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "client/client_argv_handling.h"
#include "third_party/lss/lss.h"
#include "util/file/file_io.h"
@ -406,7 +405,7 @@ class RequestCrashDumpHandler : public SignalHandler {
ExceptionHandlerProtocol::ClientInformation info = {};
info.exception_information_address =
FromPointerCast<VMAddress>(&GetExceptionInfo());
#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS)
info.crash_loop_before_time = crash_loop_before_time_;
#endif
@ -414,7 +413,7 @@ class RequestCrashDumpHandler : public SignalHandler {
client.RequestCrashDump(info);
}
#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS)
void SetCrashLoopBefore(uint64_t crash_loop_before_time) {
crash_loop_before_time_ = crash_loop_before_time;
}
@ -436,7 +435,7 @@ class RequestCrashDumpHandler : public SignalHandler {
ScopedFileHandle sock_to_handler_;
pid_t handler_pid_ = -1;
#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS)
// An optional UNIX timestamp passed to us from Chrome.
// 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
@ -763,7 +762,7 @@ void CrashpadClient::SetUnhandledSignals(const std::set<int>& signals) {
unhandled_signals_ = signals;
}
#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS)
// static
void CrashpadClient::SetCrashLoopBefore(uint64_t crash_loop_before_time) {
auto request_crash_dump_handler = RequestCrashDumpHandler::Get();

View File

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

View File

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

View File

@ -257,8 +257,6 @@ bool CrosCrashReportExceptionHandler::HandleExceptionWithConnection(
constexpr int32_t kFixedVersion = 15363;
// TODO(https://crbug.com/1420445): Remove this check (and the
// 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) {
// Used to distinguish between non-fatal and fatal crashes.
const ExceptionSnapshot* const exception_snapshot = snapshot->Exception();

View File

@ -49,17 +49,3 @@ group("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",
]
deps += [
"$mini_chromium_source_parent:base",
"$mini_chromium_source_parent:chromeos_buildflags",
]
deps = [ "$mini_chromium_source_parent:base" ]
configs = [ "../build:flock_always_supported_defines" ]

View File

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