Repository navigation
[SDK] Ship per-platform native binaries via optional-dependency packages (#512) - #567
Gudge (MGudgin) wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the @microsoft/mxc-sdk distribution model so the meta package ships no native executors, and instead pulls exactly one host-matching per-platform package (@microsoft/mxc-sdk-<os>-<arch>) via optionalDependencies. It also updates runtime binary resolution to be fail-closed in production installs and updates build/CI/release validation to ensure platform packages are correctly staged and published.
Changes:
- Split native payload into five per-platform npm packages and pin them as
optionalDependenciesfrom the meta SDK package. - Update SDK binary discovery (
platform.ts/helper.ts) to trust onlyMXC_BIN_DIRor an identity/version-validated platform package in production. - Update build scripts, CI pipelines, tests, and docs to stage/pack/verify per-platform artifacts (including release-completeness gates).
Show a summary per file
| File | Description |
|---|---|
| tests/playground/src/main/main.ts | Updates microvm binary search path to the new sdk/platform-packages/<tuple> layout. |
| sdk/tests/unit/sandbox.test.ts | Adds unit tests for missing-binary diagnostics and executablePath escape hatch behavior. |
| sdk/tests/unit/proxy-availability.test.ts | Adds unit coverage for proxy availability decision logic. |
| sdk/tests/unit/postinstall.test.ts | Adds unit coverage ensuring postinstall tuple set stays in sync and warnings behave as intended. |
| sdk/tests/unit/platform.test.ts | Adds extensive unit coverage for per-platform package resolution, dev-vs-prod behavior, and fail-closed guarantees. |
| sdk/tests/unit/packaging.test.ts | Adds packaging-matrix tests binding on-disk platform packages to SUPPORTED_TUPLES and validating meta/package manifests. |
| sdk/tests/integration/windows-process-container.test.ts | Skips proxy E2E tests when proxy binaries are not available post-split. |
| sdk/tests/integration/test-helpers.ts | Refactors integration test helpers to separate shipped executors from test-only proxy binaries. |
| sdk/tests/integration/proxy-availability.ts | Introduces pure proxy-availability evaluation used by integration tests (and unit-tested). |
| sdk/tests/integration/package.test.ts | Updates integration packaging assertions for per-platform packages and ensures meta has no bin/. |
| sdk/tests/integration/linux-bubblewrap.test.ts | Adds proxy availability gating for Bubblewrap proxy E2E tests. |
| sdk/src/platform.ts | Implements per-platform package resolution, tuple support gating, dev/prod modes, and platform-package identity/version validation. |
| sdk/src/helper.ts | Improves missing-binary errors, and adjusts platform gating to honor explicit executablePath earlier. |
| sdk/scripts/postinstall-check.cjs | Adds non-failing postinstall warning logic for missing/unsupported platform package scenarios. |
| sdk/README.md | Documents per-platform binary delivery model and resolver precedence (dev vs production). |
| sdk/platform-packages/win32-x64/README.md | Adds platform-package readme (win32-x64). |
| sdk/platform-packages/win32-x64/package.json | Adds platform-package manifest with explicit files allowlist and prepack guard (win32-x64). |
| sdk/platform-packages/win32-arm64/README.md | Adds platform-package readme (win32-arm64). |
| sdk/platform-packages/win32-arm64/package.json | Adds platform-package manifest with explicit files allowlist and prepack guard (win32-arm64). |
| sdk/platform-packages/linux-x64/README.md | Adds platform-package readme (linux-x64). |
| sdk/platform-packages/linux-x64/package.json | Adds platform-package manifest (linux-x64) including libc: glibc. |
| sdk/platform-packages/linux-arm64/README.md | Adds platform-package readme (linux-arm64). |
| sdk/platform-packages/linux-arm64/package.json | Adds platform-package manifest (linux-arm64) including libc: glibc. |
| sdk/platform-packages/darwin-arm64/README.md | Adds platform-package readme (darwin-arm64). |
| sdk/platform-packages/darwin-arm64/package.json | Adds platform-package manifest (darwin-arm64). |
| sdk/platform-packages/.gitignore | Ensures only manifests/READMEs are tracked and binaries remain uncommitted. |
| sdk/package.json | Removes bin/ from shipped files, adds postinstall check, and introduces platform-package optional deps. |
| sdk/package-lock.json | Records optional dependency stubs and marks the package as having an install script. |
| scripts/sync-platform-package-versions.test.js | Adds unit tests for platform-package version/pin syncing. |
| scripts/sync-platform-package-versions.js | Adds tooling to stamp/check platform package versions and meta optionalDependency pins. |
| scripts/platform-package-payload.test.js | Adds unit tests for deriving staged payload file lists from platform manifests. |
| scripts/platform-package-payload.js | Adds helper to derive payload files from a platform package’s files allowlist. |
| scripts/check-release-completeness.test.js | Adds unit tests for release completeness checks (pins, tarballs, malformed manifests, payload staging). |
| scripts/check-release-completeness.js | Adds a canonical release-completeness gate for platform packages and produced tarballs. |
| README.md | Updates build output description to reflect staging into sdk/platform-packages/<tuple>/. |
| docs/macos-support/seatbelt-backend.md | Updates macOS dev binary discovery docs to the new platform-packages layout. |
| build.sh | Stages Linux executors into sdk/platform-packages/linux-<arch> and adds version-sync check/stamp. |
| build.bat | Stages Windows executors into sdk/platform-packages/win32-<arch> and adds version-sync check/stamp. |
| build-mac.sh | Stages macOS executor into sdk/platform-packages/darwin-<arch> (when shipped) and adds version-sync check/stamp. |
| .github/workflows/Versioning.Checks.Job.yml | Adds CI validation/tests for version-sync and release-completeness logic. |
| .github/workflows/SDK.Integration.Test.Job.yml | Updates CI to install meta + host platform tarballs explicitly and wires proxy artifacts for Linux. |
| .github/workflows/Package.NpmSdk.Job.yml | Packs meta and platform packages separately and adds a release-completeness verification step. |
| .github/workflows/Build.Windows.Job.yml | Stages shipped payload from platform manifest allowlist and uploads manifest-driven artifacts. |
| .github/copilot-instructions.md | Documents the new SDK packaging model, resolver behavior, and version-sync tooling. |
| .azure-pipelines/templates/SDK.Integration.Test.Job.yml | Updates ADO integration tests to install meta + platform tarballs and provide proxy artifacts on Linux. |
| .azure-pipelines/templates/Rust.Build.Job.yml | Adds manifest-driven staging for Windows payload to avoid silent omissions. |
| .azure-pipelines/templates/Package.NpmSdk.Job.yml | Updates ADO packaging to stage/pack per-platform packages and run release completeness gate. |
| .azure-pipelines/templates/1ES.Build.Stages.yml | Wires per-platform packaging parameters through the 1ES stage template. |
| .azure-pipelines/README.md | Documents the new platform-first/meta-last publishing flow and operational constraints. |
| .azure-pipelines/1ES.Release.yml | Publishes platform packages before the meta package in ESRP. |
Copilot's findings
Files not reviewed (1)
- sdk/package-lock.json: Generated file
- Files reviewed: 49/50 changed files
- Comments generated: 3
3af1957 to
2638e49
Compare
Darren Hoehna (dhoehna)
left a comment
There was a problem hiding this comment.
Looking through this PR I feel that some of the code can be de-duplicated. However, I don't know enough of the build system to understand where or how to make that happen.
Otherwise the code looks sound to me. Just a few comments.
|
Gudge (@MGudgin) I'm thinking we should split this up a bit. Perhaps it would be good for us to have a design of how we want this to look like first. When I initially thought about the optional-dependency packages, my thought was that we wouldn't need this much change. That said we currently use ESRP release publishing to publish a single npm package. I'd have to check if we can publish multiple packages through that service or if there is anything extra they need to configure for us on the backend to do that. |
2638e49 to
0ddf92c
Compare
|
Thank you for addressing all my comments. I am concerned with the empty catch. We can discuss options around it. |
0ddf92c to
7cb3760
Compare
7cb3760 to
a317cc0
Compare
There was a problem hiding this comment.
Review details
Files not reviewed (1)
- sdk/node/package-lock.json: Generated file
Suppressed comments (6)
.azure-pipelines/README.md:74
- Both lockfile paths are missing the
node/component. The changed package and lockfile live insdk/node, so the documented bootstrap command fromsdk/targets the wrong directory.
packages exist on the registry, `sdk/package-lock.json` records them as stubs
with no `resolved`/`integrity` (you cannot hash an unpublished tarball). After
the **first** successful publish, run `npm install --package-lock-only` in
`sdk/` and commit the lockfile so the optional-dep entries gain
sdk/node/tests/integration/test-helpers.ts:156
- When the helper discovers a local proxy under
src/target, it reports the proxy as available but never exposes that directory to the executor. Because the dev resolver now prefers the staged platform-package executor,unix-test-proxyis no longer its sibling; builtin proxy tests therefore start and then fail unless the user manually setMXC_TEST_PROXY_DIR. Propagate the discovered directory before spawning so a normal local build remains sufficient.
sdk/node/tests/integration/windows-process-container.test.ts:132 - This availability gate now lets the suite run with
wxc-test-proxy.exesupplied out of band, but the builtin test below still launches it throughprocess_util::resolve_sibling_binary, which only searches besidewxc-exec.exe. Since this PR moves the executor into the platform package and intentionally excludes the proxy, the builtin test fails even whenMXC_TEST_PROXY_DIRis set. Extend the Windows/AppContainer proxy resolver to honor that variable as the Unix resolver now does.
.github/workflows/Versioning.Checks.Job.yml:27 - The new
platform-package-payload.test.jssuite is not invoked by this workflow (or any other test command), so its manifest-validation tests never run in CI. Add it alongside the other new script suites.
- name: Test release-completeness logic
run: node --test scripts/check-release-completeness.test.js
.azure-pipelines/README.md:51
- The pipeline actually stages packages under
sdk/node/platform-packages; this path omitsnode/and contradicts the updated build scripts.
This issue also appears on line 71 of the same file.
- **Package** (`Package.NpmSdk.Job.yml`) stages each artifact into
`sdk/platform-packages/<os>-<arch>/`, verifies versions/pins are in sync
(`scripts/sync-platform-package-versions.js --check`), packs the meta package
sdk/node/README.md:22
- This dev-layout path omits the
node/directory; the packages are staged undersdk/node/platform-packages, so following this documented resolver order points developers at a nonexistent location.
> `MXC_BIN_DIR` → `sdk/platform-packages/<os>-<arch>` →
> `src/target/<triple>/{release,debug}` → the installed package, so a fresh
- Files reviewed: 51/52 changed files
- Comments generated: 0 new
- Review effort level: Balanced
e0055c2 to
fff31c8
Compare
fff31c8 to
eae492f
Compare
There was a problem hiding this comment.
Review details
Files not reviewed (1)
- sdk/node/package-lock.json: Generated file
Suppressed comments (5)
.azure-pipelines/README.md:75
- Both the lockfile path and the directory for the refresh command are missing
node/. The changed files aresdk/node/package-lock.jsonandsdk/node/, so this recovery procedure currently directs release operators to the wrong location.
- **Lockfile integrity is bootstrapped at first publish.** Until the platform
packages exist on the registry, `sdk/package-lock.json` records them as stubs
with no `resolved`/`integrity` (you cannot hash an unpublished tarball). After
the **first** successful publish, run `npm install --package-lock-only` in
`sdk/` and commit the lockfile so the optional-dep entries gain
`resolved`/`integrity`; subsequent `npm ci` then verifies the native-binary
sdk/node/tests/integration/windows-process-container.test.ts:133
- This single gate treats a proxy found via
MXC_TEST_PROXY_DIRas sufficient for both tests, but only the external-proxy test launches that path directly. The built-in test askswxc-execto launchwxc-test-proxy.exe, andsrc/backends/appcontainer/common/src/proxy_coordinator.rs:354still usesprocess_util::resolve_sibling_binary, which searches only beside the executor. With the proxy intentionally absent from the installed platform package,builtinTestServertherefore fails even though this gate enabled the suite. Teach the Windows built-in resolver to honor the test-proxy directory, or gate that test separately.
.github/workflows/Versioning.Checks.Job.yml:27 - The new
platform-package-payload.test.jssuite is not invoked by this workflow (and no other CI reference exists), so its manifest-validation tests never run. Add it alongside the other script test suites.
- name: Test release-completeness logic
run: node --test scripts/check-release-completeness.test.js
sdk/node/README.md:21
- This documented dev path omits the
node/component. The resolver and build scripts usesdk/node/platform-packages/<os>-<arch>, so following this path points users to a directory that does not exist.
> `MXC_BIN_DIR` → `sdk/platform-packages/<os>-<arch>` →
.azure-pipelines/README.md:50
- The pipeline stages packages under
sdk/node/platform-packages, notsdk/platform-packages; this path conflicts with the implementation and the root README.
This issue also appears on line 70 of the same file.
- **Package** (`Package.NpmSdk.Job.yml`) stages each artifact into
`sdk/platform-packages/<os>-<arch>/`, verifies versions/pins are in sync
- Files reviewed: 51/52 changed files
- Comments generated: 0 new
- Review effort level: Balanced
eae492f to
d6779e2
Compare
There was a problem hiding this comment.
Review details
Files not reviewed (1)
- sdk/node/package-lock.json: Generated file
Suppressed comments (5)
.azure-pipelines/README.md:80
- These first-publish and recovery instructions point to
sdk/package-lock.json/sdk/package.jsonand tell users to run npm insdk/, but the npm package is rooted atsdk/node. Following this runbook will not update the actual SDK lockfile or manifest.
- **Lockfile integrity is bootstrapped at first publish.** Until the platform
packages exist on the registry, `sdk/package-lock.json` records them as stubs
with no `resolved`/`integrity` (you cannot hash an unpublished tarball). After
the **first** successful publish, run `npm install --package-lock-only` in
`sdk/` and commit the lockfile so the optional-dep entries gain
sdk/node/src/helper.ts:374
- MicroVM is now shipped only for Windows x64, but this path still accepts native Windows ARM64 and tries to resolve the x64-only companion package. That package cannot install on
win32-arm64, andnanvixd.execannot run there, so fail at the SDK boundary with an accurate platform error instead of the misleading “install ...-win32-x64” diagnostic.
sdk/node/README.md:21 - The staged development packages live under
sdk/node/platform-packages, notsdk/platform-packages. This public resolver-order documentation currently sends developers to a nonexistent path.
> `MXC_BIN_DIR` → `sdk/platform-packages/<os>-<arch>` →
.azure-pipelines/README.md:55
- The pipeline stages into
sdk/node/platform-packages(Package.NpmSdk.Job.yml), so this runbook path is missing thenodecomponent.
This issue also appears on line 76 of the same file.
- **Package** (`Package.NpmSdk.Job.yml`) stages each artifact into
`sdk/platform-packages/<os>-<arch>/`, verifies versions/pins are in sync
sdk/node/scripts/postinstall-check.cjs:66
- On an unsupported host, setting
MXC_BIN_DIRalone does not avoid the platform gate inresolveExecutableAndArgs; callers must also setskipPlatformCheck(or provideoptions.executablePath). As written, this install-time recovery instruction still leads to the same exception.
- Files reviewed: 55/56 changed files
- Comments generated: 0 new
- Review effort level: Balanced
d6779e2 to
0833d4b
Compare
There was a problem hiding this comment.
Review details
Files not reviewed (1)
- sdk/node/package-lock.json: Generated file
Suppressed comments (7)
.azure-pipelines/README.md:80
- These lockfile instructions point to
sdk/package-lock.jsonandsdk/, but the npm project and lockfile are undersdk/node/. Following the current runbook executes in the wrong directory and cannot refresh the platform-package integrity entries.
- **Lockfile integrity is bootstrapped at first publish.** Until the platform
packages exist on the registry, `sdk/package-lock.json` records them as stubs
with no `resolved`/`integrity` (you cannot hash an unpublished tarball). After
the **first** successful publish, run `npm install --package-lock-only` in
`sdk/` and commit the lockfile so the optional-dep entries gain
.azure-pipelines/README.md:87
- The version-bump path is
sdk/node/package.json, notsdk/package.json. The current recovery command references a nonexistent manifest.
is not atomic: if it fails after publishing some platform packages, those
versions are immutable (re-publishing the same version returns `403`). Recover
by bumping the version (`src/Cargo.toml` + `sdk/package.json`, then
`node scripts/sync-platform-package-versions.js`) and re-running the release.
sdk/node/src/helper.ts:374
- On a Windows ARM64 host, the tuple is considered supported and the abstract
microvmintent bypasses the concrete-backend availability check, so this routes the request to the x64-only NanVix companion and ultimately tells the user to install a package npm cannot install on ARM64. Reject non-x64 MicroVM requests before selecting the NanVix runtime.
sdk/node/src/platform.ts:920 - This accepts any
wxc-exec.exefromMXC_BIN_DIRor the devsrc/targetcandidates without checking that the required NanVix payload is co-located. A normalbuild.batbuild has such an executor but is compiled withoutmicrovm, so a MicroVM request bypasses the intended “install the companion/build with --with-microvm” diagnostic and instead fails later as unsupported (or during native preflight). Only return candidates containing the required NanVix files/subdirectories.
.github/workflows/Versioning.Checks.Job.yml:34 - The new
scripts/platform-package-payload.test.jssuite is not invoked by any workflow; this job only runs the sync and release-completeness suites. As a result, regressions in the helper’s malformed-manifest validation can pass CI. Add the payload suite here.
- name: Test release-completeness logic
run: node --test scripts/check-release-completeness.test.js
sdk/node/README.md:21
- The documented dev path does not exist: the staged packages live under
sdk/node/platform-packages, as used by the build scripts and resolver. Correcting this avoids sending contributors to the wrong directory.
> `MXC_BIN_DIR` → `sdk/platform-packages/<os>-<arch>` →
.azure-pipelines/README.md:55
- The pipeline stages packages under
sdk/node/platform-packages, notsdk/platform-packages; this path should match the actual package job layout.
This issue also appears in the following locations of the same file:
- line 76
- line 84
- **Package** (`Package.NpmSdk.Job.yml`) stages each artifact into
`sdk/platform-packages/<os>-<arch>/`, verifies versions/pins are in sync
- Files reviewed: 55/56 changed files
- Comments generated: 0 new
- Review effort level: Balanced
This PR adds the npm package skeletons that separate core host executors from the opt-in NanVix MicroVM runtime without changing binary discovery yet. Details * Add five host platform packages for win32, Linux, and macOS with strict payload allowlists and prepack guards. * Add an explicit win32-x64 NanVix companion package containing a compatible executor and the MicroVM runtime payload. * Keep the large NanVix artifacts out of the automatically installed win32-x64 platform package. * Document package ownership and keep generated payloads out of source control. Tests * Validated all package manifests, payload allowlists, OS/CPU constraints, and repository paths. * Verified package tracking and ignore rules. Co-authored-by: Copilot <[email protected]> Copilot-Session: e3bdf4b4-a51f-4304-9c6a-fc7b7eb5937d
This PR changes SDK binary discovery to resolve core executors from host platform packages and MicroVM requests from the explicitly installed NanVix companion package. Details * Add fail-closed production resolution with package identity and exact SDK-version validation. * Select the NanVix package's co-located wxc-exec for microvm requests and provide an actionable installation error when it is absent. * Centralize supported platform tuples and executable naming, including explicit unsupported-host behavior. * Preserve development resolution through staged packages and Rust target outputs. * Stage the IsolationSession test executor in the current win32-x64 package layout. Tests * Exercised production and development discovery, environment overrides, package validation, unsupported tuples, and NanVix opt-in resolution in SDK unit tests. * Verified the IsolationSession bundle no longer references the retired SDK bin layout. Co-authored-by: Copilot <[email protected]> Copilot-Session: e3bdf4b4-a51f-4304-9c6a-fc7b7eb5937d
This PR updates build scripts to stage core executors into host platform packages and the opt-in MicroVM runtime into its NanVix companion package. Details * Clean package destinations before staging so stale optional payloads cannot leak into releases. * Stage a compatible wxc-exec and all required MicroVM files into nanvix-win32-x64 when --with-microvm is selected. * Fail when requested Windows MicroVM or WSLC payloads are missing and stage PLM beside the core Windows executor. * Keep test-only proxies outside publishable packages. * Version-lock both platform and companion packages to the SDK meta version. Tests * Passed package-version synchronization tests, including companion-package drift and stamping. * Validated shell and batch script syntax and staging paths. Co-authored-by: Copilot <[email protected]> Copilot-Session: e3bdf4b4-a51f-4304-9c6a-fc7b7eb5937d
This PR makes the meta SDK package binary-free, installs core native payloads through exact-pinned optional dependencies, and keeps explicit companion packages version-compatible. Details * Remove bundled native binaries from the meta package and pin all five host platform packages. * Keep the NanVix package opt-in rather than adding it as an automatic optional dependency. * Require the NanVix companion package to declare an exact peer dependency on the matching SDK version. * Add a non-failing postinstall diagnostic for missing or incomplete host platform packages. * Reconcile platform dependency pins and companion peer pins from the filesystem source of truth. * Regenerate the npm lockfile and wire consistency checks into CI. Tests * Passed the Node SDK build and unit suite, including postinstall and package-version coverage. * Verified a dry-run meta package contains no native binaries and does not install NanVix automatically. Co-authored-by: Copilot <[email protected]> Copilot-Session: e3bdf4b4-a51f-4304-9c6a-fc7b7eb5937d
This PR updates GitHub Actions and Azure Pipelines to build, validate, package, test, and publish core platform packages plus explicit companion packages before the meta SDK package. Details * Stage the union of core and NanVix payload manifests from Windows x64 builds without adding NanVix files to the automatic host package. * Pack the opt-in NanVix companion alongside the five platform packages and publish all binary packages before the meta SDK. * Add fail-closed release completeness checks for platform optional-dependency pins, companion peer compatibility, payload presence, and stray tarballs. * Migrate SDK packaging and integration lanes to the platform-package install model. * Require proxy integration coverage where the sandbox is runnable while keeping test proxies out of production packages. Tests * Passed release-completeness, payload, version-sync, SDK build, and SDK integration tests. * Validated GitHub Actions and Azure Pipelines staging and package flows. Co-authored-by: Copilot <[email protected]> Copilot-Session: e3bdf4b4-a51f-4304-9c6a-fc7b7eb5937d
This PR completes the binary-package delivery model with package invariants, resolver coverage, NanVix opt-in tests, and updated user and developer documentation. Details * Validate every platform package against the runtime support matrix and verify NanVix is excluded from automatic host packages. * Validate the NanVix companion identity, exact SDK peer, complete payload, prepack guard, and explicit-install behavior. * Add resolver diagnostics for missing NanVix installations and retain package source-hygiene checks. * Update SDK, repository, NanVix, pipeline, and contributor documentation for explicit MicroVM installation. * Update the playground to select the companion package's co-located executor for MicroVM runs. Tests * Passed the Node SDK build and unit suite, including package, resolver, and NanVix diagnostics coverage. * Passed binary-package script tests and the playground main-process TypeScript build. Co-authored-by: Copilot <[email protected]> Copilot-Session: e3bdf4b4-a51f-4304-9c6a-fc7b7eb5937d
0833d4b to
09b43a3
Compare
There was a problem hiding this comment.
Review details
Files not reviewed (1)
- sdk/node/package-lock.json: Generated file
Suppressed comments (5)
sdk/node/src/helper.ts:373
microvmis now backed only by thewin32-x64companion, but this routes Windows ARM64 requests to it after the existing guard checks only the OS. Sincewin32-arm64is otherwise a supported tuple, ARM64 callers reachfindNanvixExecutable()and are told to install a package that npm rejects via itscpu: ["x64"]filter (or may pick a staged x64 payload in dev). Reject non-x64 process architectures before selecting this runtime.
sdk/node/src/platform.ts:943- The dev fallback accepts any
wxc-exec.exe, including one from an ordinary build without themicrovmfeature or NanVix payload. In a normal checkout that binary commonly exists, so an absent companion is treated as resolved and the request later fails with a native “not compiled in”/missing-payload error instead of the actionable companion-package diagnostic. Require at least the co-locatednanvixd.exewhen selecting these candidates.
sdk/node/scripts/postinstall-check.cjs:66 - This unsupported-host warning suggests that setting
MXC_BIN_DIRalone avoids the spawn failure, but both public resolver gates still requireskipPlatformCheckwhen no explicitexecutablePathis supplied. Update the recovery text to mention that required option (or recommendexecutablePath), otherwise users following the warning still receiveMXC is not supported on this platform.
sdk/node/README.md:21 - The documented dev path omits the
nodedirectory. The resolver actually checkssdk/node/platform-packages/<os>-<arch>(src/platform.ts:888), so this command/path guidance sends contributors to a nonexistent location.
> `MXC_BIN_DIR` → `sdk/platform-packages/<os>-<arch>` →
.azure-pipelines/README.md:56
- This pipeline path is missing the
nodecomponent. The package job stages undersdk/node/platform-packages/<os>-<arch>(Package.NpmSdk.Job.yml:34,67), so the documented source-of-truth location is incorrect.
- **Package** (`Package.NpmSdk.Job.yml`) stages each artifact into
`sdk/platform-packages/<os>-<arch>/`, verifies versions/pins are in sync
(`scripts/sync-platform-package-versions.js --check`), packs the meta package
- Files reviewed: 55/56 changed files
- Comments generated: 0 new
- Review effort level: Balanced
|
Thinking about this some more I think it would be best if we came up with a design to move the npm SDK to an in proc one rather than using the executables. Likely would be to use the mxc_ffi native library. We cal probably also do something using https://napi.rs/ as a small wrapper |
Summary
Makes
@microsoft/mxc-sdkinstall only the host platform's native binaries bysplitting the executor payload into five per-platform packages
(
@microsoft/mxc-sdk-<os>-<arch>) referenced as exact-pinned, os/cpu-filteredoptionalDependenciesof a binary-free meta package. An install pulls just thematching host's payload instead of every platform's binaries.
Presented as six reviewable commits (scaffold → discovery → build scripts →
meta/manifest → pipeline → tests/docs), intended to land as a single
squash-merge: the phases are a review-time decomposition, not independently
shippable units — dropping the bundled
bin/foroptionalDependenciesis onlysafe alongside the publishing pipeline, so the series must merge atomically to
avoid a binary-less
main.Closes #512
Details
win32-x64,win32-arm64,linux-x64,linux-arm64,darwin-arm64. Intel macOS (darwin-x64) is intentionally notshipped. The
win32-arm64manifest ships only the arch-independent payload —the micro-VM payload (
nanvixd+ kernel assets) is x64-only becausenanvixdis an x64 binary.
wslc_common/build.rspath bug (the committed WSLC SDKnupkg at repo-root
external/wslc-sdkwas resolved two levels too shallowafter the crate moved under
src/backends/wslc/common, sowslcsdk.dllwassilently never built). With the path corrected the
wslcfeature build nowstages
wslcsdk.dllinto the release dir so it ships in the win32 packages.platform.ts): in an installed tree (root undernode_modules, case-insensitive) the executor is sourced ONLY fromMXC_BIN_DIRor the identity/version-validated installed platform package —planted binaries in legacy
bin/<arch>orsrc/targetpaths are neverexecuted, and a planted
../src/Cargo.tomlcannot re-enable dev mode. Thebundler/CJS sibling fallback fails closed when the meta version is unreadable
(a name-only match is not trusted).
SUPPORTED_TUPLESis the single source oftruth. An explicit
executablePathis honored before the unsupported-platformgate (both the low-level resolver and the public
resolveExecutableAndArgs).fail-fast on a missing mandatory component. The Windows CI build derives the
shipped payload from the manifest
filesallowlist(
scripts/platform-package-payload.js), stages it preserving thebin/+snapshots/substructure from an absolute workspace-rooted target path,and hard-fails on a missing artifact. The official ADO Windows build stages the
same manifest payload (manifest-driven, node-free), closing the gap where it
previously copied only
signPattern+wslcsdk.dll. Dev/test-only helpers(proxies, diagnostic console) are excluded from packages.
bin/, gains the fiveoptionalDependencies,and ships a non-failing
postinstallthat warns when the host's platformpackage is absent OR installed without its native binary.
sync-platform-package-versions.jskeeps manifests + pins in lockstep(CI
--check).the meta package. The filesystem-canonical release-completeness gate treats
sdk/platform-packagesas the source of truth: rejects an empty set, requiresthe meta to pin exactly those packages at their versions, requires every
expected tarball, verifies every manifest
filespayload entry is actuallystaged on disk (so
npm packcannot silently omit a binary), hard-fails ona malformed platform manifest, and rejects ANY stray
.tgz(recursive scan).(
linux_proxy_coordinator::resolve_sibling_binary) now honorsMXC_TEST_PROXY_DIRbefore falling back to a sibling of the executor, so thebuiltinTestServerE2E proxy can be sourced out-of-band on Linux — thedev/test-only
linux-test-proxyis intentionally NOT shipped in theper-platform package, and co-locating it would trip the package-hygiene tests.
sdk/README.md,copilot-instructions.md, playground) describe theper-platform delivery model, cross-arch install via npm
--os/--cpu, and theproduction-vs-dev resolver order.
Tests
fail-closed paths (planted-competing-binary, unreadable-version, dev preference
order, identity/version validation, sibling fallback), packaging matrix bound
bidirectionally to
SUPPORTED_TUPLES, micro-VM x64-only payload assertions,postinstall warn/skip/unsupported + installed-but-binary-less warning +
runPostinstallCLI seam, explicit-executablePathescape hatch on anunsupported host (both resolver entry points), proxy-availability fail-closed.
.tgz, on-disk payloadverification, malformed-manifest hard-fail, payload helper, version-sync.
sync --checkOK.tsc --noEmitclean.Rust.Build.Job.ymlmanifest-driven payload-staging step (ESRP/agent environment is pipeline-only).
The on-disk release-completeness gate is the safety net — a deficient package
fails the release loudly rather than publishing silently.