Skip to content

[Bug]: building native module fails in electron 21 with error: type 'int' unexpected #36033

Closed as not planned

Description

@lenchvolodymyr

Preflight Checklist

Electron Version

21.1.1

What operating system are you using?

Windows

Operating System Version

Windows 10 Enterprise Version 21H2 OS build 19044.2130

What arch are you using?

x64

Last Known Working Electron version

19

Expected Behavior

When build native modules it builds successfully:

npx electron-rebuild -o kerberos

Actual Behavior

In electron 21 building native modules fails with errors:

\.electron-gyp\21.1.1\include\node\v8-callbacks.h(331): error C2062: type 'int' unexpected [C:\Users\User\Develop\electron\node_modules\kerberos\build\kerberos.vcxproj]

c:\users\user\.electron-gyp\21.1.1\include\node\v8-isolate.h(1531): error C2061: syntax error: identifier 'WasmDynamicTieringEnabledCallback'

there are also errors:

 error C2429: language feature 'terse static assert' requires compiler flag '/std:c++17'

But it can be easily fixed by modifying binding.gyp file:

'msvs_settings': {
   'VCCLCompilerTool': {
     'AdditionalOptions': [ '-std:c++17', ],
   },
 },

Testcase Gist URL

No response

Additional Information

To reproduce install npm modules:

npm i [email protected] electron-rebuild@latest [email protected]
npx electron-rebuild -o kerberos

Output:

$ npx electron-rebuild -o kerberos
- Searching dependency tree
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  kerberos.cc
c:\users\user\.electron-gyp\21.1.1\include\node\v8-internal.h(471): error C2429: language feature 'terse static assert' requires compiler flag '/std:c++17' [C:\Users\User\Develop\electron\node_modules\kerberos\build\kerberos.vcxproj]
c:\users\user\.electron-gyp\21.1.1\include\node\v8-internal.h(472): error C2429: language feature 'terse static assert' requires compiler flag '/std:c++17' [C:\Users\User\Develop\electron\node_modules\kerberos\build\kerberos.vcxproj]
c:\users\user\.electron-gyp\21.1.1\include\node\v8-internal.h(655): error C2429: language feature 'terse static assert' requires compiler flag '/std:c++17' [C:\Users\User\Develop\electron\node_modules\kerberos\build\kerberos.vcxproj]
c:\users\user\.electron-gyp\21.1.1\include\node\v8-internal.h(656): error C2429: language feature 'terse static assert' requires compiler flag '/std:c++17' [C:\Users\User\Develop\electron\node_modules\kerberos\build\kerberos.vcxproj]
c:\users\user\.electron-gyp\21.1.1\include\node\v8-internal.h(657): error C2429: language feature 'terse static assert' requires compiler flag '/std:c++17' [C:\Users\User\Develop\electron\node_modules\kerberos\build\kerberos.vcxproj]
c:\users\user\.electron-gyp\21.1.1\include\node\v8-callbacks.h(331): error C2062: type 'int' unexpected [C:\Users\User\Develop\electron\node_modules\kerberos\build\kerberos.vcxproj]
c:\users\user\.electron-gyp\21.1.1\include\node\v8-isolate.h(1531): error C2061: syntax error: identifier 'WasmDynamicTieringEnabledCallback' [C:\Users\User\Develop\electron\node_modules\kerberos\build\kerberos.vcxproj]
c:\users\user\.electron-gyp\21.1.1\include\node\v8-wasm.h(192): warning C4996: 'v8::WasmStreaming::Client': Use SetMoreFunctionsCanBeSerializedCallback [C:\Users\User\Develop\electron\node_modules\kerberos\build\kerberos.vcxproj]
  c:\users\user\.electron-gyp\21.1.1\include\node\v8-wasm.h(137): note: see declaration of 'v8::WasmStreaming::Client'
× Rebuild Failed

An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild 'C:\Users\User\Develop\electron\node_modules\kerberos'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1



Error: node-gyp failed to rebuild 'C:\Users\User\Develop\electron\node_modules\kerberos'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1


    at NodeGyp.rebuildModule (C:\Users\User\Develop\electron\node_modules\electron-rebuild\lib\src\module-type\node-gyp.js:120:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ModuleRebuilder.rebuildNodeGypModule (C:\Users\User\Develop\electron\node_modules\electron-rebuild\lib\src\module-rebuilder.js:98:9)
    at async ModuleRebuilder.rebuild (C:\Users\User\Develop\electron\node_modules\electron-rebuild\lib\src\module-rebuilder.js:128:14)
    at async Rebuilder.rebuildModuleAt (C:\Users\User\Develop\electron\node_modules\electron-rebuild\lib\src\rebuild.js:149:13)
    at async Rebuilder.rebuild (C:\Users\User\Develop\electron\node_modules\electron-rebuild\lib\src\rebuild.js:112:17)
    at async C:\Users\User\Develop\electron\node_modules\electron-rebuild\lib\src\cli.js:158:9

The reason why I created the issue in this repository is that electron-rebuild works just fine with [email protected] and electron@19. The issue happens in electron 21, and in 20 there are these errors and some more.

Also the issue related not only to the "kerberos" module but a bunch of others: cpu-features, [email protected], and probably more.

It would be great, if fix made in [email protected] will be migrated to 21.

Activity

  1. lenchvolodymyr commented on Oct 14, 2022

    @lenchvolodymyr
    Author

    probably, this commit is related to a needed fix:
    bf8dec7

  2. github-actions commented on Jan 17, 2023

    @github-actions
    Contributor

    This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

  3. github-actions commented on Feb 16, 2023

    @github-actions
    Contributor

    This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions