Skip to content

Commit c1c8fbf

Browse files
build: make is_mas_build a generated header instead of config (#43737)
1 parent b838109 commit c1c8fbf

28 files changed

Lines changed: 600 additions & 305 deletions

‎BUILD.gn‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ source_set("electron_lib") {
532532
]
533533
}
534534

535-
configs += [ "//electron/build/config:mas_build" ]
535+
deps += [ "//electron/build/config:generate_mas_config" ]
536536

537537
sources = filenames.lib_sources
538538
if (is_win) {
@@ -906,12 +906,14 @@ if (is_mac) {
906906
assert(defined(invoker.helper_name_suffix))
907907

908908
output_name = electron_helper_name + invoker.helper_name_suffix
909-
deps = [ ":electron_framework+link" ]
909+
deps = [
910+
":electron_framework+link",
911+
"//electron/build/config:generate_mas_config",
912+
]
910913
if (!is_mas_build) {
911914
deps += [ "//sandbox/mac:seatbelt" ]
912915
}
913916
defines = [ "HELPER_EXECUTABLE" ]
914-
configs += [ "//electron/build/config:mas_build" ]
915917
sources = [
916918
"shell/app/electron_main_mac.cc",
917919
"shell/app/uv_stdio_fix.cc",
@@ -1067,6 +1069,7 @@ if (is_mac) {
10671069
":electron_app_plist",
10681070
":electron_app_resources",
10691071
":electron_fuses",
1072+
"//electron/build/config:generate_mas_config",
10701073
"//electron/buildflags",
10711074
]
10721075
if (is_mas_build) {
@@ -1081,7 +1084,6 @@ if (is_mac) {
10811084
"-rpath",
10821085
"@executable_path/../Frameworks",
10831086
]
1084-
configs += [ "//electron/build/config:mas_build" ]
10851087
}
10861088

10871089
if (enable_dsyms) {

‎build/config/BUILD.gn‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
# For MAS build, we force defining "MAS_BUILD".
2-
config("mas_build") {
1+
action("generate_mas_config") {
2+
outputs = [ "$target_gen_dir/../../mas.h" ]
3+
script = "../../script/generate-mas-config.py"
34
if (is_mas_build) {
4-
defines = [ "IS_MAS_BUILD()=1" ]
5+
args = [ "true" ]
56
} else {
6-
defines = [ "IS_MAS_BUILD()=0" ]
7+
args = [ "false" ]
78
}
9+
10+
args += rebase_path(outputs)
811
}

‎patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ index 78923a81c64fb7738f4e457e3166a88f3c150564..ee348433544550f99622b52252fd1064
3333
"//base",
3434
"//build:branding_buildflags",
3535
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
36-
index 7a23e63b800f87b6189ca04ce33c2c9b971e1152..50c51fad27925adf4a1e5fc9e03f7bca2153daa5 100644
36+
index 42f5441b7e78d0359727b3ca7702c80b9f6eeff8..2f154bbfde483f0cdeb336b631d238b8677b8486 100644
3737
--- a/chrome/browser/BUILD.gn
3838
+++ b/chrome/browser/BUILD.gn
39-
@@ -4482,7 +4482,7 @@ static_library("browser") {
39+
@@ -4480,7 +4480,7 @@ static_library("browser") {
4040
]
4141
}
4242

@@ -46,10 +46,10 @@ index 7a23e63b800f87b6189ca04ce33c2c9b971e1152..50c51fad27925adf4a1e5fc9e03f7bca
4646
# than here in :chrome_dll.
4747
deps += [ "//chrome:packed_resources_integrity_header" ]
4848
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
49-
index 633854df22c94cb2b7e02c1eda2663ca8091e11e..79ed45cf2b14ac3f504317305f4ae10e5413ff63 100644
49+
index de4a98c1bdb0c0e8a4a4051496fe4bb8c246e106..7a4594882a30f4d83b791d97a0f72842888197dc 100644
5050
--- a/chrome/test/BUILD.gn
5151
+++ b/chrome/test/BUILD.gn
52-
@@ -7050,9 +7050,12 @@ test("unit_tests") {
52+
@@ -7054,9 +7054,12 @@ test("unit_tests") {
5353
"//chrome/notification_helper",
5454
]
5555

@@ -63,7 +63,7 @@ index 633854df22c94cb2b7e02c1eda2663ca8091e11e..79ed45cf2b14ac3f504317305f4ae10e
6363
"//chrome//services/util_win:unit_tests",
6464
"//chrome/app:chrome_dll_resources",
6565
"//chrome/app:win_unit_tests",
66-
@@ -8079,6 +8082,10 @@ test("unit_tests") {
66+
@@ -8083,6 +8086,10 @@ test("unit_tests") {
6767
"../browser/performance_manager/policies/background_tab_loading_policy_unittest.cc",
6868
]
6969

@@ -74,7 +74,7 @@ index 633854df22c94cb2b7e02c1eda2663ca8091e11e..79ed45cf2b14ac3f504317305f4ae10e
7474
sources += [
7575
# The importer code is not used on Android.
7676
"../common/importer/firefox_importer_utils_unittest.cc",
77-
@@ -8146,7 +8153,6 @@ test("unit_tests") {
77+
@@ -8150,7 +8157,6 @@ test("unit_tests") {
7878
# Non-android deps for "unit_tests" target.
7979
deps += [
8080
"../browser/screen_ai:screen_ai_install_state",

‎patches/chromium/disable_compositor_recycling.patch‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Subject: fix: disabling compositor recycling
66
Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron.
77

88
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
9-
index 6a595dfebeeb53706b60429bc904095a2ab4cba9..dfed708b59a3b5f8e898e428b98adbc76f55fdf8 100644
9+
index 962dd6c34974a9377ca5a87425b1b801ba0a3f4d..550d59edbad2c0bb2b8f9c783433f138ffbe8c15 100644
1010
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
1111
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
12-
@@ -558,7 +558,11 @@
12+
@@ -559,7 +559,11 @@
1313
return;
1414

1515
host()->WasHidden();

‎patches/chromium/feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ index 58985ce62dc569256bad5e94de9c0d125fc470d0..33436784b691c860d58f8b4dfcc6718e
199199
&SelectFileDialogLinuxKde::OnSelectSingleFolderDialogResponse, this,
200200
parent));
201201
diff --git a/ui/shell_dialogs/select_file_dialog_linux_portal.cc b/ui/shell_dialogs/select_file_dialog_linux_portal.cc
202-
index 61ddcbf7bf57e423099c7d392a19b3ec79b5d03f..b2d2e11f72dcca5b3791a6dd3e9e5ae930a1f701 100644
202+
index 61ddcbf7bf57e423099c7d392a19b3ec79b5d03f..920d0610943091f850e44e3e0481abd7fe08f881 100644
203203
--- a/ui/shell_dialogs/select_file_dialog_linux_portal.cc
204204
+++ b/ui/shell_dialogs/select_file_dialog_linux_portal.cc
205205
@@ -44,7 +44,9 @@ constexpr char kMethodStartServiceByName[] = "StartServiceByName";

‎patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ index 8af69cac78b7488d28f1f05ccb174793fe5148cd..9f74e511c263d147b5fbe81fe100d217
9090
private:
9191
const HWND hwnd_;
9292
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
93-
index f907a3eea3843ccad7b15ca34137f42dbe57baa1..f3f0812be22067a06fc0afc3e52ffc252cd33f86 100644
93+
index 239fdc5a9ffef56f3b2c6667b1324c9f0a75c58e..dc3bf4440470da55193897aee6b431a475cffc84 100644
9494
--- a/components/viz/service/BUILD.gn
9595
+++ b/components/viz/service/BUILD.gn
9696
@@ -172,6 +172,8 @@ viz_component("service") {

‎patches/chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ We attempt to migrate the safe storage key from the old account, if that migrati
1212
Existing apps that aren't built for the app store should be unimpacted, there is one edge case where a user uses BOTH an AppStore and a darwin build of the same app only one will keep it's access to the safestorage key as during the migration we delete the old account. This is an acceptable edge case as no one should be actively using two versions of the same app.
1313

1414
diff --git a/components/os_crypt/sync/keychain_password_mac.mm b/components/os_crypt/sync/keychain_password_mac.mm
15-
index e7a65e97b51d93bff864889813317fb7c6ffc846..2b93da301b664f90720d2d2b5407be0985d7f334 100644
15+
index bb1fc0c99164ae4bdaaaa78e87c30e88932a928c..82d235709b79b1b3689b28ec8bfa02663ba219d6 100644
1616
--- a/components/os_crypt/sync/keychain_password_mac.mm
1717
+++ b/components/os_crypt/sync/keychain_password_mac.mm
18-
@@ -22,6 +22,12 @@
18+
@@ -23,6 +23,12 @@
1919
using KeychainNameContainerType = const base::NoDestructor<std::string>;
2020
#endif
2121

@@ -28,7 +28,7 @@ index e7a65e97b51d93bff864889813317fb7c6ffc846..2b93da301b664f90720d2d2b5407be09
2828
namespace {
2929

3030
// These two strings ARE indeed user facing. But they are used to access
31-
@@ -81,11 +87,18 @@
31+
@@ -82,11 +88,18 @@
3232
std::string KeychainPassword::GetPassword() const {
3333
UInt32 password_length = 0;
3434
void* password_data = nullptr;
@@ -49,7 +49,7 @@ index e7a65e97b51d93bff864889813317fb7c6ffc846..2b93da301b664f90720d2d2b5407be09
4949
if (error == noErr) {
5050
std::string password =
5151
std::string(static_cast<char*>(password_data), password_length);
52-
@@ -93,6 +106,49 @@
52+
@@ -94,6 +107,49 @@
5353
return password;
5454
}
5555

0 commit comments

Comments
 (0)