#52290: build: only ship grit resources the binary actually references (macOS)
Follow-up to #51804, enabling grit resource allowlisting on macOS.
- the allowlist is extracted the same way as on Linux — a
--collect-inputs-onlypseudo-link whose inputs are scanned for theui::AllowlistedResource<id>markers — except that on macOS all of Electron's native code links into the Electron Framework, so the pseudo-link mirrors the framework's link inputs rather than the app shim's - the Apple
solinktool runs throughlinker_driver.pyinstead ofgcc_solink_wrapper.py, so the existing Chromium patch grows an equivalent--collect-inputs-onlymode there: skip the real link, write the input list to the output, and stub the other declared outputs (TOC, dSYM bundle, unstripped copy) so the mode also works in release builds where dSYMs/stripping are enabled ar.py's thin-archive expansion silently dropped regular archives (and raised on Mach-O universal archives likelibclang_rt.osx.a). Fine on Linux where the build uses thin archives everywhere, but on macOS static libraries are regular archives — ~1,700 of the framework's link inputs — so their objects were never scanned. Regular archives embed their members' contents, so they're now kept in the list and raw-scanned directlyelectron_resource_allowlist_checkruns against the mac pak paths (gen/electron_repack, with en-US shipping asen.pak) and gateselectron_dist_zipexactly as on Linux; no new suppressions or pak additions were needed — the paks added in #51804 already cover macOS
| macOS arm64 | before | after |
|---|---|---|
| locales (220 paks) | 47.1 MB | 8.6 MB |
(resources.pak / chrome_*.pak are unchanged by this PR — the additions from #51804 already ship on macOS.)
Verified against the built app: localized strings resolve from the slimmed paks (en/de/ja form-validation messages), DevTools, printToPDF, the PDF viewer, and chrome://histograms all load. Also verified the check fails correctly when a shipped pak is removed from its input list. Windows (PDB-based extraction) remains a follow-up; there this change is still inert.
Notes: Reduced the macOS distribution size by shipping only the locale strings that Electron can actually use.
Backports
No Backports Requested
This pull request doesn't have any backports requested or created for older release branches.
What are backports?
Backports are copies of changes made to the main branch that are applied to older release branches. They ensure that bug fixes and important changes are available in maintained older versions of Electron.
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron