Repository navigation
Conversation
On a V8 pointer-compression runtime, Harper refuses a native addon that links V8's C++ API unless it was built for pointer compression (HarperFast/harper#3140). Describe the three ways an addon loads, the IncompatibleNativeAddonError a refused one raises, and the JavaScript fallback of optional accelerators. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011m4iSgKNWY8toCDWmuoh9a Dispatch-Task: harper-pc-native-addon-guard
… 5.4 notes Name the NODE_OPTIONS preload exception, the strictly-newer config.gypi condition, the marker's whole-package scope and the refusal of an unreadable ELF symbol table, and list the change in the 5.4 release notes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011m4iSgKNWY8toCDWmuoh9a Dispatch-Task: harper-pc-native-addon-guard
…rules Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011m4iSgKNWY8toCDWmuoh9a Dispatch-Task: harper-pc-native-addon-guard
There was a problem hiding this comment.
Code Review
This pull request adds documentation and release notes for native addon compatibility checks on V8 pointer-compression runtimes in Harper v5.4.0. The new section explains how incompatible native addons are detected and refused with an IncompatibleNativeAddonError to prevent process crashes. The review feedback suggests improving readability by splitting sentences in the documentation so that critical warnings, bypass behaviors, and limitations (such as platform constraints and preloaded modules) are clearly highlighted in separate, distinct sentences.
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-725 This preview will update automatically when you push new commits. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011m4iSgKNWY8toCDWmuoh9a Dispatch-Task: harper-pc-native-addon-guard
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-725 This preview will update automatically when you push new commits. |
Co-Authored-By: OpenAI Codex <noreply@openai.com>
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-725 This preview will update automatically when you push new commits. |
⊙ Problem
HarperFast/harper#3140 (v5.4) makes Harper refuse native addons on V8 pointer-compression Node runtimes when they link V8's C++ API for the standard ABI. Such an addon would otherwise load and then crash the process on first use. A component author whose dependency is refused needs to know why, which addons are allowed, and how to fix it. Nothing in the docs covers pointer-compression runtimes today.
💡 Solution
A new "Native Addons on Pointer-Compression Runtimes" section in
reference/components/module-loading.md, marked v5.4.0, between "Allowed Built-in Modules" and "Choosing a Mode". It covers:threads.preload/threads.preloadRequiremodules, in every thread.build/directory, whereconfig.gypirecords the flag and is older than the binary;.pointer-compression-build. The marker admits every binary in the package, so the page says to add it only when all of them are pointer-compression builds.IncompatibleNativeAddonErrorwithcode: 'ERR_DLOPEN_FAILED', and the JavaScript fallback of optional accelerators such ascbor-xandmsgpackr.NODE_OPTIONSpreloads run before Harper and are not checked; standard Node.js is unchanged.A "Native Addons" entry in
release-notes/v5-lincoln/5.4.mdsummarizes the change and links to the section. It also states the Free and Hobby tier default.Known gap, outside this diff: on harper-pro's clone-node boot path (
HDB_LEADER_URLset),bin/harper.jsloads Harper's logger (and through itsegfault-handler) andcbor-xbefore core installs the guard. Application addons still load after the guard. The fix is a one-line harper-pro change, recorded as a follow-up.✅ Verification
utility/nativeAddonAbi.ts,server/threads/nativeAddonGuard.ts) and that PR's end-to-end run on a pointer-compression Node 24.18. On that run, a component's standard-ABI V8 prebuild was refused with the documented error, while addons built by node-gyp under the pc Node and marked pc builds loaded.../configuration/options.md#threadsis thethreadssection, and the release note's/reference/v5/components/module-loading#native-addons-on-pointer-compression-runtimesmatches the new heading.npm run format:write,npm run format:check,npm run build,npm run typecheck, andnpm run test:workflowspassed. Both generated pages contain the Free and Hobby tier default.5c7fd4f62fa2with Claude, Gemini, and Cursor Composer. Domain adjudication timed out; author triage retained the documented preload and release-summary decisions and scoped Fabric tier-selection guidance to separate work. The marker, error code, and build-evidence rules were rechecked against harper#3140's current source.🤖 Generated by Claude Opus 5.5 (Claude Code) and OpenAI Codex; posted via @kriszyp.
https://claude.ai/code/session_011m4iSgKNWY8toCDWmuoh9a
Depends-on: HarperFast/harper#3140
Related PRs: none found
Complexity: easy
Review-Coverage: authored=codex; ran=gemini,claude,cursor-composer; blocked=domain(timeout); declined=cursor-grok,cursor-kimi,cursor-muse; rounds=5; full=1 @ 5c7fd4f
Review-Attention: skim ~2m (raised: degraded review) @ 5c7fd4f