0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-06-05 08:11:16 +00:00
Files
2025-05-12 15:06:25 +08:00

446 lines
14 KiB
Diff

From 9a1892a20b13382d995f0ab6844a5655ee5946c0 Mon Sep 17 00:00:00 2001
From: Chongyun Lee <licy183@termux.dev>
Date: Wed, 16 Apr 2025 02:00:34 +0800
Subject: [PATCH] reland jumbo 2
Enable jumbo build for the following component(s)/source_set(s):
- //crypto:crypto
- //dbus:dbus
- //gin:gin
- //google_apis:google_apis
- //google_apis/gcm:gcm
- //headless:headless_non_renderer
- //ipc:ipc
- //ipc:message_support
- //sql:sql
- //url:url
---
crypto/BUILD.gn | 3 ++-
crypto/unexportable_key.cc | 4 +++
crypto/user_verifying_key.cc | 4 +++
dbus/BUILD.gn | 3 ++-
gin/BUILD.gn | 6 ++++-
gin/per_isolate_data.cc | 2 +-
google_apis/BUILD.gn | 3 ++-
.../gaia/oauth2_access_token_fetcher_impl.cc | 6 +++++
google_apis/gaia/oauth2_mint_token_flow.cc | 6 +++++
google_apis/gcm/BUILD.gn | 3 ++-
...nstance_id_delete_token_request_handler.cc | 14 ++++++++++
.../gcm/engine/unregistration_request.cc | 26 +++++++++++++++++++
headless/BUILD.gn | 6 ++++-
ipc/BUILD.gn | 5 ++--
ipc/ipc_sync_channel.cc | 4 +++
ipc/ipc_sync_message_filter.cc | 4 +++
sql/BUILD.gn | 3 ++-
url/BUILD.gn | 3 ++-
18 files changed, 94 insertions(+), 11 deletions(-)
diff --git a/crypto/BUILD.gn b/crypto/BUILD.gn
index 7012d90890..cccc702f1a 100644
--- a/crypto/BUILD.gn
+++ b/crypto/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/buildflag_header.gni")
import("//build/config/chromeos/ui_mode.gni")
+import("//build/config/jumbo.gni")
import("//components/nacl/toolchain.gni")
import("//crypto/features.gni")
import("//testing/test.gni")
@@ -13,7 +14,7 @@ buildflag_header("buildflags") {
flags = [ "USE_NSS_CERTS=$use_nss_certs" ]
}
-component("crypto") {
+jumbo_component("crypto") {
output_name = "crcrypto" # Avoid colliding with OpenSSL's libcrypto.
sources = [
"aead.cc",
diff --git a/crypto/unexportable_key.cc b/crypto/unexportable_key.cc
index a199d5e9de..f318d5947f 100644
--- a/crypto/unexportable_key.cc
+++ b/crypto/unexportable_key.cc
@@ -7,6 +7,8 @@
#include "base/check.h"
#include "base/functional/bind.h"
+#define g_mock_provider g_mock_provider_unexportable_key
+
namespace crypto {
namespace {
@@ -78,3 +80,5 @@ void SetUnexportableKeyProviderForTesting(
} // namespace internal
} // namespace crypto
+
+#undef g_mock_provider
diff --git a/crypto/user_verifying_key.cc b/crypto/user_verifying_key.cc
index cf19160d55..9f660bbdc1 100644
--- a/crypto/user_verifying_key.cc
+++ b/crypto/user_verifying_key.cc
@@ -6,6 +6,8 @@
#include "base/check.h"
+#define g_mock_provider g_mock_provider_user_verifying_key
+
namespace crypto {
namespace {
@@ -89,3 +91,5 @@ void SetUserVerifyingKeyProviderForTesting(
} // namespace internal
} // namespace crypto
+
+#undef g_mock_provider
diff --git a/dbus/BUILD.gn b/dbus/BUILD.gn
index 8f96d8d425..5cd4c1856f 100644
--- a/dbus/BUILD.gn
+++ b/dbus/BUILD.gn
@@ -3,13 +3,14 @@
# found in the LICENSE file.
import("//build/config/features.gni")
+import("//build/config/jumbo.gni")
import("//build/config/ui.gni")
import("//testing/test.gni")
import("//third_party/protobuf/proto_library.gni")
assert(use_dbus)
-component("dbus") {
+jumbo_component("dbus") {
sources = [
"bus.cc",
"bus.h",
diff --git a/gin/BUILD.gn b/gin/BUILD.gn
index ed5d40bfb6..eb1f61ff83 100644
--- a/gin/BUILD.gn
+++ b/gin/BUILD.gn
@@ -6,11 +6,12 @@ if (is_android) {
import("//build/config/android/rules.gni")
}
import("//base/allocator/partition_allocator/partition_alloc.gni")
+import("//build/config/jumbo.gni")
import("//testing/test.gni")
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
import("//v8/gni/v8.gni")
-component("gin") {
+jumbo_component("gin") {
sources = [
"arguments.cc",
"arguments.h",
@@ -78,6 +79,9 @@ component("gin") {
"wrappable.h",
"wrapper_info.cc",
]
+ jumbo_excluded_sources = [
+ "converter.cc", # Fail to compile
+ ]
if (use_partition_alloc) {
sources += [
diff --git a/gin/per_isolate_data.cc b/gin/per_isolate_data.cc
index af2a28111e..aa81a09a6e 100644
--- a/gin/per_isolate_data.cc
+++ b/gin/per_isolate_data.cc
@@ -41,7 +41,7 @@ namespace gin {
PerIsolateData::PerIsolateData(
Isolate* isolate,
- ArrayBuffer::Allocator* allocator,
+ v8::ArrayBuffer::Allocator* allocator,
IsolateHolder::AccessMode access_mode,
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
scoped_refptr<base::SingleThreadTaskRunner> low_priority_task_runner)
diff --git a/google_apis/BUILD.gn b/google_apis/BUILD.gn
index bc1a4ec1c9..06f10b7b81 100644
--- a/google_apis/BUILD.gn
+++ b/google_apis/BUILD.gn
@@ -6,6 +6,7 @@ import("//build/buildflag_header.gni")
import("//build/config/chrome_build.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/features.gni")
+import("//build/config/jumbo.gni")
import("//extensions/buildflags/buildflags.gni")
import("//testing/test.gni")
import("//third_party/protobuf/proto_library.gni")
@@ -111,7 +112,7 @@ config("key_defines") {
}
}
-component("google_apis") {
+jumbo_component("google_apis") {
sources = [
"credentials_mode.cc",
"credentials_mode.h",
diff --git a/google_apis/gaia/oauth2_access_token_fetcher_impl.cc b/google_apis/gaia/oauth2_access_token_fetcher_impl.cc
index 89c17c107e..bfc4e1f02e 100644
--- a/google_apis/gaia/oauth2_access_token_fetcher_impl.cc
+++ b/google_apis/gaia/oauth2_access_token_fetcher_impl.cc
@@ -25,6 +25,9 @@
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
+#define kAccessTokenKey kAccessTokenKey_Access
+#define kExpiresInKey kExpiresInKey_Access
+
namespace {
constexpr char kGetAccessTokenBodyFormat[] =
@@ -441,3 +444,6 @@ bool OAuth2AccessTokenFetcherImpl::ParseGetAccessTokenFailureResponse(
return true;
}
+
+#undef kAccessTokenKey
+#undef kExpiresInKey
diff --git a/google_apis/gaia/oauth2_mint_token_flow.cc b/google_apis/gaia/oauth2_mint_token_flow.cc
index 5fdeeeef51..7ff5b53922 100644
--- a/google_apis/gaia/oauth2_mint_token_flow.cc
+++ b/google_apis/gaia/oauth2_mint_token_flow.cc
@@ -35,6 +35,9 @@
#include "net/http/http_status_code.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
+#define kAccessTokenKey kAccessTokenKey_Mint
+#define kExpiresInKey kExpiresInKey_Mint
+
namespace {
const char kValueFalse[] = "false";
@@ -531,3 +534,6 @@ OAuth2MintTokenFlow::GetNetworkTrafficAnnotationTag() {
}
})");
}
+
+#undef kAccessTokenKey
+#undef kExpiresInKey
diff --git a/google_apis/gcm/BUILD.gn b/google_apis/gcm/BUILD.gn
index 4509132085..ff5c5142b8 100644
--- a/google_apis/gcm/BUILD.gn
+++ b/google_apis/gcm/BUILD.gn
@@ -2,10 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//build/config/jumbo.gni")
import("//testing/test.gni")
import("//third_party/protobuf/proto_library.gni")
-component("gcm") {
+jumbo_component("gcm") {
sources = [
"base/gcm_constants.cc",
"base/gcm_constants.h",
diff --git a/google_apis/gcm/engine/instance_id_delete_token_request_handler.cc b/google_apis/gcm/engine/instance_id_delete_token_request_handler.cc
index 787a63648d..a791ec85d8 100644
--- a/google_apis/gcm/engine/instance_id_delete_token_request_handler.cc
+++ b/google_apis/gcm/engine/instance_id_delete_token_request_handler.cc
@@ -10,6 +10,13 @@
#include "base/strings/string_number_conversions.h"
#include "google_apis/gcm/base/gcm_util.h"
+#define kGMSVersionKey kGMSVersionKey_InstanceIDDeleteTokenRequestHandler
+#define kSenderKey kSenderKey_InstanceIDDeleteTokenRequestHandler
+#define kInstanceIDKey kInstanceIDKey_InstanceIDDeleteTokenRequestHandler
+#define kScopeKey kScopeKey_InstanceIDDeleteTokenRequestHandler
+#define kExtraScopeKey kExtraScopeKey_InstanceIDDeleteTokenRequestHandler
+#define kTokenPrefix kTokenPrefix_InstanceIDDeleteTokenRequestHandler
+
namespace gcm {
namespace {
@@ -61,3 +68,10 @@ InstanceIDDeleteTokenRequestHandler::ParseResponse(
}
} // namespace gcm
+
+#undef kGMSVersionKey
+#undef kSenderKey
+#undef kInstanceIDKey
+#undef kScopeKey
+#undef kExtraScopeKey
+#undef kTokenPrefix
diff --git a/google_apis/gcm/engine/unregistration_request.cc b/google_apis/gcm/engine/unregistration_request.cc
index fac62bcec2..f3702c20c8 100644
--- a/google_apis/gcm/engine/unregistration_request.cc
+++ b/google_apis/gcm/engine/unregistration_request.cc
@@ -25,6 +25,19 @@
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
+#define kRequestContentType kRequestContentType_UnRegistrationRequest
+#define kCategoryKey kCategoryKey_UnRegistrationRequest
+#define kSubtypeKey kSubtypeKey_UnRegistrationRequest
+#define kDeleteKey kDeleteKey_UnRegistrationRequest
+#define kDeleteValue kDeleteValue_UnRegistrationRequest
+#define kDeviceIdKey kDeviceIdKey_UnRegistrationRequest
+#define kLoginHeader kLoginHeader_UnRegistrationRequest
+#define kErrorPrefix kErrorPrefix_UnRegistrationRequest
+#define kInvalidParameters kInvalidParameters_UnRegistrationRequest
+#define kInternalServerError kInternalServerError_UnRegistrationRequest
+#define kDeviceRegistrationError kDeviceRegistrationError_UnRegistrationRequest
+#define GetStatusFromError GetStatusFromError_UnRegistrationRequest
+
namespace gcm {
namespace {
@@ -295,3 +308,16 @@ void UnregistrationRequest::OnURLLoadComplete(
}
} // namespace gcm
+
+#undef kRequestContentType
+#undef kCategoryKey
+#undef kSubtypeKey
+#undef kDeleteKey
+#undef kDeleteValue
+#undef kDeviceIdKey
+#undef kLoginHeader
+#undef kErrorPrefix
+#undef kInvalidParameters
+#undef kInternalServerError
+#undef kDeviceRegistrationError
+#undef GetStatusFromError
diff --git a/headless/BUILD.gn b/headless/BUILD.gn
index b11c9ecc2f..9344b2e331 100644
--- a/headless/BUILD.gn
+++ b/headless/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/config/c++/c++.gni")
import("//build/config/chrome_build.gni")
+import("//build/config/jumbo.gni")
import("//build/config/python.gni")
import("//build/util/lastchange.gni")
import("//build/util/process_version.gni")
@@ -230,7 +231,7 @@ static_library("backend_cdp_bindings") {
}
# Code that is not needed in a renderer process.
-component("headless_non_renderer") {
+jumbo_component("headless_non_renderer") {
sources = [
"lib/browser/command_line_handler.cc",
"lib/browser/command_line_handler.h",
@@ -295,6 +296,9 @@ component("headless_non_renderer") {
"public/util/user_agent.cc",
"public/util/user_agent.h",
]
+ jumbo_excluded_sources = [
+ "lib/utility/headless_content_utility_client.cc", # Conflict with //headless:headless_shell_lib
+ ]
configs += [ "//build/config/compiler:wexit_time_destructors" ]
diff --git a/ipc/BUILD.gn b/ipc/BUILD.gn
index bd8c19385a..72b86a8119 100644
--- a/ipc/BUILD.gn
+++ b/ipc/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/buildflag_header.gni")
import("//build/config/features.gni")
+import("//build/config/jumbo.gni")
import("//build/config/nacl/config.gni")
import("//ipc/features.gni")
import("//mojo/public/tools/bindings/mojom.gni")
@@ -17,7 +18,7 @@ buildflag_header("ipc_buildflags") {
flags = [ "IPC_MESSAGE_LOG_ENABLED=$enable_ipc_logging" ]
}
-component("ipc") {
+jumbo_component("ipc") {
sources = [
# These are the param_traits sources needed by all platforms,
# including ios. The rest are added in a conditional block below.
@@ -107,7 +108,7 @@ component("ipc") {
}
}
-component("message_support") {
+jumbo_component("message_support") {
sources = [
"ipc_message.cc",
"ipc_message.h",
diff --git a/ipc/ipc_sync_channel.cc b/ipc/ipc_sync_channel.cc
index 8b85ac1472..2dfbe16a40 100644
--- a/ipc/ipc_sync_channel.cc
+++ b/ipc/ipc_sync_channel.cc
@@ -35,6 +35,8 @@
using base::WaitableEvent;
+#define OnEventReady OnEventReadySyncChannel
+
namespace IPC {
namespace {
@@ -616,3 +618,5 @@ void SyncChannel::OnChannelInit() {
}
} // namespace IPC
+
+#undef OnEventReady
diff --git a/ipc/ipc_sync_message_filter.cc b/ipc/ipc_sync_message_filter.cc
index 15f66c849c..6114f78ca7 100644
--- a/ipc/ipc_sync_message_filter.cc
+++ b/ipc/ipc_sync_message_filter.cc
@@ -17,6 +17,8 @@
#include "mojo/public/cpp/bindings/associated_receiver.h"
#include "mojo/public/cpp/bindings/sync_handle_registry.h"
+#define OnEventReady OnEventReadySyncMessageFilter
+
namespace IPC {
namespace {
@@ -199,3 +201,5 @@ void SyncMessageFilter::GetRemoteAssociatedInterface(
}
} // namespace IPC
+
+#undef OnEventReady
diff --git a/sql/BUILD.gn b/sql/BUILD.gn
index 9a43377b30..9df9839e96 100644
--- a/sql/BUILD.gn
+++ b/sql/BUILD.gn
@@ -2,9 +2,10 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//build/config/jumbo.gni")
import("//testing/test.gni")
-component("sql") {
+jumbo_component("sql") {
sources = [
"database.cc",
"database.h",
diff --git a/url/BUILD.gn b/url/BUILD.gn
index f22b73bc29..24e81c3f5b 100644
--- a/url/BUILD.gn
+++ b/url/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/buildflag_header.gni")
+import("//build/config/jumbo.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")
import("features.gni")
@@ -19,7 +20,7 @@ buildflag_header("buildflags") {
flags = [ "USE_PLATFORM_ICU_ALTERNATIVES=$use_platform_icu_alternatives" ]
}
-component("url") {
+jumbo_component("url") {
sources = [
"gurl.cc",
"gurl.h",