-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Description
- Version: Any version
- Platform: All platforms
- Subsystem: native modules
What steps will reproduce the bug?
- Create a native node module that uses NaN and async cleanup behavior via node::AddEnvironmentCleanupHook.
- Compile for Electron 10.1.4 or higher
- Failure to build, because std::unique_ptr is not an ABI compatible interface
How often does it reproduce? Is there a required condition?
It reproduces when node is compiled for a different version of C++ than what MSVC uses with node-gyp. It looks like Chromium and therefore Electron switched which c++ stdlib it uses internally in M75.
What is the expected behavior?
Native modules should be able to use this API regardless of whether we're compiling for Electron or Node.
What do you see instead?
node-gyp cannot compile native modules for Electron when referencing a method that uses AsyncCleanupHookHandle, because it is just a typedef of std::unique_ptr.
Additional information
This is an issue with the changes implemented in response to this issue #34715. I think this is just something that was overlooked as when I inspected related code it looks like developers and reviewers were aware of this as an issue in the first place :) See https://github.com/nodejs/node/blob/master/src/api/hooks.cc#L103-L106.
@addaleax Help would be much appreciated :) We were unable to launch NodeGit for Electron 11 because of this :(.