-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Rebuilding native dependencies don't work for Electron 20 and up #7175
Comments
I seem to be having the same issue when upgrading from electron 19 to 20. Rebuilding native modules fails due to
|
Hmmm, can you try setting it via env vars? I see the gyp env allowing that as args electron-builder/packages/app-builder-lib/src/util/yarn.ts Lines 42 to 54 in d835aba
|
Hmm, I'm either not seeing the option to configure it or it does not appear to be configurable via env vars. Which variable exactly do you mean? I suppose it would have to be this option: |
I think it should be handled internally, same as in the |
So, AFAICT, I can't do that within electron-builder, as the native dependency rebuild seems to be handled by Go-library That being said, what I would like to do in the next major version bump of electron-builder is to migrate it to use electron-rebuild. "Install production dependencies" would function the same with it's conditional One thing we're dependent upon is electron/rebuild#989 for Seems like a minor nuisance with great benefit since we'd be migrating to an official electron package. For the interim folks, I think a workaround is to use the electron-rebuild package directly in the
|
I solved the problem in my own native node modules by defining the following setting in the "msvs_settings": {
"VCCLCompilerTool": { "AdditionalOptions": ["/std:c++17" ] }
} ... additionally i defined a custom install script that rebuilds to a specific electron-version: "manual-rebuild": "node-gyp rebuild --target=21.1.1 --arch=x64 --dist-url=https://electronjs.org/headers",
"install": "npm run manual-rebuild", together with (I also support to be able to specify the VCCL-Compiler via the electron builder) |
OK, but this is not a solution for the native dependencies which on npm and we have no control over it, so |
Quick update: Release 24.0.0-alpha.1 is the migration to electron-rebuild so you don't need the workaround. Please give it a shot (just note the breaking changes 🙂) |
I'm using Electron 21.2.0 and electron-builder 24.0.0-alpha.1 but it still doesn't seem to work :/ |
Tried Electron 21.0.1 and electron-builder 24.0.0-alpha.2 on macos and it's still failing. Currently trying to redo our build to use the workaround you suggested @mmaietta |
We are using v21.1.0 and 24.0.0-alpha.1 and it's working on GitHub Actions(macOS-latest, Windows-2022, and Ubuntu-22.04) |
Versions: Condensed errors:
Many more wc++17 warnings. Same issue on 24.0.0-alpha.1. Trying to track it down. Doesn't happen with the same native dep in electron quickstart, so it must be some kind of config gone awry. |
Hi @mmaietta Thanks for your help! • executing electron-rebuild appDir=C:\Users\oalfroukh\Desktop\Test projects\electron-quick-start arch=x64
• loaded configuration file=package.json ("build" field)
Attempting to build a module with a space in the path
See https://github.com/nodejs/node-gyp/issues/65#issuecomment-368820565 for reasons why this may not work
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
unpack_sqlite_dep
sqlite3.c
win_delay_load_hook.cc
sqlite3.vcxproj -> C:\Users\oalfroukh\Desktop\Test projects\electron-quick-start\node_modules\sqlite3\build\Release\\sqlite3.lib
backup.cc
C:\Users\oalfroukh\.electron-gyp\21.0.0\include\node\v8-internal.h(471,1): error C2429: language feature 'terse static assert' requires compiler flag '/std:c++17'
[C:\Users\oalfroukh\Desktop\Test projects\electron-quick-start\node_modules\sqlite3\build\node_sqlite3.vcxproj]
C:\Users\oalfroukh\.electron-gyp\21.0.0\include\node\v8-internal.h(472,1): error C2429: language feature 'terse static assert' requires compiler flag '/std:c++17'
[C:\Users\oalfroukh\Desktop\Test projects\electron-quick-start\node_modules\sqlite3\build\node_sqlite3.vcxproj]
C:\Users\oalfroukh\.electron-gyp\21.0.0\include\node\v8-internal.h(655,1): error C2429: language feature 'terse static assert' requires compiler flag '/std:c++17'
[C:\Users\oalfroukh\Desktop\Test projects\electron-quick-start\node_modules\sqlite3\build\node_sqlite3.vcxproj]
C:\Users\oalfroukh\.electron-gyp\21.0.0\include\node\v8-internal.h(656,1): error C2429: language feature 'terse static assert' requires compiler flag '/std:c++17'
[C:\Users\oalfroukh\Desktop\Test projects\electron-quick-start\node_modules\sqlite3\build\node_sqlite3.vcxproj]
C:\Users\oalfroukh\.electron-gyp\21.0.0\include\node\v8-internal.h(657,1): error C2429: language feature 'terse static assert' requires compiler flag '/std:c++17'
[C:\Users\oalfroukh\Desktop\Test projects\electron-quick-start\node_modules\sqlite3\build\node_sqlite3.vcxproj]
C:\Users\oalfroukh\.electron-gyp\21.0.0\include\node\v8-isolate.h(1531,45): warning C4996: 'v8::WasmDynamicTieringEnabledCallback': Dynamic tiering is now enabled
by default [C:\Users\oalfroukh\Desktop\Test projects\electron-quick-start\node_modules\sqlite3\build\node_sqlite3.vcxproj]
C:\Users\oalfroukh\.electron-gyp\21.0.0\include\node\v8-wasm.h(192,34): warning C4996: 'v8::WasmStreaming::Client': Use SetMoreFunctionsCanBeSerializedCallback [C:
\Users\oalfroukh\Desktop\Test projects\electron-quick-start\node_modules\sqlite3\build\node_sqlite3.vcxproj]
C:\Users\oalfroukh\Desktop\Test projects\electron-quick-start\node_modules\sqlite3\src\backup.cc(105,17): warning C4996: 'Nan::MakeCallback': was declared deprecat |
I get the same error as @oalfroukh |
If the error still exists, per electron/electron#35869, then there's nothing electron-builder can do to fix that. We use electron-rebuild upstream now in order to properly track electron changes. If you'd like to propose maintaining an upstream Go-library, app-builder-bin https://github.com/develar/app-builder, then you're welcome to contribute there such that it parses dependencies correctly and applies the right c++ flags. |
Thanks @mmaietta the issue is fixed from |
sqlite3 v4.2.0
as dependencies to prove the issue.v19.x
.The text was updated successfully, but these errors were encountered: