Skip to content

src: do not use --allow-overwriting-for-next-flag - #66524

Closed
ShogunPanda wants to merge 3 commits into
nodejs:mainfrom
ShogunPanda:fix-jitless
Closed

ShogunPanda wants to merge 3 commits into
nodejs:mainfrom
ShogunPanda:fix-jitless

Conversation

@ShogunPanda

@ShogunPanda ShogunPanda commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Replace the V8 flag overrides introduced in #66459 with explicit rejection of unsupported modes. This removes the dependency on --allow-overwriting-for-next-flag, which newer V8 versions have removed, as an alternative to the revert proposed in #66516.

Changes

  • Reject --jitless and --lite-mode, including alternate spellings, before passing them to V8.
  • Report invalid CLI options with exit code 9.
  • Throw ERR_INVALID_ARG_VALUE from v8.setFlagsFromString() without applying any flags from the rejected call.
  • Use the diagnostic Node.js does not support V8 flag <flag>..
  • Update documentation and coverage for rejection, worker behavior, and continued WebAssembly availability after catching the error.

Notes

This preserves the removal of jitless support rather than restoring an opt-in. That behavior remains subject to agreement with reviewers.

Assisted-By: OpenAI:GPT-6.1 Sol <openai/gpt-6.1-sol>

Supersedes #66516.

Signed-off-by: Paolo Insogna <paolo@cowtech.it>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/startup

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. labels Oct 5, 2026
Signed-off-by: Paolo Insogna <paolo@cowtech.it>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Comment thread configure.py Outdated
# Reject the removed option before forwarding unknown arguments to GYP.
if any(arg.split('=', 1)[0] == '--v8-lite-mode' for arg in args):
parser.error('--v8-lite-mode is no longer supported; Node.js requires WebAssembly')
parser.error('Node.js does not support V8 flag --v8-lite-mode.')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because it's not strictly bound to WASM. Even FFI Fast API requires RX memory.

Comment thread doc/api/v8.md Outdated
Comment thread doc/api/cli.md Outdated
Signed-off-by: Paolo Insogna <paolo@cowtech.it>
@ShogunPanda

Copy link
Copy Markdown
Contributor Author

@aduh95 I totally reworded all message not to mention WASM. PTAL.

@ShogunPanda
ShogunPanda requested a review from aduh95 October 5, 2026 08:04
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@joyeecheung

joyeecheung commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

To follow up #66459 (comment) here:

2 - we let them to, but whenever the user tries to access WebAssemly we also throw an error and exit. But this also means that some part of Node might be totally unaccessible in the future.

I think this is a better outcome, or we can go a bit more friendly and throw when an API that requires WASM to function is loaded, similar to how we throw for crypto in no-openssl builds, that way users can get a more informative message and know what's going on. We could also introduce an error code for the unsupported feature for users to detect and fall back gracefully, say from the perspective of a library, if the built-in fetch is available, use that, otherwise use a custom one that doesn't need WASM to work, maybe at the expense of performance, but at least it stays functional. People do use --jitless on platforms where JIT is generally not available due to permission issues. We shouldn't assume that just because some built-in Node.js features are not available, people would be completely out of alternatives, especially in the case of fetch and TypeScript, when there are plenty of user land alternatives that work well under jitless mode.

@ShogunPanda

Copy link
Copy Markdown
Contributor Author

We already have ERR_WEBASSEMBLY_NOT_SUPPORTED for that.

I can live with that, but I also will explicitly document that we don't support or try to fallback feature when WASM o RX memory is lacking.

If you're fine with that I will send a PR.

@ShogunPanda

Copy link
Copy Markdown
Contributor Author

Obsoleted by #66516.

@ShogunPanda ShogunPanda closed this Oct 5, 2026
@ShogunPanda
ShogunPanda deleted the fix-jitless branch October 5, 2026 13:40
@ShogunPanda

ShogunPanda commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor Author

@joyeecheung I've created #66533 which implements #2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants