electron/patches/chromium/resource_file_conflict.patch
trop[bot] 8de0bb5bc3
chore: bump chromium to 138.0.7175.0 (37-x-y) (#47078)
* chore: bump chromium in DEPS to 138.0.7166.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 138.0.7166.2

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* 6508373: Add WebContents, Tab getters for future Clank navigation capture rework

6508373

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* 6470924: Introduce auto-populated Search Engine icons.

6470924

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* 6502977: Force same tab navigation while actor coordinator is acting on a tab

6502977

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: bump chromium in DEPS to 138.0.7168.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* fix grit patch

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: bump Chromium to 138.0.7169.2

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* fixup! 6508373: Add WebContents, Tab getters for future Clank navigation capture rework

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* 6493688: NavigationThrottleRunner2: void CreateThrottlesForNavigation

6493688

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* 6488755: Reland "WebSQL: Remove WebPreference"

6488755

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* 6428707: FSA: Only normalize the hardcoded rules once during initialization

6428707

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: fixup patch indices

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: bump chromium in DEPS to 138.0.7170.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* 6514121: Remove origin calculation debug info and related methods

 6514121

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: bump chromium in DEPS to 138.0.7172.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 138.0.7173.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 138.0.7175.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* fixup! 6514121: Remove origin calculation debug info and related methods

Refs 6514121

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* 6531585: Don't retry LayerTreeSink creation on the high priority queue

Refs 6531585

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* 6512253: Modernize base::apple's base bundle ID

Refs 6512253

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* fixup! 6428707: FSA: Only normalize the hardcoded rules once during initialization

Refs 6428707

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* fixup! 6508373: Add WebContents, Tab getters for future Clank navigation capture rework

Refs 6508373

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* chore: update patches

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* chore: update patches

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2025-05-14 10:07:45 -04:00

79 lines
2.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Thu, 20 Sep 2018 17:48:59 -0700
Subject: resource_file_conflict.patch
Resolve conflict between //chrome's .pak files and //electron's. The paths
that chrome code hardcodes require that we generate resources at these
paths, but GN throws errors if there are multiple targets that generate the
same files.
This is due to the hardcoded names here:
https://chromium.googlesource.com/chromium/src/+/69.0.3497.106/ui/base/resource/resource_bundle.cc#780
and here:
https://chromium.googlesource.com/chromium/src/+/69.0.3497.106/ui/base/resource/resource_bundle_mac.mm#50
This isn't needed on Mac because resource files are copied into the app bundle,
and are built in `$root_out_dir/electron_repack` (while Chromium's resources
target `$root_out_dir/repack`), but on Windows and Linux, the resource files go
directly in `$root_out_dir`, and so they conflict.
We don't actually ever generate Chromium's resource paks, but without this
patch, GN refuses to generate the ninja files:
ERROR at //tools/grit/repack.gni:35:3: Duplicate output file.
action(_repack_target_name) {
^----------------------------
Two or more targets generate the same output:
chrome_100_percent.pak
This is can often be fixed by changing one of the target names, or by
setting an output_name on one of them.
Collisions:
//chrome:packed_resources_100_percent
//electron:packed_resources_100_percent
See //tools/grit/repack.gni:35:3: Collision.
action(_repack_target_name) {
^----------------------------
Some alternatives to this patch:
1. Refactor upstream in such a way that the "chrome" pak names were
configurable, for instance by adding a method to ResourceBundle::Delegate that
LoadChromeResources would check.
2. Pass a Delegate that overrides `GetPathForResourcePack`, check for the
`chrome_{100,200}_percent.pak` filenames, and rewrite them to
`electron_{100,200}_percent.pak`.
3. Initialize the resource bundle with DO_NOT_LOAD_COMMON_RESOURCES and load
the paks ourselves.
None of these options seems like a substantial maintainability win over this patch to me (@nornagon).
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index f47270687b9a12fb74be2e90cc1e9f25e2e2d34e..84fab7fcdb1a7ded880c0ff4867e09c740e7a5d2 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -1551,7 +1551,7 @@ if (is_chrome_branded && !is_android) {
}
}
-if (!is_android) {
+if (!is_android && !is_electron_build) {
chrome_paks("packed_resources") {
if (is_mac) {
output_dir = "$root_gen_dir/repack"
@@ -1597,6 +1597,12 @@ repack("browser_tests_pak") {
deps = [ "//chrome/test/data/webui:resources" ]
}
+if (is_electron_build) {
+ group("packed_resources") {
+ public_deps = [ "//electron:packed_resources" ]
+ }
+}
+
group("strings") {
public_deps = [
"//chrome/app:branded_strings",