Skip to content

module: exclude node:ffi from builtinModules when flag is disabled#63158

Open
ljharb wants to merge 1 commit intonodejs:mainfrom
ljharb:fix-ffi-builtin-modules
Open

module: exclude node:ffi from builtinModules when flag is disabled#63158
ljharb wants to merge 1 commit intonodejs:mainfrom
ljharb:fix-ffi-builtin-modules

Conversation

@ljharb
Copy link
Copy Markdown
Member

@ljharb ljharb commented May 6, 2026

Module.builtinModules is supposed to only list modules that are accessible to user code. node:ffi requires --experimental-ffi to be required, so filter it out when the flag is not set, mirroring the existing handling for --experimental-quic.

Refs: #63137 (comment), #62072

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/loaders

@nodejs-github-bot nodejs-github-bot added module Issues and PRs related to the module subsystem. needs-ci PRs that need a full CI run. labels May 6, 2026
@ljharb ljharb added the ffi Issues and PRs related to experimental Foreign Function Interface support. label May 6, 2026
@ljharb ljharb force-pushed the fix-ffi-builtin-modules branch from 798219d to 999efeb Compare May 6, 2026 18:56
@aduh95 aduh95 added fast-track PRs that do not need to wait for 72 hours to land. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Fast-track has been requested by @aduh95. Please 👍 to approve.

@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 6, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@aduh95
Copy link
Copy Markdown
Contributor

aduh95 commented May 6, 2026

Related failure to address:

=== release test-ffi-module ===
Path: ffi/test-ffi-module
Error: --- stderr ---
(node:87480) ExperimentalWarning: FFI is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
--- stdout ---
Test failure: 'ffi builtin is listed'
Location: test/ffi/test-ffi-module.js:34:1
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

'false' !== 'true'

    at TestContext.<anonymous> (/home/runner/work/_temp/node-v27.0.0-nightly2026-05-069c7b977313-slim/test/ffi/test-ffi-module.js:42:10)
    at Test.runInAsyncScope (node:async_hooks:226:14)
    at Test.run (node:internal/test_runner/test:1306:25)
    at Test.processPendingSubtests (node:internal/test_runner/test:897:18)
    at Test.postRun (node:internal/test_runner/test:1447:19)
    at Test.run (node:internal/test_runner/test:1372:12)
    at async Test.processPendingSubtests (node:internal/test_runner/test:897:7) {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: 'false',
  expected: 'true',
  operator: 'strictEqual',
  diff: 'simple'
}
Command: out/Release/node --experimental-ffi --test-reporter=./test/common/test-error-reporter.js --test-reporter-destination=stdout /home/runner/work/_temp/node-v27.0.0-nightly2026-05-069c7b977313-slim/test/ffi/test-ffi-module.js

===
=== 1 tests failed
===

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Module.builtinModules is supposed to only list modules
that are accessible to user code.
node:ffi requires --experimental-ffi to be required,
so filter it out when the flag is not set,
mirroring the existing handling for --experimental-quic.

Refs: nodejs#63137 (comment)

Signed-off-by: Jordan Harband <ljharb@gmail.com>
@ljharb
Copy link
Copy Markdown
Member Author

ljharb commented May 6, 2026

@aduh95 thanks, fixed!

@ljharb ljharb force-pushed the fix-ffi-builtin-modules branch from cc2a346 to 29fb725 Compare May 6, 2026 20:51
Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label May 6, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 6, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@ljharb
Copy link
Copy Markdown
Member Author

ljharb commented May 6, 2026

the CI failure looks spurious?

@aduh95
Copy link
Copy Markdown
Contributor

aduh95 commented May 6, 2026

It's a bit annoying that you force-pushed my commit out, it seems unlikely there will be time to include this PR in 26.1.0 now

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

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. fast-track PRs that do not need to wait for 72 hours to land. ffi Issues and PRs related to experimental Foreign Function Interface support. module Issues and PRs related to the module subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants