feat: enable passing Node.js cli flags#21110
Conversation
a04ea40 to
7da7ab8
Compare
|
Current issue/consideration: Node.js will spit back a non-zero exit code (9) if any non-node switches are appended to the command line, which is the case by default for some switches like The Node.js flags passed will still work and be correctly set, but this makes me think that a more robust approach might instead be to safelist allowed flags instead of skipping a preset list of disallowed flags, which would ameliorate this issue entirely. What do you all think? |
|
What is the difference between this and the I am slightly not okay with maintaining any kind of blacklist for volatile structures, we tried to do that for chromium in the past but quickly proved inefficient #13039. Also any reason apps want this for production environments ? It would also simply not maintaining a list if its just for dev environment. |
|
At the moment, we introduce a lot of extra patch surface by exposing I would also be in favor of moving away from a blacklist approach and into a whitelist approach based on concerns you outlined above from a general safety perspective. |
I still don't understand why this is needed over I think we can agree inspector related flags are special case and it wouldn't be hard to handle them separately. But I don't see why we have to bring in parsing the whole set of node cli switches support when there is already another way to achieve it |
If the aim is to reduce the patch around |
|
I'd be happy to adapt this PR to just allow the set of I would say that i personally feel |
Yup that would be great, thanks!
True I agree with that as well but that comes to our personal choice, what I am trying to avoid is double parsing stuff, we already maintain a code path with blacklisted options for The primary goal here is to eliminate the patches around |
7da7ab8 to
6cf2a51
Compare
e02d010 to
a0752dd
Compare
e46e659 to
4aa3e1e
Compare
4aa3e1e to
385971a
Compare
|
I'll take a look at these test failures soon but as soon as that's handled this should be g2g. |
|
I'm adding |
|
@zcbenz thanks - i should be able to get back to this soon! |
b5d5ac4 to
e2ddab2
Compare
deepak1556
left a comment
There was a problem hiding this comment.
Failing tests are unrelated, LGTM. Thanks!
Can you fix the conflicts for merge.
e2ddab2 to
13e1d59
Compare
13e1d59 to
81992fd
Compare
|
@codebytere rebasing this against master should resolve the linux failures |
81992fd to
4fe4b89
Compare
|
Release Notes Persisted
|
Description of Change
This PR enables passing safelisted cli flags to Node.js to allow doing useful things like enabling experimental Node.js features.
For reasons outlined below, it seems safer to make different allowances for Electron itself vs Electron in
ELECTRON_RUN_AS_NODEmode. As such, this PR only allows passingDebugOptionsvia cli for prototypical Electron, and allows all options inELECTRON_RUN_AS_NODEmode.I've upstreamed the patch necessary to enable this at nodejs/node#30466.
cc @nornagon @MarshallOfSound @ckerr
Checklist
npm testpassesRelease Notes
Notes: Enable native Electron handling and passing of Node.js cli options.