reqlanOverviewIdeasFilesCode filesClustersAttributesGraphPrint

Printable idea sheet

native_host_binary_distributed

reqlan rq/distribution/native_host_binary.rq:59

Katz 0.129

Use this procedure for a published VSIX and for published npm packages.
VS Code extension:
The registry installs the VSIX that has `targetPlatform` equal to the extension host.
Each VSIX contains one `.node` file for one native_targets tuple.
The file name is `native/reqlan_napi.node`.
The VSIX also contains `native/target.json`.
At run time, read `process.platform` and `process.arch` on the extension host.
If `target.json` records a different tuple, do not load `native/reqlan_napi.node`.
Do not put binaries for other platforms in that VSIX.
The Azure pipeline compiles each platform binary from this git commit ( `build_native` + `collect-napi-binary.mjs` + `prepare-native-packages.mjs --binary-dir` ). Package versions in git are canonical. The pipeline does not wait for npm.
Related: vsix_export, extension_distribution, vsix_native_not_from_npm.
CLI and MCP:
npm installs the host package from `optionalDependencies` on the published `@reqlan/analytical` tarball.
Git does not list those entries. prepare-native-packages.mjs `--publish-versions` writes them at npm publish.
The loader resolves that package from `@reqlan/analytical/package.json` ( `createRequire` ), which is where the optional dependency is attached after `npm install`.
Published installs also run published_host_native_install.
Related: rust_binary_distribution, native_bridge.
Implementation: package-extension-targets.mjs, prepare-native-packages.mjs, load-native.ts, check-host-native.mjs, azure-pipelines.yml.

status
in-progress
tests
load-native.test.ts, native-packaging.test.ts
todo
first multi-target VSIX and platform packages not yet published

Interactive page: native_host_binary_distributed