ReviewOS

home-lang/home

Port N-API value FFI import-attribute compatibility

#200
Closed chris opened this 10 days ago ·
10 days ago

Tracks the next Bun corpus frontier after the Workerd and N-API finalizer tranches.

Exact failing file: packages/runtime/test/bun-corpus/napi/napi-value-ffi.test.ts

Current boundary:

  • napi/napi-finalizer-delete-ref.test.ts passes after ba9a7ed47
  • the next file is rejected during corpus preparation as unsupported module syntax
  • its key syntax is import source from "./napi-app/ffi_addon_1.c" with { type: "file" }

Required parity:

  • prepare static with { type: "file" } imports for C sources without rejecting the module
  • preserve file-loader path semantics
  • cover bun:ffi dlopen and cc() isolated napi_env behavior
  • retain the upstream todo/skip matrix without delegating to bun test

Parent tracking: #66

10 days ago

Completed in fa10aa8c3 (feat(runtime): support napi ffi value isolation).

Implemented:

  • static with { type: "file" } preparation for the N-API C source fixture
  • bun:ffi cc/dlopen and full harness import rewrites
  • per-library/per-compilation N-API instance-data contexts
  • disk-free native-addon install simulation
  • a focused copied-corpus regression preserving the exact 2-pass/2-todo upstream matrix

Verification on the fresh linked Home binary passes with zero failures/unsupported entries and leaves no workspace artifacts. Parent: #66.

10 days ago

Closing as completed by fa10aa8c3; napi/napi-value-ffi.test.ts is now green in Home.

Sign in to comment on this issue.