Skip to content

runtime: createRequire allowlist missing v8 (and audit the whole allowlist-vs-getBuiltinModule family) — pi wall #5 #6651

Description

@proggeramlug

Wall #5 of the pi coding-agent bring-up (tracker #6564; prior: #6593, #6604, #6644, #6649 all fixed). With the four fixes applied, pi-native --help/--version die with:

Error: Perry createRequire() currently supports built-in modules only; package/file require('node:v8') is not supported under perry compile

Sites: __require("node:v8") at pi-bundle.mjs lines 179836 and 209270 (+ a require("v8") CJS shim at 182772). Node prints full usage / 0.0.0, rc=0.

This is the same gap family as #6644: v8 is missing from supported_require_builtin in crates/perry-runtime/src/module_require.rs, even though perry ships a real node_v8.rs module and process.rs getBuiltinModule already lists "v8".

Beyond adding v8: audit the whole family once — diff the createRequire allowlist against the getBuiltinModule list (and against the static-import module tables). Every builtin resolvable one way but not the others is a future wall of exactly this shape for some bundle; ESM bundles of CJS deps (the esbuild createRequire-banner pattern) funnel ALL builtin requires through createRequire, so its allowlist needs to be the superset. Walls #3 and #5 were both this bug with different module names.

Repro: HOME=$(mktemp -d) /Users/amlug/projects/perry/secret-tests/pi-target/dist/pi-native --help (binary has #6603+#6633+#6647+#6650 fixes; pi-native.pre6649 reproduces wall #4 for contrast); or minimal: ESM createRequire + require('node:v8').serialize fixture.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed defect or regressionparityCompatibility gap with Node.js, ECMAScript, or the supported ecosystem

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions