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

Different ways to allow V8 options in NODE_OPTIONS? #46339

Open
joyeecheung opened this issue Jan 24, 2023 · 3 comments
Open

Different ways to allow V8 options in NODE_OPTIONS? #46339

joyeecheung opened this issue Jan 24, 2023 · 3 comments

Comments

@joyeecheung
Copy link
Member

Refs: #46203

We should probably formulate a strategy on NODE_OPTIONS vis-a-vis V8 options because there are tons of them. Adding them haphazardly is, let's say, suboptimal.

Right now what we do is simply adding no-op options for these to our own option parser with kAllowedInEnvvar and pass them down to V8 to make them available to NODE_OPTIONS. We might want a different approach for that.

@juanarbol
Copy link
Member

I don't see the available options of V8 being exposed; I could work on a "getter" for those. See https://source.chromium.org/chromium/chromium/src/+/main:v8/src/api/api.cc;l=802?q=SetFlagsFromCommandLine&ss=chromium%2Fchromium%2Fsrc, like expose v8_flags in the V8 API; or maybe the printHelp() method, grab that output and parse it in the Node.js side.

@juanarbol
Copy link
Member

I'm working on a PoC for this :)

@juanarbol
Copy link
Member

I'm dealing with some errors, but from the V8 side, I got a way to get the flags.

I was considering creating a macro that runs the AddOption function or something like that. In the meantime, I will debug why flags are becoming random chars, but using printf usually works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants