Skip to content

Package mxc_ffi with Node artifacts - #1155

Closed
Branden Bonaby (bbonaby) wants to merge 3 commits into
mainfrom
user/bbonaby/node-mxc-ffi-artifact
Closed

Branden Bonaby (bbonaby) wants to merge 3 commits into
mainfrom
user/bbonaby/node-mxc-ffi-artifact

Conversation

@bbonaby

@bbonaby Branden Bonaby (bbonaby) commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

📖 Description

Builds and stages the mxc_ffi shared library with the Node SDK's platform artifacts. Local build scripts, GitHub Actions, and Azure Pipelines now package the native library beside the existing executor binaries.

🔗 References

🔍 Validation

  • cargo test -p mxc_ffi
  • Platform CI artifact uploads fail when a required native library is missing.

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task
Microsoft Reviewers: Open in CodeFlow

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: bbe1ffbf-7cf8-48a0-8e3b-956f1d634e6c
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: bbe1ffbf-7cf8-48a0-8e3b-956f1d634e6c
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: bbe1ffbf-7cf8-48a0-8e3b-956f1d634e6c
Copilot AI balanced review requested due to automatic review settings September 14, 2026 19:59
@bbonaby
Branden Bonaby (bbonaby) requested a review from a team as a code owner September 14, 2026 19:59
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Copilot-Instructions PR modifies Copilot instruction files (.github/copilot-instructions.md or .github/instructions/) label Sep 14, 2026
@bbonaby

Copy link
Copy Markdown
Collaborator Author

Closing at the author's request; the branch is being kept for review and no code was merged.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Several artifact workflows can succeed while silently omitting the required FFI library.

Get a fresh assessment by requesting another Copilot review.

Review tier: Balanced
Findings: 3 Medium severity · 2 Low severity

Open findings (5)
What changed in this PR

Packages mxc_ffi alongside Node SDK executor artifacts across supported platforms.

Changes:

  • Builds and stages platform-specific FFI libraries.
  • Adds libraries to GitHub Actions and Azure artifacts.
  • Updates repository build documentation.
File Description
build.sh Builds and stages Linux FFI library.
build.bat Stages Windows FFI library.
build-mac.sh Builds and stages macOS FFI library.
.github/​workflows/​Build.Windows.Job.yml Uploads Windows FFI artifact.
.github/​workflows/​Build.Linux.Job.yml Uploads Linux FFI artifact.
.github/​workflows/​Build.MacOS.Job.yml Builds, verifies, and uploads macOS FFI.
.azure-pipelines/​templates/​Rust.Build.Job.yml Packages Windows/Linux FFI artifacts.
.azure-pipelines/​templates/​Mac.Build.Job.yml Signs and packages macOS FFI.
.github/​copilot-instructions.md Documents FFI artifact staging.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

wxc-wslc-daemon.exe
wxc-test-proxy.exe
mxc-diagnostic-console.exe
mxc_ffi.dll
path: |
src/target/${{ matrix.target }}/release/lxc-exec
src/target/${{ matrix.target }}/release/unix-test-proxy
src/target/${{ matrix.target }}/release/libmxc_ffi.so
src/target/${{ matrix.target }}/release/wxc-wslc-daemon.exe
src/target/${{ matrix.target }}/release/wxc-test-proxy.exe
src/target/${{ matrix.target }}/release/mxc-diagnostic-console.exe
src/target/${{ matrix.target }}/release/mxc_ffi.dll
# ESRP's Mac signing requires a .zip (or .dmg) input — raw Mach-O
# binaries are rejected. We zip before signing and unzip afterward. Both
# the executor and the testing-only unix-test-proxy are signed together.
# All three native runtime files are signed together.
- **SDK** (`sdk/node/`, `@microsoft/mxc-sdk`) — the public API. The one-shot surface (`spawnSandbox` / `spawnSandboxFromConfig` / `spawnSandboxAsync`) builds a `ContainerConfig` from a `SandboxPolicy`, serialises to base64, and spawns the correct native binary (`wxc-exec.exe`, `lxc-exec`, or `mxc-exec-mac`) via `node-pty`. The state-aware surface (`provisionSandbox` / `startSandbox` / `execInSandbox` / `execInSandboxAsync` / `stopSandbox` / `deprovisionSandbox`, in `sdk/node/src/state-aware.ts`) drives a sandbox through a multi-call lifecycle against `StateAwareContainmentBackend` backends; per-(backend, phase) typed `*Config` interfaces and a branded `SandboxId<C>` live in `sdk/node/src/state-aware-types.ts`. Typed wire-format errors live in `sdk/node/src/errors.ts` (closed `ErrorCode` union plus a single `MxcError` class carrying `code: ErrorCode`, mirroring the Rust `MxcError` shape). Platform detection is in `platform.ts`.

The SDK auto-discovers native binaries by checking `sdk/node/bin/<target-triple>/` (npm-packaged) and `src/target/<target-triple>/{release,debug}/` (local dev). The `build.bat`/`build.sh`/`build-mac.sh` scripts copy binaries into the SDK bin directory.
The SDK auto-discovers native binaries by checking `sdk/node/bin/<target-triple>/` (npm-packaged) and `src/target/<target-triple>/{release,debug}/` (local dev). The `build.bat`/`build.sh`/`build-mac.sh` scripts copy the executor and `mxc_ffi` shared library into the SDK bin directory; the platform CI workflows publish both in their per-target artifacts.
@bbonaby
Branden Bonaby (bbonaby) deleted the user/bbonaby/node-mxc-ffi-artifact branch September 15, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Copilot-Instructions PR modifies Copilot instruction files (.github/copilot-instructions.md or .github/instructions/)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants