Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure native modules use the correct config #35160

Conversation

trop[bot]
Copy link
Contributor

@trop trop bot commented Aug 1, 2022

Backport of #35159

See that PR for details.

Notes: Adds a warning for building native modules with node-gyp and electron-rebuild, encouraging users to upgrade to >=8.4.0 for node-gyp and >=3.2.8 for electron-rebuild if using Electron 20 or higher.

MarshallOfSound and others added 2 commits August 1, 2022 14:52
This works by patching node.h to check that two defines are set using the equivilant of an XNOR operation.  One define "ELECTRON_ENSURE_CONFIG_GYPI" is set via common.gypi which is _already_ used to build native modules and has been since the dawn of time.  Therefore this define will be set for all native module compilations targetting the Electron runtime.  The second define "USING_ELECTRON_CONFIG_GYPI" is only defined when the gypi argument "using_electron_config_gypi" is set to 1 which is only done so via config.gypi.  Only new enough versions of node-gyp correctly use the config.gypi file thus resulting in a compilation error on version of node-gyp that are too old.
@trop trop bot requested review from a team as code owners August 1, 2022 14:52
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Aug 1, 2022
@trop trop bot requested a review from VerteDinde August 1, 2022 14:52
@trop trop bot added 20-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Aug 1, 2022
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Aug 1, 2022
@VerteDinde
Copy link
Member

WOA failure is unrelated

@VerteDinde VerteDinde merged commit 6c29ab1 into 20-x-y Aug 1, 2022
@VerteDinde VerteDinde deleted the trop/20-x-y-bp-fix-ensure-native-modules-use-the-correct-config-1659365557973 branch August 1, 2022 18:44
@release-clerk
Copy link

release-clerk bot commented Aug 1, 2022

Release Notes Persisted

Adds a warning for building native modules with node-gyp and electron-rebuild, encouraging users to upgrade to >=8.4.0 for node-gyp and >=3.2.8 for electron-rebuild if using Electron 20 or higher..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
20-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants