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

[GH-9095] Update to Electron 11 #9096

Closed

Conversation

AirSeeker
Copy link

@AirSeeker AirSeeker commented Feb 20, 2021

What it does

This PR:

  • update electron to version 11
  • update electron-store to version 7. Its required by electron 11.
  • update node to version 12.18.3. Its required by electron 11.
  • update docs with minimum version of node.
  • update minimum version of node in project.

Closes #9095.

How to test

  • Pull changes from repository branch.
  • Install node 12.18.3
  • Install dependencies by running command yarn in project root directory.
  • Run theia electron example by running command yarn start:electron
    • In case of errors caused by native modules run command yarn rebuild:clean && yarn rebuild:electron and repeat previous step.
  • Open chrome dev tools execute process.versions and verify that electron version is 11.
  • Manually test functionalities.

Review checklist

Reminder for reviewers

@AirSeeker AirSeeker force-pushed the update_to_electron_11 branch from 67a9000 to fefdbf3 Compare February 20, 2021 08:32
@kittaakos kittaakos self-requested a review February 20, 2021 15:59
@kittaakos
Copy link
Contributor

Thank you, @AirSeeker. Please make these changes also:

upgrade all dependencies via yarn upgrade.

Why? Was it required to be able to bump up to electron 11.x? If no, please do it in a subsequent PR. We want to minimize the changeset. Thank you!

@AirSeeker AirSeeker force-pushed the update_to_electron_11 branch from fefdbf3 to 13f48e2 Compare February 21, 2021 08:37
@AirSeeker
Copy link
Author

@kittaakos, I updated the description of PR, remove yarn upgrade changes from commit, and update the version of node for a project and in doc.

@AirSeeker
Copy link
Author

@kittaakos, about CI I don't know for sure, but I think that if the project has >=12.18.3 <13 and CI has 12.x it is ok. As long as it builds without errors. Should I change the version of the node in CI also?

@kittaakos
Copy link
Contributor

As long as it builds without errors. Should I change the version of the node in CI also?

Thanks for checking it. I agree; let's leave the CI as is.

@kittaakos
Copy link
Contributor

@AirSeeker, did you try to build it with Python 2?

✖ Rebuild Failed
Uncaught Exception:  Error: gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"
gyp http GET https://www.electronjs.org/headers/v11.3.0/node-v11.3.0-headers.tar.gz
gyp http 200 https://www.electronjs.org/headers/v11.3.0/node-v11.3.0-headers.tar.gz
gyp http GET https://www.electronjs.org/headers/v11.3.0/SHASUMS256.txt
gyp http 200 https://www.electronjs.org/headers/v11.3.0/SHASUMS256.txt
gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args   '/Users/akos.kitta/git/theia/node_modules/electron-rebuild/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   '/Users/akos.kitta/git/theia/node_modules/@theia/node-pty/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/akos.kitta/git/theia/node_modules/electron-rebuild/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/akos.kitta/.electron-gyp/11.3.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/akos.kitta/.electron-gyp/11.3.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/akos.kitta/git/theia/node_modules/electron-rebuild/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/akos.kitta/.electron-gyp/11.3.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/akos.kitta/git/theia/node_modules/@theia/node-pty',
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' ]
  CXX(target) Release/obj.target/pty/src/unix/pty.o
In file included from ../src/unix/pty.cc:20:
In file included from ../../../nan/nan.h:56:
In file included from /Users/akos.kitta/.electron-gyp/11.3.0/include/node/node.h:67:
In file included from /Users/akos.kitta/.electron-gyp/11.3.0/include/node/v8.h:30:
/Users/akos.kitta/.electron-gyp/11.3.0/include/node/v8-internal.h:418:38: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'?
            !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
                                ~~~~~^~~~~~~~~~~
                                     remove_cv
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:697:50: note: 'remove_cv' declared here
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
                                                 ^
1 error generated.
make: *** [Release/obj.target/pty/src/unix/pty.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/akos.kitta/git/theia/node_modules/electron-rebuild/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 20.3.0
gyp ERR! command "/Users/akos.kitta/.nvm/versions/node/v12.18.3/bin/node" "/Users/akos.kitta/git/theia/node_modules/electron-rebuild/node_modules/.bin/node-gyp" "rebuild" "--target=11.3.0" "--arch=x64" "--dist-url=https://www.electronjs.org/headers" "--build-from-source"
gyp ERR! cwd /Users/akos.kitta/git/theia/node_modules/@theia/node-pty
gyp ERR! node -v v12.18.3
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok 

Failed with exit code: 1
Error: gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"
gyp http GET https://www.electronjs.org/headers/v11.3.0/node-v11.3.0-headers.tar.gz
gyp http 200 https://www.electronjs.org/headers/v11.3.0/node-v11.3.0-headers.tar.gz
gyp http GET https://www.electronjs.org/headers/v11.3.0/SHASUMS256.txt
gyp http 200 https://www.electronjs.org/headers/v11.3.0/SHASUMS256.txt
gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args   '/Users/akos.kitta/git/theia/node_modules/electron-rebuild/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   '/Users/akos.kitta/git/theia/node_modules/@theia/node-pty/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/akos.kitta/git/theia/node_modules/electron-rebuild/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/akos.kitta/.electron-gyp/11.3.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/akos.kitta/.electron-gyp/11.3.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/akos.kitta/git/theia/node_modules/electron-rebuild/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/akos.kitta/.electron-gyp/11.3.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/akos.kitta/git/theia/node_modules/@theia/node-pty',
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' ]
  CXX(target) Release/obj.target/pty/src/unix/pty.o
In file included from ../src/unix/pty.cc:20:
In file included from ../../../nan/nan.h:56:
In file included from /Users/akos.kitta/.electron-gyp/11.3.0/include/node/node.h:67:
In file included from /Users/akos.kitta/.electron-gyp/11.3.0/include/node/v8.h:30:
/Users/akos.kitta/.electron-gyp/11.3.0/include/node/v8-internal.h:418:38: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'?
            !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
                                ~~~~~^~~~~~~~~~~
                                     remove_cv
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:697:50: note: 'remove_cv' declared here
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
                                                 ^
1 error generated.
make: *** [Release/obj.target/pty/src/unix/pty.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/akos.kitta/git/theia/node_modules/electron-rebuild/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 20.3.0
gyp ERR! command "/Users/akos.kitta/.nvm/versions/node/v12.18.3/bin/node" "/Users/akos.kitta/git/theia/node_modules/electron-rebuild/node_modules/.bin/node-gyp" "rebuild" "--target=11.3.0" "--arch=x64" "--dist-url=https://www.electronjs.org/headers" "--build-from-source"
gyp ERR! cwd /Users/akos.kitta/git/theia/node_modules/@theia/node-pty
gyp ERR! node -v v12.18.3
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok 

Failed with exit code: 1
    at SafeSubscriber._error (/Users/akos.kitta/git/theia/node_modules/spawn-rx/lib/src/index.js:267:84)
    at SafeSubscriber.__tryOrUnsub (/Users/akos.kitta/git/theia/node_modules/spawn-rx/node_modules/rxjs/internal/Subscriber.js:205:16)
    at SafeSubscriber.error (/Users/akos.kitta/git/theia/node_modules/spawn-rx/node_modules/rxjs/internal/Subscriber.js:156:26)
    at Subscriber._error (/Users/akos.kitta/git/theia/node_modules/spawn-rx/node_modules/rxjs/internal/Subscriber.js:92:26)
    at Subscriber.error (/Users/akos.kitta/git/theia/node_modules/spawn-rx/node_modules/rxjs/internal/Subscriber.js:72:18)
    at MapSubscriber.Subscriber._error (/Users/akos.kitta/git/theia/node_modules/spawn-rx/node_modules/rxjs/internal/Subscriber.js:92:26)
    at MapSubscriber.Subscriber.error (/Users/akos.kitta/git/theia/node_modules/spawn-rx/node_modules/rxjs/internal/Subscriber.js:72:18)
    at SafeSubscriber._next (/Users/akos.kitta/git/theia/node_modules/spawn-rx/lib/src/index.js:242:65)
    at SafeSubscriber.__tryOrUnsub (/Users/akos.kitta/git/theia/node_modules/spawn-rx/node_modules/rxjs/internal/Subscriber.js:205:16)
    at SafeSubscriber.next (/Users/akos.kitta/git/theia/node_modules/spawn-rx/node_modules/rxjs/internal/Subscriber.js:143:22)

I am getting an error like this 👆:

python --version
Python 2.7.15

It's not a blocker, but we need to clearly communicate that Python 2 won't work.

@kittaakos
Copy link
Contributor

@AirSeeker, it does not work with Python 3.x either. Did you manage to build and run it locally? Can you share some details about your env? Thanks!

I found a corresponding PR in node-pty. @vince-fugnitto, do you happen to know if our node-pty fork is up to date? The last rebase was in March 2020. (Note: the default branch has changed from master to main in the upstream.) Thank you!

@AirSeeker
Copy link
Author

@kittaakos I did build locally on Windows with Python 3.8.2.

@kittaakos
Copy link
Contributor

I did build locally on Windows with Python 3.8.2.

Thanks! I'll give it a try on another mac and Windows machines.

@vince-fugnitto
Copy link
Member

I found a corresponding PR in node-pty. @vince-fugnitto, do you happen to know if our node-pty fork is up to date? The last rebase was in March 2020. (Note: the default branch has changed from master to main in the upstream.) Thank you!

I believe that @marechal-p was the last to uplift the fork for theia-ide/node-pty.
If necessary, we should probably think of performing another uplift 👍

@kittaakos
Copy link
Contributor

I can confirm, it builds on Windows but not on macOS. I am using

Xcode 12.4
Build version 12D4e

if this matters. I also tried to use the upstream node-pty ("node-pty": "^0.10.0"), to check if we are missing some updates; it did not help. It failed with another kind of error when I ran yarn rebuild:electron.

@AirSeeker
Copy link
Author

@kittaakos, I can't test on macOS, but I tested on Ubuntu 20.04 VM with Python 3.8.5 and project builds without errors and electron launch successfully.

@vince-fugnitto vince-fugnitto added CQ Required (deprecated) issues requiring a CQ (contributor questionnaire) dependencies pull requests that update a dependency file electron issues related to the electron target labels Feb 23, 2021
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a heads-up, we will need to file appropriate CQs in order to accept the changes similarly to previous efforts:

@kittaakos
Copy link
Contributor

I can't test on macOS,

@AirSeeker, no problem. I do not expect you to have access to all platforms, but the purpose of this electron update is to support the new M1 chip on macOS. We need someone who can verify that it is still possible to build it on macOS. In fact, we should verify it somehow with the new M1 core also. The entire change is useless if the electron part is OK, but we have other Theia issues.

Of course, I might have the build issues because there is a problem with my env, but we need the steps on how to solve it.

@westbury
Copy link
Contributor

westbury commented Mar 8, 2021

I might have the build issues because there is a problem with my env

It's not your env. I'm seeing exactly the same problems on my Macbook Air M1.

I also tried to use the upstream node-pty

It's not a problem with node-pty. I hacked out node-pty and the build failed with the same error with nsfw and others. I should have a chance to look further at this on Wednesday.

@gabrielcsapo
Copy link

@westbury do you need help with debugging this on an m1 machine?

@kittaakos kittaakos removed their request for review July 18, 2021 12:21
@westbury westbury mentioned this pull request Aug 2, 2021
1 task
@paul-marechal
Copy link
Member

Closing in favor of #9936

Please share your feedback there if any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CQ Required (deprecated) issues requiring a CQ (contributor questionnaire) dependencies pull requests that update a dependency file electron issues related to the electron target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update to Electron 11
6 participants