Referenced by4
Labels2

Referencing ideas

IdeaStatusTagsSummaryKatz
extension_host_native_stagedoneLocal F5 and `pnpm run build` / `build:ext` stage the host-matching core engine `.node` into `packages/extension/native/` so activation loads the same layout as a per-target VSIX ( [distribution.vsix_export], ["../distribution/native_host_binary.rq".native_host_binary_development] ). The same build copies the `.node` into `packages/analytical-native/<napiSuffix>/` so the workspace optionalDependency matches a production npm install ( [distribution.rust_binary_distribution] ). The orchestrator builds `cargo build -p reqlan-napi -p reqlan-lsp --release` when needed, then copies `reqlan_napi.node` beside the extension. It is not a separate manual install. That command writes `reqlan-lsp` into `crates/target` ( ["../extension/language/support/language-server-rust.rq".language_server_rust] ). Azure compiles the [distribution.native_targets] matrix, then stages those binaries with `prepare-native-packages.mjs --binary-dir` before tests and VSIX packaging. Versions come from git at the `ext/v*` tag. Do not fetch platform packages from npm on Azure ( [distribution.extension_distribution] ). Implementation: ["../../scripts/stage-host-native.mjs"], ["../../scripts/ensure-host-native.mjs"], ["../../packages/extension/scripts/build.mjs"], ["../../azure-pipelines.yml"].0.140
scopeextension build steps for local development and CI0.040
native_host_binarydoneSelect the native core-engine binary from the extension host. The host is the Node process that runs the extension. Read `process.platform` and `process.arch` from that process. Do not use the platform of the VS Code UI client. Examples: - UI on Windows and host on Linux SSH: use a linux tuple. - UI on Windows and host on WSL: use a linux tuple. - UI and host on macOS: use a darwin tuple. Map the platform and the arch to one tuple in ["./distribution.rq".native_targets]. Load only the binary that matches that tuple. Do not load a binary for a different tuple. If the platform and the arch are not in ["./distribution.rq".native_targets], fail. If the binary is missing, fail. Do not use sql. js. Keep the loader map the same as ["../../scripts/native-targets.mjs"]. Local development: [native_host_binary_development]. Production distribution: [native_host_binary_distributed]. Implementation: ["../../packages/analytical/src/native/load-native.ts"].0.144
native_host_binary_developmentdoneUse this procedure on a developer machine ( F5 and `pnpm run build` ). Identify the host from `process.platform` and `process.arch` of the build process. The build process and the extension host must be the same machine. Copy the matching `.node` file to `packages/extension/native/reqlan_napi.node`. Write `packages/extension/native/target.json` with the host tuple. If the binary is not present, build it with `cargo build -p reqlan-napi -p reqlan-lsp --release`. At run time, search in this order: 1. The `native/` folder of the extension, if `target.json` records the host tuple. 2. The resolved `main` of the host npm package ( `createRequire` from `@reqlan/analytical/package.json` ). 3. The host file in `packages/analytical-native/<napiSuffix>/` ( workspace package directory, same layout as a published package ). 4. The host npm package name. 5. `crates/target/<rustTarget>/release` and `crates/target/release`. 6. The debug folders with the same names. Do not search packages for other platforms. If `target.json` records a different tuple, do not load `native/reqlan_napi.node`. Windows cargo emits `reqlan_napi.dll`; the loader uses `process.dlopen` for `.dll` and `.node` ( Node `require` only loads `.node` ). Windows UI with a WSL extension host uses the linux tuple ( [native_host_binary] ). Windows UI with a Windows extension host cannot load a `.node` staged from WSL; restage on Windows or open the folder in a WSL remote window. Before tests, the workspace host package must contain the `.node` so loaders behave like production ( [native_host_binary_distributed] ). `scripts/ensure-host-native.mjs` uses an existing matrix binary, or cargo locally. Azure compiles the ["./distribution.rq".native_targets] matrix from git and stages those artifacts; it does not fetch binaries from npm. Detail: [development_build.extension_host_native_stage]. Implementation: ["../../scripts/stage-host-native.mjs"], ["../../scripts/ensure-host-native.mjs"], ["../../packages/extension/src/analytical_submodule/index.ts"].0.078

Reference labels

"../../scripts/ensure-host-native.mjs", ../../scripts/ensure-host-native.mjs