Repository navigation
Changes to allow different toolchains for host and guest - #1962
simongdavies wants to merge 5 commits into
Conversation
Host move to 1.99.1 Guest fixed at 1.94.1 until hyperlight target is upstreamed Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The guest debug-information regression remains unresolved, and cross-platform CI, Nix, and container changes need build validation.
1 open issue
What changed in this PR
Separates Hyperlight’s host and guest Rust toolchains without changing the minimum supported Rust version.
Changes:
- Pins host builds to Rust 1.99.1 and guest builds to 1.94.1.
- Updates CI, Nix, containers, and contributor documentation for separate toolchains.
- Resolves compiler and lint warnings.
| File | Description |
|---|---|
| src/tests/rust_guests/rust-toolchain.toml | Pins Rust guest toolchain. |
| src/hyperlight_testing/src/tracing_subscriber.rs | Removes redundant formatting borrows. |
| src/hyperlight_host/tests/sandbox_host_tests.rs | Removes obsolete import. |
| src/hyperlight_host/build.rs | Removes redundant formatting borrow. |
| src/hyperlight_guest_capi/rust-toolchain.toml | Pins C API guest toolchain. |
| src/hyperlight_component_util/src/util.rs | Removes redundant formatting borrow. |
| src/hyperlight_component_util/src/rtypes.rs | Iterates map keys directly. |
| src/hyperlight_component_util/src/emit.rs | Iterates map values directly. |
| rust-toolchain.toml | Pins host toolchain and components. |
| flake.nix | Supports separate toolchain selection. |
| CONTRIBUTING.md | Documents guest toolchain selection. |
| .github/workflows/ValidatePullRequest.yml | Installs both toolchains. |
| .github/workflows/RustNightly.yml | Updates setup and guest cache keys. |
| .github/workflows/RegenSnapshotGoldens.yml | Installs both toolchains. |
| .github/workflows/PrimeCaches.yml | Installs both toolchains. |
| .github/workflows/dep_update_guest_locks.yml | Installs both toolchains. |
| .github/workflows/dep_run_examples.yml | Installs both toolchains. |
| .github/workflows/dep_miri.yml | Uses file-based toolchain setup. |
| .github/workflows/dep_fuzzing.yml | Installs both toolchains. |
| .github/workflows/dep_code_checks.yml | Updates setup and guest cache keys. |
| .github/workflows/dep_build_test.yml | Installs both toolchains. |
| .github/workflows/dep_build_guests.yml | Supports guest pins and older commits. |
| .github/workflows/dep_benchmarks.yml | Installs both toolchains. |
| .github/workflows/CreateRelease.yml | Installs both toolchains. |
| .github/workflows/CreateDevcontainerImage.yml | Reads and passes both toolchain versions. |
| .github/workflows/Coverage.yml | Installs both toolchains. |
| .github/workflows/copilot-setup-steps.yml | Consolidates toolchain setup. |
| .github/workflows/CargoPublish.yml | Installs both toolchains. |
| .github/workflows/CargoAudit.yml | Uses file-based toolchain selection. |
| .devcontainer/Dockerfile | Installs separate host and guest toolchains. |
Review effort: Balanced
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
Benchmark ResultsMeasured commit: kvm / amd (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
kvm / intel (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
mshv3 / amd (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
mshv3 / intel (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
hyperv-ws2025 / amd (Windows) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
hyperv-ws2025 / intel (Windows) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
Reported by |
| return tomllib.load(source)["toolchain"]["channel"] | ||
|
|
||
| guest = channel("src/tests/rust_guests/rust-toolchain.toml") | ||
| if guest != channel("src/hyperlight_guest_capi/rust-toolchain.toml"): |
There was a problem hiding this comment.
This check runs only on pushes to main. A PR that bumps one guest toolchain file passes CI, the C API builds with a different rustc, and this workflow fails after merge. Could the same check run in dep_code_checks.yml?
| @@ -0,0 +1,6 @@ | |||
| [toolchain] | |||
There was a problem hiding this comment.
hyperlight-guest-capi is still a root workspace member, so the toolchain depends on the working directory. cargo build -p hyperlight-guest-capi and rust-analyzer from the root use 1.99.1, and both toolchains share target/. Would it make sense to exclude it from the root workspace like src/tests/rust_guests? Could be a follow-up.
| && rustup target add x86_64-unknown-linux-gnu \ | ||
| && rustup target add x86_64-unknown-linux-musl \ | ||
| && rustup target add x86_64-unknown-none \ | ||
| && rustup component add clippy rustfmt --toolchain ${RUST_TOOLCHAIN} \ |
There was a problem hiding this comment.
nit: rustup default installs clippy and rustfmt with the default profile, so this line looks redundant. rustfmt in the toolchain files also seems unused since fmt runs on nightly.
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>

Enables different toolchains for host and guest.
Host - 1.99.1
Guest - 1.94.1
No change to MSRV.
Minor changes to resolve warnings from move to 1.99