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

Update to Electron 22 #166265

Closed
7 tasks done
deepak1556 opened this issue Nov 14, 2022 · 49 comments
Closed
7 tasks done

Update to Electron 22 #166265

deepak1556 opened this issue Nov 14, 2022 · 49 comments
Assignees
Labels
electron Issues and items related to Electron electron-22-update engineering VS Code - Build / issue tracking / etc. upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Milestone

Comments

@deepak1556
Copy link
Contributor

deepak1556 commented Nov 14, 2022

  • Update patches
  • Nightly Exploration builds
  • Update native modules
  • Identify regressions from v8 sandbox
  • Update/Check LICENSE file in CG for new node.js version
  • Update LICENSE for new ffmpeg version
  • Upload symbols to appcenter
@mozhuanzuojing
Copy link

eletron22 released yesterday

@deepak1556 deepak1556 added engineering VS Code - Build / issue tracking / etc. upstream Issue identified as 'upstream' component related (exists outside of VS Code) electron Issues and items related to Electron labels Dec 8, 2022
@PF4Public
Copy link

@deepak1556 Have you attempted building electron-22.x.y branch? For me vscode lacks terminal. Could be node-pty or vscode issue?

@deepak1556
Copy link
Contributor Author

Which OS are you seeing the issue on ? Did all native modules compile successfully during yarn step ?

@PF4Public
Copy link

Which OS are you seeing the issue on ? Did all native modules compile successfully during yarn step ?

Linux. Yes, everything was compiled successfully but there was an error in Devtools console: something about posix spawn. I have rolled back to electron-21, but can re-test again at a later time.

@deepak1556
Copy link
Contributor Author

Terminal works fine in my linux machine with Electron 22 branch. Can you share the errors from console ?

@PF4Public
Copy link

Tried building vscode again, but it failed this time with tree-sitter. I remember it also failed last time, but skipped as it is an optional dependency. Now it fails further down the road:

[18:46:44] Starting 'vscode-linux-x64-min'...
[18:46:44] Starting clean-out-build ...
[18:46:44] Finished clean-out-build after 2 ms
[18:46:44] Starting build-web-node-paths ...
[18:46:45] Finished build-web-node-paths after 3 ms
[18:46:45] Starting compile-api-proposal-names ...
[18:46:45] Starting compilation api-proposal-names...
Assertion failed: bad export type for `tree_sitter_tsx_external_scanner_create`: undefined
Unhandled Rejection at: Promise Promise {
  <rejected> RuntimeError: abort(Assertion failed: bad export type for `tree_sitter_tsx_external_scanner_create`: undefined). Build with -s ASSERTIONS=1 for more info.
      at se (/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/web-tree-sitter/tree-sitter.js:1:6761)
      at k (/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/web-tree-sitter/tree-sitter.js:1:4462)
      at Pe (/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/web-tree-sitter/tree-sitter.js:1:12582)
      at c (/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/web-tree-sitter/tree-sitter.js:1:10613)
      at /var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/web-tree-sitter/tree-sitter.js:1:10879
      at async /var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/@vscode/l10n-dev/dist/main.js:254:10
      at async /var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/@vscode/l10n-dev/dist/main.js:243:22
} reason: RuntimeError: abort(Assertion failed: bad export type for `tree_sitter_tsx_external_scanner_create`: undefined). Build with -s ASSERTIONS=1 for more info.
    at se (/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/web-tree-sitter/tree-sitter.js:1:6761)
    at k (/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/web-tree-sitter/tree-sitter.js:1:4462)
    at Pe (/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/web-tree-sitter/tree-sitter.js:1:12582)
    at c (/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/web-tree-sitter/tree-sitter.js:1:10613)
    at /var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/web-tree-sitter/tree-sitter.js:1:10879
    at async /var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/@vscode/l10n-dev/dist/main.js:254:10
    at async /var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/@vscode/l10n-dev/dist/main.js:243:22
[18:46:45] The following tasks did not complete: vscode-linux-x64-min
[18:46:45] Did you forget to signal async completion?

The issue with tree-sitter is as follows:

warning Error running install script for optional dependency: /var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/build/node_modules/tree-sitter: Command failed.
Exit code: 1
Command: prebuild-install || node-gyp rebuild
Arguments: 
Directory: /var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/build/node_modules/tree-sitter
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@9.0.0
gyp info using node@16.17.1 | linux | x64
gyp info find Python using Python version 3.10.9 found at \"/usr/bin/python3.10\"
gyp WARN read config.gypi ENOENT: no such file or directory, open '/usr/include/electron-22/node/include/node/config.gypi'
gyp info spawn /usr/bin/python3.10
gyp info spawn args [
gyp info spawn args   '/usr/lib64/electron-22/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/build/node_modules/tree-sitter/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib64/electron-22/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/include/electron-22/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/usr/include/electron-22/node',
gyp info spawn args   '-Dnode_gyp_dir=/usr/lib64/electron-22/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/usr/include/electron-22/node/$(Configuration)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/build/node_modules/tree-sitter',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/build/node_modules/tree-sitter/build'
  CC(target) Release/obj.target/tree_sitter/vendor/tree-sitter/lib/src/lib.o
  AR(target) Release/obj.target/tree_sitter.a
  COPY Release/tree_sitter.a
  CXX(target) Release/obj.target/tree_sitter_runtime_binding/src/binding.o
In file included from /usr/include/electron-22/node/v8-object.h:10,
                 from /usr/include/electron-22/node/v8-array-buffer.h:13,
                 from /usr/include/electron-22/node/v8.h:24,
                 from /usr/include/electron-22/node/node.h:79,
                 from ../src/binding.cc:1:
/usr/include/electron-22/node/v8-persistent-handle.h:256:44: warning: ‘template<class T> struct v8::CopyablePersistentTraits’ is deprecated: Use v8::Global instead [-Wdeprecated-declarations]
  256 |   using CopyablePersistent = Persistent<T, CopyablePersistentTraits<T>>;
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/electron-22/node/v8-persistent-handle.h:255:48: note: declared here
  255 | struct V8_DEPRECATED(\"Use v8::Global instead\") CopyablePersistentTraits {
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../nan/nan.h:178,
                 from ../src/./language.h:4,
                 from ../src/binding.cc:3:
../../nan/nan_callbacks.h:55:23: error: ‘AccessorSignature’ is not a member of ‘v8’
   55 | typedef v8::Local<v8::AccessorSignature> Sig;
      |                       ^~~~~~~~~~~~~~~~~
../../nan/nan_callbacks.h:55:40: error: template argument 1 is invalid
   55 | typedef v8::Local<v8::AccessorSignature> Sig;
      |                                        ^
In file included from ../src/./language.h:4,
                 from ../src/binding.cc:3:
../../nan/nan.h:204:16: warning: ‘template<class T> struct v8::CopyablePersistentTraits’ is deprecated: Use v8::Global instead [-Wdeprecated-declarations]
  204 |     public v8::CopyablePersistentTraits<T> {};
      |                ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/electron-22/node/v8-object.h:10,
                 from /usr/include/electron-22/node/v8-array-buffer.h:13,
                 from /usr/include/electron-22/node/v8.h:24,
                 from /usr/include/electron-22/node/node.h:79,
                 from ../src/binding.cc:1:
/usr/include/electron-22/node/v8-persistent-handle.h:255:48: note: declared here
  255 | struct V8_DEPRECATED(\"Use v8::Global instead\") CopyablePersistentTraits {
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/./language.h:4,
                 from ../src/binding.cc:3:
../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig)’:
../../nan/nan.h:2544:19: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>&, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&), v8::Local<v8::Object>&, v8::AccessControl&, v8::PropertyAttribute&, Nan::imp::Sig&)’
 2544 |   tpl->SetAccessor(
      |   ~~~~~~~~~~~~~~~~^
 2545 |       name
      |       ~~~~         
 2546 |     , getter_
      |     ~~~~~~~~~      
 2547 |     , setter_
      |     ~~~~~~~~~      
 2548 |     , obj
      |     ~~~~~          
 2549 |     , settings
      |     ~~~~~~~~~~     
 2550 |     , attribute
      |     ~~~~~~~~~~~    
 2551 |     , signature);
      |     ~~~~~~~~~~~~   
In file included from /usr/include/electron-22/node/v8-function.h:15,
                 from /usr/include/electron-22/node/v8.h:33,
                 from /usr/include/electron-22/node/node.h:79,
                 from ../src/binding.cc:1:
/usr/include/electron-22/node/v8-template.h:807:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
  807 |   void SetAccessor(
      |        ^~~~~~~~~~~
/usr/include/electron-22/node/v8-template.h:812:22: note:   no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
  812 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
      |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/electron-22/node/v8-template.h:814:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
  814 |   void SetAccessor(
      |        ^~~~~~~~~~~
/usr/include/electron-22/node/v8-template.h:819:22: note:   no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
  819 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
      |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/binding.cc:1:
../src/binding.cc: At global scope:
/usr/include/electron-22/node/node.h:874:7: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
  874 |       (node::addon_register_func) (regfunc),                          \\\n      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/electron-22/node/node.h:908:3: note: in expansion of macro ‘NODE_MODULE_X’
  908 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/binding.cc:25:1: note: in expansion of macro ‘NODE_MODULE’
   25 | NODE_MODULE(tree_sitter_runtime_binding, InitAll)
      | ^~~~~~~~~~~
make: *** [tree_sitter_runtime_binding.target.mk:139: Release/obj.target/tree_sitter_runtime_binding/src/binding.o] Error 1
make: Leaving directory '/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/build/node_modules/tree-sitter/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib64/electron-22/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Linux 5.15.80-gentoo
gyp ERR! command \"/usr/lib64/electron-22/electron\" \"/usr/lib64/electron-22/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"
gyp ERR! cwd /var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/build/node_modules/tree-sitter
gyp ERR! node -v v16.17.1



warning Error running install script for optional dependency: /var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/build/node_modules/tree-sitter-typescript: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/build/node_modules/tree-sitter-typescript
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@9.0.0
gyp info using node@16.17.1 | linux | x64
gyp info find Python using Python version 3.10.9 found at \"/usr/bin/python3.10\"
gyp WARN read config.gypi ENOENT: no such file or directory, open '/usr/include/electron-22/node/include/node/config.gypi'
gyp info spawn /usr/bin/python3.10
gyp info spawn args [
gyp info spawn args   '/usr/lib64/electron-22/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/build/node_modules/tree-sitter-typescript/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib64/electron-22/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/include/electron-22/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/usr/include/electron-22/node',
gyp info spawn args   '-Dnode_gyp_dir=/usr/lib64/electron-22/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/usr/include/electron-22/node/$(Configuration)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/build/node_modules/tree-sitter-typescript',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/build/node_modules/tree-sitter-typescript/build'
  CC(target) Release/obj.target/tree_sitter_typescript_binding/typescript/src/parser.o
In file included from ../typescript/src/parser.c:1:
../typescript/src/parser.c: In function ‘ts_lex_keywords’:
../typescript/src/tree_sitter/parser.h:135:8: warning: variable ‘eof’ set but not used [-Wunused-but-set-variable]
  135 |   bool eof = false;             \\\n      |        ^~~
../typescript/src/parser.c:5342:3: note: in expansion of macro ‘START_LEXER’
 5342 |   START_LEXER();
      |   ^~~~~~~~~~~
  CC(target) Release/obj.target/tree_sitter_typescript_binding/typescript/src/scanner.o
  CC(target) Release/obj.target/tree_sitter_typescript_binding/tsx/src/parser.o
In file included from ../tsx/src/parser.c:1:
../tsx/src/parser.c: In function ‘ts_lex_keywords’:
../typescript/src/tree_sitter/parser.h:135:8: warning: variable ‘eof’ set but not used [-Wunused-but-set-variable]
  135 |   bool eof = false;             \\\n      |        ^~~
../tsx/src/parser.c:5600:3: note: in expansion of macro ‘START_LEXER’
 5600 |   START_LEXER();
      |   ^~~~~~~~~~~
  CC(target) Release/obj.target/tree_sitter_typescript_binding/tsx/src/scanner.o
  CXX(target) Release/obj.target/tree_sitter_typescript_binding/bindings/node/binding.o
In file included from /usr/include/electron-22/node/v8-object.h:10,
                 from /usr/include/electron-22/node/v8-array-buffer.h:13,
                 from /usr/include/electron-22/node/v8.h:24,
                 from /usr/include/electron-22/node/node.h:79,
                 from ../bindings/node/binding.cc:2:
/usr/include/electron-22/node/v8-persistent-handle.h:256:44: warning: ‘template<class T> struct v8::CopyablePersistentTraits’ is deprecated: Use v8::Global instead [-Wdeprecated-declarations]
  256 |   using CopyablePersistent = Persistent<T, CopyablePersistentTraits<T>>;
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/electron-22/node/v8-persistent-handle.h:255:48: note: declared here
  255 | struct V8_DEPRECATED(\"Use v8::Global instead\") CopyablePersistentTraits {
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../nan/nan.h:178,
                 from ../bindings/node/binding.cc:3:
../../nan/nan_callbacks.h:55:23: error: ‘AccessorSignature’ is not a member of ‘v8’
   55 | typedef v8::Local<v8::AccessorSignature> Sig;
      |                       ^~~~~~~~~~~~~~~~~
../../nan/nan_callbacks.h:55:40: error: template argument 1 is invalid
   55 | typedef v8::Local<v8::AccessorSignature> Sig;
      |                                        ^
In file included from ../bindings/node/binding.cc:3:
../../nan/nan.h:204:16: warning: ‘template<class T> struct v8::CopyablePersistentTraits’ is deprecated: Use v8::Global instead [-Wdeprecated-declarations]
  204 |     public v8::CopyablePersistentTraits<T> {};
      |                ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/electron-22/node/v8-object.h:10,
                 from /usr/include/electron-22/node/v8-array-buffer.h:13,
                 from /usr/include/electron-22/node/v8.h:24,
                 from /usr/include/electron-22/node/node.h:79,
                 from ../bindings/node/binding.cc:2:
/usr/include/electron-22/node/v8-persistent-handle.h:255:48: note: declared here
  255 | struct V8_DEPRECATED(\"Use v8::Global instead\") CopyablePersistentTraits {
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../bindings/node/binding.cc:3:
../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig)’:
../../nan/nan.h:2544:19: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>&, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&), v8::Local<v8::Object>&, v8::AccessControl&, v8::PropertyAttribute&, Nan::imp::Sig&)’
 2544 |   tpl->SetAccessor(
      |   ~~~~~~~~~~~~~~~~^
 2545 |       name
      |       ~~~~         
 2546 |     , getter_
      |     ~~~~~~~~~      
 2547 |     , setter_
      |     ~~~~~~~~~      
 2548 |     , obj
      |     ~~~~~          
 2549 |     , settings
      |     ~~~~~~~~~~     
 2550 |     , attribute
      |     ~~~~~~~~~~~    
 2551 |     , signature);
      |     ~~~~~~~~~~~~   
In file included from /usr/include/electron-22/node/v8-function.h:15,
                 from /usr/include/electron-22/node/v8.h:33,
                 from /usr/include/electron-22/node/node.h:79,
                 from ../bindings/node/binding.cc:2:
/usr/include/electron-22/node/v8-template.h:807:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
  807 |   void SetAccessor(
      |        ^~~~~~~~~~~
/usr/include/electron-22/node/v8-template.h:812:22: note:   no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
  812 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
      |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/electron-22/node/v8-template.h:814:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
  814 |   void SetAccessor(
      |        ^~~~~~~~~~~
/usr/include/electron-22/node/v8-template.h:819:22: note:   no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
  819 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
      |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../bindings/node/binding.cc:2:
../bindings/node/binding.cc: At global scope:
/usr/include/electron-22/node/node.h:874:7: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Object>)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
  874 |       (node::addon_register_func) (regfunc),                          \\\n      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/electron-22/node/node.h:908:3: note: in expansion of macro ‘NODE_MODULE_X’
  908 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../bindings/node/binding.cc:35:1: note: in expansion of macro ‘NODE_MODULE’
   35 | NODE_MODULE(tree_sitter_typescript_binding, Init)
      | ^~~~~~~~~~~
make: *** [tree_sitter_typescript_binding.target.mk:129: Release/obj.target/tree_sitter_typescript_binding/bindings/node/binding.o] Error 1
make: Leaving directory '/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/build/node_modules/tree-sitter-typescript/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib64/electron-22/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Linux 5.15.80-gentoo
gyp ERR! command \"/usr/lib64/electron-22/electron\" \"/usr/lib64/electron-22/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"
gyp ERR! cwd /var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/build/node_modules/tree-sitter-typescript
gyp ERR! node -v v16.17.1
Done in 16.50s.

Looks like it also needs to bump nan to avoid AccessorSignatures

@deepak1556
Copy link
Contributor Author

Ah okay I didn't realize you are doing a full build rather than running out of sources, yeah the tree-sitter package needs a nan update.

@tjx666
Copy link
Contributor

tjx666 commented Dec 22, 2022

@deepak1556 Plan to support node18?

@deepak1556
Copy link
Contributor Author

It will happen when we update to Electron 23, not before that :)

@PF4Public
Copy link

Adding "nan": "^2.17.0" to resolutions helps building tree-sitter, but this issue persists:

[16:14:25] Using gulpfile /var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/gulpfile.js
[16:14:25] Starting 'vscode-linux-x64-min'...
[16:14:25] Starting clean-out-build ...
[16:14:25] Finished clean-out-build after 6 ms
[16:14:25] Starting build-web-node-paths ...
[16:14:25] Finished build-web-node-paths after 5 ms
[16:14:25] Starting compile-api-proposal-names ...
[16:14:25] Starting compilation api-proposal-names...
Assertion failed: bad export type for `tree_sitter_tsx_external_scanner_create`: undefined
Unhandled Rejection at: Promise Promise {
  <rejected> RuntimeError: abort(Assertion failed: bad export type for `tree_sitter_tsx_external_scanner_create`: undefined). Build with -s ASSERTIONS=1 for more info.

@ReazerDev
Copy link

Everything works fine for me on arch 6.1.5.
Is there anything I can test to help get this PR ready for this month's release?

Electron 22 fixes the blurriness I experience on Wayland. It'd be amazing if this get's released this month! :)

@lorand-horvath
Copy link

lorand-horvath commented Jan 14, 2023

Electron 22 fixes the blurriness I experience on Wayland. It'd be amazing if this get's released this month! :)

Electron 22 will not be integrated in the January release, the upgrade is only being investigated - at least that's the plan at the moment, see Electron heading in #170413

@deepak1556
Copy link
Contributor Author

@ReazerDev the plan is to provide nightly exploration builds in January milestone which will then be tested during our iteration endgame. We will push the update to Insiders in February milestone depending on the results from testing. Currently the exploration builds were blocked on #166430 (comment) which was recently addressed in 22.0.2, we can move forward on those builds this week :)

@PF4Public
Copy link

vscode/l10n-dev-0.0.21 depends on web-tree-sitter which depends on tree-sitter, which hasn't been updated since ages and predictably does not build. Even though master branch from tree-sitter/node-tree-sitter does solve one issue, there is still another build failure which prevents it from building.

I would speculate it all started with 0510da8 and indeed 88c8146 is the last functioning commit for me.

@lorand-horvath
Copy link

@deepak1556 I see you had to revert to Electron 19 3a11b47 Are there some kind of issues with Electron 22?

@PF4Public
Copy link

@deepak1556 I see you had to revert to Electron 19 3a11b47 Are there some kind of issues with Electron 22?

At least one is just above your message ;)

@ollie-iterators
Copy link

Is one of the issues with this: #171508?

@deepak1556
Copy link
Contributor Author

Sorry for the silence on the update, we have been investigating the impact of V8 sandbox for our extensions over the last two weeks, you can find info on that at #177338. We have plan to move the update forward, but we will not merge the update for March 2023 milestone.

@PF4Public
Copy link

PF4Public commented Apr 16, 2023

In case anyone is interested, the error tree_sitter_tsx_external_scanner_create comes from https://github.com/microsoft/vscode-l10n/blob/b941cad5b485dad98dc33bfa43b2c0542f8f7e44/l10n-dev/src/ast/analyzer.ts#L41-L52

	static #tsGrammar: Promise<Parser.Language> = (async () => {
		await initParser;
		return await Parser.Language.load(
			path.resolve(__dirname, 'tree-sitter-typescript.wasm')
		);
	})();
	static #tsxGrammar: Promise<Parser.Language> = (async () => {
		await initParser;
		return await Parser.Language.load(
			path.resolve(__dirname, 'tree-sitter-tsx.wasm')
		);
	})();

Both wasm files come pre-built from @vscode/l10n-dev.
Changing the dependency to version 0.0.24 changes the error (although that may be a race condition between the two):

Unhandled Rejection at: Promise Promise {
  <rejected> Error: bad export type for `tree_sitter_typescript_external_scanner_create`: undefined
      at reportUndefinedSymbols (/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/web-tree-sitter/tree-sitter.js:1:19748)
      at postInstantiation (/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/web-tree-sitter/tree-sitter.js:1:17027)
      at /var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/web-tree-sitter/tree-sitter.js:1:17752
      at async /var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/@vscode/l10n-dev/dist/main.js:270:10
      at async /var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/@vscode/l10n-dev/dist/main.js:259:22
} reason: Error: bad export type for `tree_sitter_typescript_external_scanner_create`: undefined
    at reportUndefinedSymbols (/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/web-tree-sitter/tree-sitter.js:1:19748)
    at postInstantiation (/var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/web-tree-sitter/tree-sitter.js:1:17027)
    at /var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/web-tree-sitter/tree-sitter.js:1:17752
    at async /var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/@vscode/l10n-dev/dist/main.js:270:10
    at async /var/tmp/portage/app-editors/vscode-9999/work/vscode-9999/node_modules/@vscode/l10n-dev/dist/main.js:259:22

Lines 259 and 270 from the error look as follows:

__privateAdd(ScriptAnalyzer, _tsxParser, (async () => {
  await initParser;
  const parser = new import_web_tree_sitter.default();
  parser.setLanguage(await __privateGet(_ScriptAnalyzer, _tsxGrammar));
  return parser;
})());

__privateAdd(ScriptAnalyzer, _tsxGrammar, (async () => {
  await initParser;
  return await import_web_tree_sitter.default.Language.load(
    path.resolve(__dirname, "tree-sitter-tsx.wasm")
  );
})());

In this case tree_sitter_typescript_external_scanner_create is absent from tree-sitter-tsx.wasm, but present in tree-sitter-typescript.wasm.

I have no idea, why is it trying to load a function that is absent from wasm file. Broken wasm files in @vscode/l10n-dev?

PS: I've filed this issue in vscode-l10n repo

@deepak1556
Copy link
Contributor Author

Closing as we will be shipping E22 update with v1.78

@The-BDD-Coach
Copy link

The-BDD-Coach commented May 12, 2023

@deepak1556 VSCode 1.78 is out, and this bug is biting people (including me). I am getting 'bad export type for tree_sitter_typescript_external_scanner_create: undefined' when I start VSCode.

If the fix has already been shipped, can you reply to cucumber/vscode#155 and tell people what they must do to get the fix? For me, VSCode says that there are no updates available, and I am already running Electron 22.

Version: 1.78.2
Commit: b3e4e68
Date: 2023-05-10T15:00:40.428Z
Electron: 22.5.2
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 22.4.0
Sandboxed: Yes

@deepak1556
Copy link
Contributor Author

@The-BDD-Coach it needs to be addressed in tree-sitter/tree-sitter-typescript#244, you can add allowUndefined: true to the load arguments in https://github.com/tree-sitter/tree-sitter/blob/91e4d940169a0c0b024560632ef53c4f119117ca/lib/binding_web/binding.js#L911 to suppress the error temporarily

@nethershaw
Copy link

nethershaw commented May 26, 2023

@deepak1556 I have personally wasted a week of development time trying to repair a broken installation and build VSCode 1.78+ against Electron 22, 23, and 24 only to find that you ignored several warnings from @PF4Public and merged before tree-sitter/tree-sitter-typescript#244 was resolved or even acknowledged where reported.

They commented several times and you didn't pay them any attention whatsoever.

You have my thanks as I task my build system with reverting to VSCode 1.77.3 and Electron 19 and I wait.

@deepak1556
Copy link
Contributor Author

@nethershaw our own build systems did not encounter the issue and hence action was not taken in this issue, if you are building VSCode in a custom way that is not referred in the docs then there is not much we can do to help. Please also check microsoft/vscode-l10n#104 where the issue was actually followed up on by @TylerLeonhardt .

@darkbasic
Copy link

This is also most likely related: #182743
If you have any suggestions on how to get any kind of logs would be greatly appreciated because while electron-19 doesn't crashes vscode itself returns without showing anything in the logs.

our own build systems did not encounter the issue and hence action was not taken

If I had read this out of context I would have said it smells like a big tech company who doesn't know anything about open source and completely ignores the community, distribution maintainers, etc. While it definitely doesn't apply to vscode it's still sad seeing such bug reports being so easily dismissed.

@nethershaw
Copy link

Don't @ me. You respond to the person you ignored.

@microsoft microsoft locked as too heated and limited conversation to collaborators May 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
electron Issues and items related to Electron electron-22-update engineering VS Code - Build / issue tracking / etc. upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
Archived in project
Electron Integration
  
✔️ Done / Deferred
Development

No branches or pull requests

14 participants