#53525: build: set macOS native-module gypi values from config.gypi
Merged
Description of Change
Two of our Node patches only exist to change what native module builds see in common.gypi on macOS: clang=1 (so node-gyp picks the clang/libc++/C++20 xcode settings) and MACOSX_DEPLOYMENT_TARGET=13.0 (#49691, upstream moved to 13.5 while Chromium still supports 13.0). Both values can be expressed from the config.gypi Electron already generates and ships next to common.gypi in the headers tarball, so this moves them there and drops the patches.
script/generate-config-gypi.pyadds['OS=="mac"', {'clang%': 1}]tovariables.conditions(same form the patch used insidecommon.gypi) and atarget_defaults.target_conditionsentry for the deployment target;target_conditionsevaluate aftercommon.gypi's ownconditions, so 13.0 wins over upstream's 13.5.- The file is now written with
json.dumpsinstead ofpprint: node-gyp readsconfig.gypiby swapping quote characters beforeJSON.parse, and only the JSON form round-trips condition strings containing"mac".tools/install.py'sast.literal_evalreads it unchanged. - Verified by evaluating a trivial
binding.gypwith node-gyp 12'saddon.gypi, upstream's unpatchedcommon.gypiand the newconfig.gypi(after node-gyp's parse/rewrite) forOS=mac|linux|win: the resulting target dicts match today's patchedcommon.gypi(gnu++20/libc++ xcode settings and13.0on mac, noClangCLtoolset on win, nothing on linux).
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
Release Notes
Notes: none
Backports
Semver Impact
Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.
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