-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
workaround electron-rebuild
bug
#10429
Conversation
01a5368
to
068c907
Compare
Just updated the signals to listen to: I mixed up |
068c907
to
9a85fa0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirmed that the changes work well:
-
yarn browser rebuild
-
yarn electron rebuild
-
npx theia rebuild:electron
(root) works well -
npx theia rebuild:browser
(root) works well - starting the browser app after the browser rebuild works
- starting the electron app after the electron rebuild works
- performing
ctrl+c
will revert the rebuild properly foryarn {app} rebuild
- performing
ctrl+c
will revert the rebuild properly fornpx theia rebuild:{app}
@vince-fugnitto the value of this PR lies in being able to do |
See electron/rebuild#888 The way we invoke `electron-rebuild` should allow Theia application developers to run `theia rebuild:*` from the root of their monorepos, but because of a bug in `electron-rebuild` it will only build dependencies listed in the `package.json` file located in `cwd`. Implement a workaround that modifies or creates a `package.json` file to list the dependencies to rebuild. Add exit hooks to cleanup in case users do `Ctrl+C` while theia rebuild is running so that we don't pollute user workspaces.
9a85fa0
to
64d7a37
Compare
@paul-marechal both :) I updated my comment #10429 (review). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only very minor punctuation comments on the code.
More substantively, I'm able to run npx theia rebuild:*
from the Theia repo root on master
(29ebe4c), so if that's the main objective of this PR, I'm not sure it's necessary. Is there something I'm missing there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comments re: punctuation stand, though they don't really need to be addressed. My comment re: ability to run npx theia rebuild:*
in the current state of master
appears to have been erroneous: that runs afoul of the electron rebuild bug, and a module fails to self register.
See electron/rebuild#888
The way we invoke
electron-rebuild
should allow Theia applicationdevelopers to run
theia rebuild:*
from the root of their monorepos,but because of a bug in
electron-rebuild
it will only builddependencies listed in the
package.json
file located incwd
.Implement a workaround that modifies or creates a
package.json
file tolist the dependencies to rebuild.
Add exit hooks to cleanup in case users do
Ctrl+C
while theia rebuildis running so that we don't pollute user workspaces.
How to test
npx theia rebuild:electron
andnpx theia rebuild:browser
from Theia's monorepo root. It should properly rebuild modules for the specified target.Ctrl+C
whiletheia rebuild:electron
is running should revert the modules back to the browser version.Ctrl+C
whiletheia rebuild:browser
is running should not prevent the process from finishing.Review checklist
Reminder for reviewers