Files
electron/build
Shelley Vohr 88833ddc7b build: read the macOS resource allowlist from the linked framework (#54233)
* build: read the macOS resource allowlist from the linked framework

grit's --allowlist-support markers are __attribute__((used)), so on
macOS every ui::AllowlistedResource<id> the framework references survives
the link as a symbol (ICF folds the bodies, not the names). Read them back
from the linked Electron Framework with llvm-nm - from the dSYM when the
framework itself is stripped - instead of pseudo-linking its inputs, and
hand the framework's resources to the bundle through bundle_deps so the
locale repack can depend on the link without a cycle.

That drops the linker_driver.py --collect-inputs-only mode and the
tools/resources/ar.py archive handling from the Chromium patch; what is
left is the one-line gcc_toolchain.gni assert for Linux, which is
https://chromium-review.googlesource.com/c/chromium/src/+/8360559.

* build: keep the resource allowlist arg permitted on macOS

gcc_toolchain.gni declares enable_resource_allowlist_generation and grit keys
--allowlist-support off it, so the assert there still has to admit mac for
the markers to exist; only the linker_driver.py and ar.py changes go.

* build: keep bundle-only deps off the Electron Framework link

//chrome:packed_resources forwards to :packed_resources, which now reaches the
framework link through :electron_resource_allowlist, so bundle_data left on
the link (the crashpad helper, xibs, dylib copies) leaked into
//chrome:chrome_framework and collided with its own Helpers entries at gn
gen. Give the link only electron_lib and libnode and route everything that
exists to populate the bundle through bundle_deps.

* build: keep the allowlist check out of dist.zip's runtime deps

GN's runtime-deps walk skips a shared library an action depends on directly
but follows one reached through a group, so ordering electron_dist_zip after
:electron_resource_allowlist_check via the runtime-deps group now pulled the
framework link's closure (Squirrel.framework, libffmpeg.dylib, the unbundled
framework binary) into dist.zip on macOS. Give dist_zip a build_deps that
orders the zip action without joining the group whose runtime deps are
zipped.
2026-09-23 16:17:22 -07:00
..
2023-11-30 09:51:35 -05:00
2025-02-27 14:31:21 +01:00