codebytere

#53525: build: set macOS native-module gypi values from config.gypi

Merged
Created: Sep 4, 2026, 8:38:00 AM
Merged: Sep 4, 2026, 11:46:32 AM
3 comments
Target: main

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.py adds ['OS=="mac"', {'clang%': 1}] to variables.conditions (same form the patch used inside common.gypi) and a target_defaults.target_conditions entry for the deployment target; target_conditions evaluate after common.gypi's own conditions, so 13.0 wins over upstream's 13.5.
  • The file is now written with json.dumps instead of pprint: node-gyp reads config.gypi by swapping quote characters before JSON.parse, and only the JSON form round-trips condition strings containing "mac". tools/install.py's ast.literal_eval reads it unchanged.
  • Verified by evaluating a trivial binding.gyp with node-gyp 12's addon.gypi, upstream's unpatched common.gypi and the new config.gypi (after node-gyp's parse/rewrite) for OS=mac|linux|win: the resulting target dicts match today's patched common.gypi (gnu++20/libc++ xcode settings and 13.0 on mac, no ClangCL toolset on win, nothing on linux).

Checklist

Release Notes

Notes: none

Backports

44-x-y
Merged
PR Number
#53532
Merged At
Sep 4, 2026, 1:29:58 PM
Released In
Not yet
Release Date
Not yet
45-x-y
Merged
PR Number
#53531
Merged At
Sep 4, 2026, 1:29:56 PM
Released In
Not yet
Release Date
Not yet

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