-
Notifications
You must be signed in to change notification settings - Fork 91
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Build fails for Electron 32 / Node 20.16.0 #163
Comments
From a very brief investigation the issue appears to be related to Node.js version and how it is treated in binding.gyp and node-gyp. Just like in your build adding The build itself runs using a specific version of Node.js and not a version that you have on your system so I suspect that where the problem is. I need to investigate further whether it is required for building |
Have a simple workaround in mind implementing it now. |
Unfortunately while my workaround does work the project still does not build. EDIT: This appears to be an issue with nan rather than Edge.js nodejs/nan#973 v30 - no warnings v31
v32
|
build.bat updated with workaround for Electron v32 awaiting new |
Unfortunately nan project has no plans to support newer version of v8 that ships with Electron v32 or future newer versions. |
@agracio hello! I have the same problem with v31 and nan. The problem is, I have an electron-react-boilerplate and rebuild script fails on this stage. So, I can't launch an app. |
Is that related to electron-edge-js build, it should be excluded from rebuild scripts. Electron 31 builds fine using build.bat but with warnings. |
I've cloned a latest version of the project, installed the node_modules and modified the build.bat file to build for the latest version of Electron (v32) with associated version of NodeJS (v20.16.0) according to the ElectronJS release notes.
If I then try and build the project using the command
\agracio_electron_edge_js> ./tools/build.bat release 32.0.0
the build fails with the errorfor both the i32 and x64 architectures.
If I build for a previous version <=v31 then the build succeeds as you would expect.
I'm building with NodeJS version 20.16.0, node-gyp version 10.2.0.
The change to build.bat is shown trivially below
I've done some analysis in order to try and resolve the issue but my knowledge of node-gyp is limited.
As far as I can see the initial problem is that despite the binding.gyp file referencing std:c++20 and LanguageStandard stdcpp20 when it generates the 3 vcxproj files in the build directory for the
build_managed
,edge_coreclr
andedge_native
targets it sets flags and options for C++17 not C++20 as below.I've tried some experiments; by commenting out the
node-gyp configure
statement in build.bat this then allows me to edit the vcxproj files by hand.Adding
<LanguageStandard>stdcpp20</LanguageStandard>
to the ClCompile section doesn't work because although the build recognises the request to use C++20, the C++17 shown above overrides it.Editing the
binding.gyp
file so that it includes -std:c++20 in the AdditionalOptions section doesn't work because instead of replacing the C++17 flag it simply adds the c++20 flag to the end of the additional options, so both the c++17 and the c++20 flags are inserted into the additional options. This does result in the build using C++20 because the output shows a warningcl : command line warning D9025: overriding '/std:c++17' with '/std:c++20'
However the build fails with multiple C2039 errors generated from nan.h "SetAccessor is not a memeber of.." and a C2440 error.
I've attached my ammended binding.gyp so that you can see where I've gone wrong and also the full transcript of the build output in case you are unable to reproduce it. I had to rename the gyp file to upload it.
electron_edge_js_out.txt
binding.gyp
Just to add I looked at the difference between the version 31 node/v8config.h and the version 32 of the same file - which is raising the the original >= C++20 error.and the file has changed. I'm not convinced is for the better.
From my reading the v31 file allows the use of C++17 or greater but then doesn't have the include v8-gn.h then it fails but the v32 version of the file excludes the use of C++17 or lower - forcing you to use C++20 or 23 even but then that contradicts the TODO comment above "once we only support compilers with full C++20 support. The code seems to have already implemented the requirement to use C++20 or greater but the added comment suggests its a work in progress and not done yet
I confess I don't fully understand
The text was updated successfully, but these errors were encountered: