Allow the Rust SDK to bundle the native runtime without the Node CLI - #2801
Closed
dmytrostruk wants to merge 2 commits into
Closed
dmytrostruk wants to merge 2 commits into
dmytrostruk wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
CI does not exercise the new bundled-runtime configurations, and the resolution error guidance remains misleading.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Adds opt-in Rust native-runtime bundling without embedding the full Node CLI.
Changes:
- Introduces the additive
bundled-runtimefeature. - Separates runtime and CLI build artifacts and resolution.
- Adds documentation and runtime-only tests.
| File | Description |
|---|---|
rust/Cargo.toml |
Defines the new feature hierarchy. |
rust/build/in_process.rs |
Separates runtime and CLI embedding. |
rust/src/embeddedcli.rs |
Supports independent runtime extraction. |
rust/src/lib.rs |
Exposes runtime availability and installation. |
rust/src/resolve.rs |
Resolves bundled runtime independently. |
rust/tests/cli_resolution_test.rs |
Tests runtime-only bundling and startup. |
rust/README.md |
Documents feature configurations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Consumers that provide their own Node CLI currently have to embed a second copy to retain the Rust SDK's bundled native runtime. Add an opt-in
bundled-runtimefeature that downloads and embeds the native wrapper and required assets without downloading or embedding the full Node CLI archive:install_bundled_runtime()and managed native startup retain their existing behavior.HAS_BUNDLED_RUNTIMEreports whether native assets are embedded;HAS_BUNDLED_CLIis false andinstall_bundled_cli()returnsNonein the new mode. Addin-processto include the native runtime library.The default remains
bundled-cli, which still embeds both artifacts. Cargo features remain additive, so enablingbundled-clianywhere restores the full bundle. Existing local-runtime and download opt-outs are preserved. No dependency pins, other language SDKs, or release workflows change.Standalone SDK CI now runs the native-only resolution suite on Windows, macOS, Linux and Alpine, with additional in-process coverage on macOS, Linux and Alpine. The test helper clears prepared-runtime overrides so it exercises actual bundling. Nested development checkouts retain their existing artifact-based tests. Startup error guidance also includes the native-only feature and extraction failures.
Release coordination
As described in the contributor guide, this change must also be reconciled into the canonical SDK source before release so subsequent SDK snapshots preserve it.
Validation
Validated on macOS ARM64 with Rust 1.94.0 and runtime pin 1.0.90-6.
Latest review fixes: the exact CI helper passed 7 native-only and 8 native-only plus
in-processresolution tests with conflicting CI path/download/transport overrides deliberately set. Nightly formatting, workflow YAML parsing, shell syntax and whitespace checks passed.Validation of the initial implementation (before the workflow/error-guidance follow-up):
cli_resolution_test: 7 passed with native-only bundling, 7 with defaults, and 8 with native-only bundling plusin-process. Covers clean extraction, real runtime startup/ping/shutdown, full CLI version probing in default mode, and absence of the CLI payload in native-only mode.--all-features: 33 passed.--all-features, with warnings denied: passed.git diff --check: passed.Windows and Linux execution have not been validated locally.