From 769e4a7a19ab222193df14f422aabd0278cd6360 Mon Sep 17 00:00:00 2001 From: Andrew Savage Date: Tue, 28 May 2024 17:11:51 +0000 Subject: [PATCH] Base cleanups b/334975532 --- base/BUILD.gn | 6 ------ .../partition_alloc_base/rand_util_posix.cc | 3 +-- base/check_is_test_unittest.cc | 2 -- base/i18n/time_formatting.cc | 7 ++++--- base/test/run_all_unittests.cc | 2 ++ net/base/network_change_notifier_linux.cc | 14 -------------- starboard/build/install/install_target.gni | 3 --- starboard/client_porting/eztime/BUILD.gn | 2 +- starboard/elf_loader/BUILD.gn | 2 +- starboard/extension/BUILD.gn | 3 +-- starboard/linux/shared/BUILD.gn | 2 +- .../linux/x64x11/platform_configuration/BUILD.gn | 11 ----------- starboard/nplb/BUILD.gn | 2 +- .../nplb/nplb_evergreen_compat_tests/BUILD.gn | 2 +- starboard/raspi/shared/BUILD.gn | 2 +- .../shared/starboard/player/filter/tools/BUILD.gn | 4 ++-- starboard/win/shared/BUILD.gn | 2 +- testing/perf/BUILD.gn | 2 +- third_party/angle/BUILD.gn | 4 ++-- third_party/boringssl/BUILD.gn | 8 -------- third_party/crashpad/crashpad/client/BUILD.gn | 2 +- third_party/icu/source/common/ubrk.cpp | 1 - third_party/icu/source/common/unicode/umachine.h | 8 ++++---- third_party/icu/source/common/unicode/unistr.h | 2 +- third_party/libxml/BUILD.gn | 2 +- third_party/llvm-project/libunwind/BUILD.gn | 2 +- third_party/protobuf/BUILD.gn | 2 +- third_party/zlib/BUILD.gn | 6 +++--- 28 files changed, 32 insertions(+), 76 deletions(-) diff --git a/base/BUILD.gn b/base/BUILD.gn index 342b8c0a7470..5e11519d5720 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn @@ -2773,10 +2773,6 @@ component("i18n") { "i18n/utf8_validator_tables.h", ] defines = [ "BASE_I18N_IMPLEMENTATION" ] - defines += [ - "U_COMMON_IMPLEMENTATION", - "UCONFIG_NO_CONVERSION=0", - ] configs += [ "//build/config/compiler:wexit_time_destructors" ] public_deps = [ "//third_party/ced", @@ -3644,8 +3640,6 @@ test("base_unittests") { "//third_party/modp_b64", ] - defines = [ "U_COMMON_IMPLEMENTATION" ] - data_deps = [ ] diff --git a/base/allocator/partition_allocator/partition_alloc_base/rand_util_posix.cc b/base/allocator/partition_allocator/partition_alloc_base/rand_util_posix.cc index c18416ca732b..6019bbc715c3 100644 --- a/base/allocator/partition_allocator/partition_alloc_base/rand_util_posix.cc +++ b/base/allocator/partition_allocator/partition_alloc_base/rand_util_posix.cc @@ -69,8 +69,7 @@ namespace partition_alloc::internal::base { // (https://chromium-review.googlesource.com/c/chromium/src/+/1545096) and land // it or some form of it. void RandBytes(void* output, size_t output_length) { -// TODO(b/298237462): Clean this up for Cobalt or don't use PA. -#if 0 +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) // We have to call `getrandom` via Linux Syscall Support, rather than through // the libc wrapper, because we might not have an up-to-date libc (e.g. on // some bots). diff --git a/base/check_is_test_unittest.cc b/base/check_is_test_unittest.cc index fb2ef765b222..3f7fa36ca5b9 100644 --- a/base/check_is_test_unittest.cc +++ b/base/check_is_test_unittest.cc @@ -5,13 +5,11 @@ #include "base/check_is_test.h" #include "testing/gtest/include/gtest/gtest.h" -#include "base/test/allow_check_is_test_for_testing.h" // Note: `base::AllowCheckIsTestForTesting` is being called in // `base/test/launcher/unit_test_launcher.cc` before this test is run. // // Thus, `CHECK_IS_TEST()` will succeed. TEST(CheckIsTest, Usage) { - base::test::AllowCheckIsTestForTesting(); CHECK_IS_TEST(); } diff --git a/base/i18n/time_formatting.cc b/base/i18n/time_formatting.cc index 4f01c76963db..376012e189e4 100644 --- a/base/i18n/time_formatting.cc +++ b/base/i18n/time_formatting.cc @@ -260,10 +260,11 @@ std::u16string DateIntervalFormat(const Time& begin_time, UErrorCode status = U_ZERO_ERROR; std::unique_ptr formatter( -/* Cobalt - icu::DateIntervalFormat::createInstance(DateFormatToString(format), -Cobalt */ +#if defined(USE_HACKY_COBALT_CHANGES) icu::DateIntervalFormat::createInstance(icu::UnicodeString(DateFormatToString(format)), +#else + icu::DateIntervalFormat::createInstance(DateFormatToString(format), +#endif status)); icu::FieldPosition pos = 0; diff --git a/base/test/run_all_unittests.cc b/base/test/run_all_unittests.cc index e9ef642942b6..c3aa04995d6a 100644 --- a/base/test/run_all_unittests.cc +++ b/base/test/run_all_unittests.cc @@ -11,11 +11,13 @@ #if defined(STARBOARD) +#include "base/test/allow_check_is_test_for_testing.h" #include "starboard/client_porting/wrap_main/wrap_main.h" int TestSuiteRun(int argc, char** argv) { base::AtExitManager exit_manager; + base::test::AllowCheckIsTestForTesting(); return base::TestSuite(argc, argv).Run(); } diff --git a/net/base/network_change_notifier_linux.cc b/net/base/network_change_notifier_linux.cc index 1c95268d3ae9..52220d281614 100644 --- a/net/base/network_change_notifier_linux.cc +++ b/net/base/network_change_notifier_linux.cc @@ -30,16 +30,10 @@ class NetworkChangeNotifierLinux::BlockingThreadObjects { // Plumbing for NetworkChangeNotifier::GetCurrentConnectionType. // Safe to call from any thread. NetworkChangeNotifier::ConnectionType GetCurrentConnectionType() { -/* Cobalt return address_tracker_.GetCurrentConnectionType(); -Cobalt */ - return NetworkChangeNotifier::ConnectionType::CONNECTION_UNKNOWN; } -/* Cobalt internal::AddressTrackerLinux* address_tracker() { return &address_tracker_; } -Cobalt */ - internal::AddressTrackerLinux* address_tracker() { return nullptr; } // Begin watching for netlink changes. void Init(); @@ -50,9 +44,7 @@ Cobalt */ void OnIPAddressChanged(); void OnLinkChanged(); // Used to detect online/offline state and IP address changes. -/* Cobalt internal::AddressTrackerLinux address_tracker_; -Cobalt */ NetworkChangeNotifier::ConnectionType last_type_ = NetworkChangeNotifier::CONNECTION_NONE; }; @@ -60,7 +52,6 @@ Cobalt */ NetworkChangeNotifierLinux::BlockingThreadObjects::BlockingThreadObjects( const std::unordered_set& ignored_interfaces, scoped_refptr blocking_thread_runner) -/* Cobalt : address_tracker_( base::BindRepeating(&NetworkChangeNotifierLinux:: BlockingThreadObjects::OnIPAddressChanged, @@ -71,20 +62,15 @@ NetworkChangeNotifierLinux::BlockingThreadObjects::BlockingThreadObjects( base::DoNothing(), ignored_interfaces, std::move(blocking_thread_runner)) {} -Cobalt */ {} void NetworkChangeNotifierLinux::BlockingThreadObjects::Init() { -/* Cobalt address_tracker_.Init(); -Cobalt */ last_type_ = GetCurrentConnectionType(); } void NetworkChangeNotifierLinux::BlockingThreadObjects::InitForTesting( base::ScopedFD netlink_fd) { -/* Cobalt address_tracker_.InitWithFdForTesting(std::move(netlink_fd)); // IN-TEST -Cobalt */ last_type_ = GetCurrentConnectionType(); } diff --git a/starboard/build/install/install_target.gni b/starboard/build/install/install_target.gni index 1d29e0674ed4..bc08211a8d1f 100644 --- a/starboard/build/install/install_target.gni +++ b/starboard/build/install/install_target.gni @@ -40,9 +40,6 @@ template("install_target") { copy("copy_" + target_name) { forward_variables_from(invoker, [ "testonly" ]) - # deps = [] - # not_needed(invoker, [ "deps" ]) - deps = invoker.deps deps += [ installable_target_dep ] sources = [ "$root_out_dir/$source_name" ] diff --git a/starboard/client_porting/eztime/BUILD.gn b/starboard/client_porting/eztime/BUILD.gn index 068980e7e4a0..061c62d3dc70 100644 --- a/starboard/client_porting/eztime/BUILD.gn +++ b/starboard/client_porting/eztime/BUILD.gn @@ -43,7 +43,7 @@ target(gtest_target_type, "eztime_test") { ] data_deps = [ - # "//cobalt/network:copy_ssl_certificates", + "//cobalt/network:copy_ssl_certificates", "//third_party/icu:icudata", ] } diff --git a/starboard/elf_loader/BUILD.gn b/starboard/elf_loader/BUILD.gn index 60c658f5fa29..969dc67f2ac2 100644 --- a/starboard/elf_loader/BUILD.gn +++ b/starboard/elf_loader/BUILD.gn @@ -119,7 +119,7 @@ if (current_toolchain == starboard_toolchain && !is_host_win) { deps += [ "//third_party/crashpad/crashpad/wrapper:wrapper_stub" ] } if (sb_is_evergreen_compatible && sb_evergreen_compatible_package) { - # deps += [ "//starboard/loader_app:copy_crashpad_handler_named_as_so" ] + deps += [ "//starboard/loader_app:copy_crashpad_handler_named_as_so" ] } } } diff --git a/starboard/extension/BUILD.gn b/starboard/extension/BUILD.gn index e440b2aee66a..810ffdb88772 100644 --- a/starboard/extension/BUILD.gn +++ b/starboard/extension/BUILD.gn @@ -14,8 +14,7 @@ target(gtest_target_type, "extension_test") { testonly = true - - # has_pedantic_warnings = true + has_pedantic_warnings = true sources = [ "enhanced_audio_test.cc", "extension_test.cc", diff --git a/starboard/linux/shared/BUILD.gn b/starboard/linux/shared/BUILD.gn index 52a82fb8d308..6597c866a7d6 100644 --- a/starboard/linux/shared/BUILD.gn +++ b/starboard/linux/shared/BUILD.gn @@ -443,7 +443,7 @@ static_library("starboard_platform_sources") { if (current_toolchain == starboard_toolchain) { target(starboard_level_gtest_target_type, "starboard_platform_tests") { - # build_loader = false + build_loader = false testonly = true sources = media_tests_sources + player_tests_sources + [ diff --git a/starboard/linux/x64x11/platform_configuration/BUILD.gn b/starboard/linux/x64x11/platform_configuration/BUILD.gn index 7a91af178c6e..23738ecb2f44 100644 --- a/starboard/linux/x64x11/platform_configuration/BUILD.gn +++ b/starboard/linux/x64x11/platform_configuration/BUILD.gn @@ -13,17 +13,6 @@ # limitations under the License. config("platform_configuration") { - libs = [ - "X11", - "Xcomposite", - "Xrender", - ] - libs += [ - "asound", - "dl", - "pthread", - "rt", - ] configs = [ "//starboard/build/config/sabi", "//starboard/linux/x64x11/shared/platform_configuration", diff --git a/starboard/nplb/BUILD.gn b/starboard/nplb/BUILD.gn index 2292de89a666..d0fe903126fe 100644 --- a/starboard/nplb/BUILD.gn +++ b/starboard/nplb/BUILD.gn @@ -319,7 +319,7 @@ target(gtest_target_type, "nplb") { } data_deps = [ - # "//cobalt/network:copy_ssl_certificates", + "//cobalt/network:copy_ssl_certificates", "//starboard/nplb/testdata/file_tests:nplb_file_tests_data", "//starboard/shared/starboard/player:player_download_test_data", "//third_party/icu:icudata", diff --git a/starboard/nplb/nplb_evergreen_compat_tests/BUILD.gn b/starboard/nplb/nplb_evergreen_compat_tests/BUILD.gn index 4332862cbd47..dd54a3e898c8 100644 --- a/starboard/nplb/nplb_evergreen_compat_tests/BUILD.gn +++ b/starboard/nplb/nplb_evergreen_compat_tests/BUILD.gn @@ -34,7 +34,7 @@ target(gtest_target_type, "nplb_evergreen_compat_tests") { ] data_deps = [ - # "//cobalt/network:copy_ssl_certificates", + "//cobalt/network:copy_ssl_certificates", "//third_party/icu:icudata", ] } diff --git a/starboard/raspi/shared/BUILD.gn b/starboard/raspi/shared/BUILD.gn index 3988122640b7..8adaea878175 100644 --- a/starboard/raspi/shared/BUILD.gn +++ b/starboard/raspi/shared/BUILD.gn @@ -22,7 +22,7 @@ group("starboard_platform") { static_library("starboard_platform_sources") { check_includes = false - # has_pedantic_warnings = true + has_pedantic_warnings = true sources = [ "//starboard/linux/shared/atomic_public.h", diff --git a/starboard/shared/starboard/player/filter/tools/BUILD.gn b/starboard/shared/starboard/player/filter/tools/BUILD.gn index 469de56f04db..f1842ff8a6c6 100644 --- a/starboard/shared/starboard/player/filter/tools/BUILD.gn +++ b/starboard/shared/starboard/player/filter/tools/BUILD.gn @@ -14,7 +14,7 @@ if (current_toolchain == starboard_toolchain) { target(starboard_level_final_executable_type, "audio_dmp_player") { - # build_loader = false + build_loader = false sources = [ "audio_dmp_player.cc" ] configs += [ "//starboard/build/config:starboard_implementation" ] public_deps = [ @@ -24,7 +24,7 @@ if (current_toolchain == starboard_toolchain) { "//starboard/shared/starboard/player:video_dmp", ] data_deps = [ - # "//cobalt/network:copy_ssl_certificates", + "//cobalt/network:copy_ssl_certificates", "//starboard/shared/starboard/player:player_download_test_data", "//third_party/icu:icudata", ] diff --git a/starboard/win/shared/BUILD.gn b/starboard/win/shared/BUILD.gn index 792217f80d54..5eb68f55dfea 100644 --- a/starboard/win/shared/BUILD.gn +++ b/starboard/win/shared/BUILD.gn @@ -45,7 +45,7 @@ config("starboard_platform_config") { } static_library("starboard_platform") { - # has_pedantic_warnings = true + has_pedantic_warnings = true sources = [ "//starboard/common/thread.cc", diff --git a/testing/perf/BUILD.gn b/testing/perf/BUILD.gn index fe9b646c7da3..4b7c110af6c3 100644 --- a/testing/perf/BUILD.gn +++ b/testing/perf/BUILD.gn @@ -1 +1 @@ -group("perf") {} \ No newline at end of file +group("perf") {} diff --git a/third_party/angle/BUILD.gn b/third_party/angle/BUILD.gn index a399fa4315fc..0b2272acca75 100644 --- a/third_party/angle/BUILD.gn +++ b/third_party/angle/BUILD.gn @@ -254,7 +254,7 @@ angle_static_library("preprocessor") { sources = angle_preprocessor_sources if (is_starboard) { - # suppressed_configs += [ "//starboard/build/config:warnings_as_errors" ] + suppressed_configs += [ "//starboard/build/config:warnings_as_errors" ] } public_deps = [ @@ -518,7 +518,7 @@ angle_static_library("translator") { public_configs += [ ":external_config" ] if (is_starboard) { - # suppressed_configs += [ "//starboard/build/config:warnings_as_errors" ] + suppressed_configs += [ "//starboard/build/config:warnings_as_errors" ] } deps = [ diff --git a/third_party/boringssl/BUILD.gn b/third_party/boringssl/BUILD.gn index d30f5ca9909f..ad88eb2d5f6c 100644 --- a/third_party/boringssl/BUILD.gn +++ b/third_party/boringssl/BUILD.gn @@ -251,7 +251,6 @@ if (!use_cobalt_customizations) { configs -= [ "//starboard/build/config:size" ] configs += [ "//starboard/build/config:speed" ] - # sources += boringssl_linux_x86_64_files if (sb_is_modular) { calling_convention = sabi_variables.calling_convention if ((calling_convention != "aarch64" && calling_convention != "eabi" && @@ -501,10 +500,3 @@ if (build_with_chromium) { seed_corpus = "src/fuzz/server_corpus_no_fuzzer_mode" } } - -# group("boringssl") { -# all_dependent_configs = [ ":external_config" ] -# public_deps = [ -# ":crypto" -# ] -# } \ No newline at end of file diff --git a/third_party/crashpad/crashpad/client/BUILD.gn b/third_party/crashpad/crashpad/client/BUILD.gn index 96775f2cc69a..349c1fbd7d00 100644 --- a/third_party/crashpad/crashpad/client/BUILD.gn +++ b/third_party/crashpad/crashpad/client/BUILD.gn @@ -93,7 +93,7 @@ static_library("client") { deps = [] if (crashpad_is_in_starboard) { - # public_deps += [ "//starboard/elf_loader:evergreen_info" ] + public_deps += [ "//starboard/elf_loader:evergreen_info" ] } if (crashpad_is_in_starboard || crashpad_is_in_native_target_build) { deps += [ "../wrapper/proto:crashpad_annotations_proto" ] diff --git a/third_party/icu/source/common/ubrk.cpp b/third_party/icu/source/common/ubrk.cpp index 108442462134..f8bdf5a6b658 100644 --- a/third_party/icu/source/common/ubrk.cpp +++ b/third_party/icu/source/common/ubrk.cpp @@ -93,7 +93,6 @@ ubrk_open(UBreakIteratorType type, // Invokes the rule builder. // //------------------------------------------------------------------------------ -// static_assert(sizeof(UChar) == 0, "The type T must be an integral type!"); U_CAPI UBreakIterator* U_EXPORT2 ubrk_openRules( const UChar *rules, int32_t rulesLength, diff --git a/third_party/icu/source/common/unicode/umachine.h b/third_party/icu/source/common/unicode/umachine.h index b15214828511..7e09828e1f08 100644 --- a/third_party/icu/source/common/unicode/umachine.h +++ b/third_party/icu/source/common/unicode/umachine.h @@ -414,14 +414,14 @@ typedef int8_t UBool; defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION) // Inside the ICU library code, never configurable. typedef char16_t UChar; -#elif defined(UCHAR_TYPE) - typedef UCHAR_TYPE UChar; -#elif (U_CPLUSPLUS_VERSION >= 11) - typedef char16_t UChar; #elif defined(STARBOARD) && U_SIZEOF_WCHAR_T==2 typedef wchar_t UChar; #elif defined(STARBOARD) && U_SIZEOF_WCHAR_T==4 typedef uint16_t UChar; +#elif defined(UCHAR_TYPE) + typedef UCHAR_TYPE UChar; +#elif (U_CPLUSPLUS_VERSION >= 11) + typedef char16_t UChar; #else typedef uint16_t UChar; #endif diff --git a/third_party/icu/source/common/unicode/unistr.h b/third_party/icu/source/common/unicode/unistr.h index 240ccb5b8f70..456389f265fe 100644 --- a/third_party/icu/source/common/unicode/unistr.h +++ b/third_party/icu/source/common/unicode/unistr.h @@ -3153,7 +3153,7 @@ class U_COMMON_API UnicodeString : public Replaceable */ inline UnicodeString(std::nullptr_t buffer, int32_t buffLength, int32_t buffCapacity); -#if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION || 1 +#if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION /** * char* constructor. diff --git a/third_party/libxml/BUILD.gn b/third_party/libxml/BUILD.gn index 1c33ab78f643..24111a245f2a 100644 --- a/third_party/libxml/BUILD.gn +++ b/third_party/libxml/BUILD.gn @@ -349,4 +349,4 @@ if (!use_cobalt_customizations) { include_dirs = [ "$os_include" ] } -group("xml_reader") {} \ No newline at end of file +group("xml_reader") {} diff --git a/third_party/llvm-project/libunwind/BUILD.gn b/third_party/llvm-project/libunwind/BUILD.gn index d344d7109808..d3112b9b4251 100644 --- a/third_party/llvm-project/libunwind/BUILD.gn +++ b/third_party/llvm-project/libunwind/BUILD.gn @@ -142,6 +142,6 @@ static_library("unwind_starboard") { public_deps = [ "//starboard/common", - # "//starboard/elf_loader:evergreen_info", + "//starboard/elf_loader:evergreen_info", ] } diff --git a/third_party/protobuf/BUILD.gn b/third_party/protobuf/BUILD.gn index 33ac6ee1a510..5600cde74fb9 100644 --- a/third_party/protobuf/BUILD.gn +++ b/third_party/protobuf/BUILD.gn @@ -175,7 +175,7 @@ component("protobuf_lite") { ":protobuf_config", # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. - # "//build/config/compiler:no_size_t_to_int_warning", + "//build/config/compiler:no_size_t_to_int_warning", ] if (use_cobalt_customizations) { diff --git a/third_party/zlib/BUILD.gn b/third_party/zlib/BUILD.gn index 9267fc44da87..ba3510419e7b 100644 --- a/third_party/zlib/BUILD.gn +++ b/third_party/zlib/BUILD.gn @@ -389,7 +389,7 @@ component("zlib_hidden") { } else { sources += [ "arm_stub.c", - # "inflate.c", + "inflate.c", ] } @@ -541,8 +541,8 @@ target(gtest_target_type, "zip_unittests") { testonly = true sources = [ - # "google/compression_utils_unittest.cc", - # "google/zip_reader_unittest.cc", + "google/compression_utils_unittest.cc", + "google/zip_reader_unittest.cc", "google/zip_unittest.cc", "google/compression_utils.cc", "google/compression_utils.h",