Skip to content

Changes to allow different toolchains for host and guest - #1962

Merged
simongdavies merged 7 commits into
mainfrom
simongdavies-split-rust-toolchains
Oct 22, 2026
Merged

simongdavies merged 7 commits into
mainfrom
simongdavies-split-rust-toolchains

Conversation

@simongdavies

Copy link
Copy Markdown
Member

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

Copilot AI balanced review requested due to automatic review settings October 20, 2026 15:46
@simongdavies simongdavies added the kind/dependencies For PRs that update dependencies or related components label Oct 20, 2026

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.

🔵 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

Comment thread .github/workflows/dep_build_guests.yml Outdated
@hyperlight-gh-bot

This comment has been minimized.

@hyperlight-gh-bot

This comment has been minimized.

Comment thread .github/workflows/CreateRelease.yml Outdated
Comment thread src/hyperlight_guest_bin/src/libc_stubs.rs Outdated
Comment thread .github/workflows/CreateDevcontainerImage.yml
Comment thread src/hyperlight_libc/build.rs
Comment thread .github/workflows/CreateRelease.yml Outdated
Comment thread src/hyperlight_guest_capi/rust-toolchain.toml
Comment thread .devcontainer/Dockerfile Outdated
Comment thread CONTRIBUTING.md Outdated
Comment thread flake.nix Outdated
@hyperlight-gh-bot

This comment has been minimized.

@hyperlight-gh-bot

This comment has been minimized.

@ludfjig ludfjig 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.

just some more regarding caching since I've recently tried to fix this

Comment thread .github/workflows/CargoAudit.yml
Comment thread .github/workflows/dep_build_guests.yml Outdated
simongdavies and others added 7 commits October 22, 2026 19:06
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>
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>
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ab05d8c1-959f-4723-9dce-971b8be8559a
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
@simongdavies
simongdavies force-pushed the simongdavies-split-rust-toolchains branch from 8a195fd to 59e08c6 Compare October 22, 2026 18:07
@simongdavies
simongdavies enabled auto-merge (squash) October 22, 2026 18:27
@hyperlight-gh-bot

Copy link
Copy Markdown

Benchmark Results

Measured commit: 59e08c6ee5f1
Baseline commit: 3f2ed9becd6e

kvm / amd (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 772.39 ns (➖ 1.01x slower)
vec_bytes 579.68 ns (➖ 1.00x faster)
374.15 µs (➖ 1.01x faster)

payload_allocation

slot_pool_segmented
262144 523.59 ns (➖ 1.00x faster)
65536 141.58 ns (➖ 1.01x faster)

sandboxes

create_initialized_and_drop
medium 83.21 ms (➖ 1.01x faster)

slot_pool

alloc_dealloc_1500 alloc_dealloc_4096 alloc_dealloc_128
7.70 ns (➖ 1.01x faster) 7.70 ns (➖ 1.00x faster) 7.69 ns (➖ 1.00x faster)

snapshot_files

load_snapshot_unverified
small 92.92 µs (➖ 1.01x slower)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
262144 7.20 µs (➖ 1.00x faster) 7.73 µs (➖ 1.09x slower)
65536 2.04 µs (➖ 1.06x slower) 1.92 µs (➖ 1.10x faster)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 6.43 µs (➖ 1.01x slower) 6.13 µs (➖ 1.02x faster)
8192 1.04 µs (➖ 1.02x slower) 1.01 µs (➖ 1.00x faster)
262144 27.17 µs (➖ 1.00x slower)
kvm / intel (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 773.59 ns (➖ 1.05x slower)
vec_bytes 585.68 ns (➖ 1.01x slower)
734.95 µs (➖ 1.05x slower)

payload_allocation

slot_pool_segmented
262144 565.63 ns (➖ 1.01x faster)
65536 191.82 ns (➖ 1.02x faster)

sandboxes

create_initialized_and_drop
medium 79.92 ms (➖ 1.01x faster)

slot_pool

alloc_dealloc_1500 alloc_dealloc_4096 alloc_dealloc_128
7.55 ns (➖ 1.03x faster) 7.55 ns (➖ 1.03x faster) 7.58 ns (➖ 1.02x faster)

snapshot_files

load_snapshot_unverified
small 49.79 µs (➖ 1.04x slower)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
262144 8.65 µs (➖ 1.01x slower) 8.57 µs (➖ 1.00x faster)
65536 2.45 µs (➖ 1.02x slower) 2.40 µs (➖ 1.01x faster)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 7.63 µs (➖ 1.11x faster) 7.91 µs (➖ 1.08x faster)
8192 792.27 ns (➖ 1.04x faster) 762.84 ns (➖ 1.05x faster)
262144 34.37 µs (➖ 1.03x slower)
mshv3 / amd (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 973.41 ns (➖ 1.03x slower)
vec_bytes 715.25 ns (➖ 1.03x faster)
271.86 µs (➖ 1.14x faster)

payload_allocation

slot_pool_segmented
262144 717.03 ns (➖ 1.00x faster)
65536 200.87 ns (➖ 1.06x slower)

sandboxes

create_initialized_and_drop
medium 63.00 ms (➖ 1.09x slower)

slot_pool

alloc_dealloc_1500 alloc_dealloc_4096 alloc_dealloc_128
9.71 ns (➖ 1.00x faster) 9.70 ns (➖ 1.00x faster) 9.70 ns (➖ 1.00x faster)

snapshot_files

load_snapshot_unverified
small 86.57 µs (➖ 1.00x slower)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
262144 10.01 µs (➖ 1.01x faster) 9.66 µs (➖ 1.01x slower)
65536 2.40 µs (➖ 1.04x faster) 2.25 µs (➖ 1.01x faster)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 8.30 µs (➖ 1.15x faster) 8.48 µs (➖ 1.17x faster)
8192 1.24 µs (➖ 1.10x faster) 1.22 µs (➖ 1.02x slower)
262144 35.72 µs (➖ 1.08x faster)
mshv3 / intel (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 902.42 ns (➖ 1.02x faster)
vec_bytes 671.53 ns (➖ 1.02x slower)
708.18 µs (➖ 1.07x faster)

payload_allocation

slot_pool_segmented
262144 629.29 ns (➖ 1.01x faster)
65536 244.48 ns (➖ 1.02x slower)

sandboxes

create_initialized_and_drop
medium 60.52 ms (➖ 1.14x faster)

slot_pool

alloc_dealloc_1500 alloc_dealloc_4096 alloc_dealloc_128
9.16 ns (➖ 1.01x slower) 9.28 ns (➖ 1.01x slower) 9.18 ns (➖ 1.00x slower)

snapshot_files

load_snapshot_unverified
small 45.92 µs (➖ 1.03x slower)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
262144 8.03 µs (➖ 1.00x slower) 7.97 µs (➖ 1.00x slower)
65536 2.29 µs (➖ 1.00x slower) 2.36 µs (➖ 1.03x slower)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 7.44 µs (➖ 1.00x faster) 7.40 µs (➖ 1.00x faster)
8192 913.53 ns (➖ 1.01x slower) 899.64 ns (➖ 1.03x faster)
262144 41.35 µs (➖ 1.05x slower)
hyperv-ws2025 / amd (Windows) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 1.16 µs (➖ 1.05x faster)
vec_bytes 856.49 ns (➖ 1.12x slower)
1.92 ms (➖ 1.00x faster)

payload_allocation

slot_pool_segmented
262144 786.82 ns (➖ 1.01x faster)
65536 229.64 ns (➖ 1.07x faster)

sandboxes

create_initialized_and_drop
medium 84.24 ms (➖ 1.05x slower)

slot_pool

alloc_dealloc_1500 alloc_dealloc_4096 alloc_dealloc_128
9.90 ns (➖ 1.00x slower) 10.03 ns (➖ 1.01x slower) 9.99 ns (➖ 1.00x slower)

snapshot_files

load_snapshot_unverified
small 906.18 µs (➖ 1.44x slower)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
262144 9.53 µs (➖ 1.05x faster) 9.65 µs (➖ 1.01x faster)
65536 2.40 µs (➖ 1.01x slower) 2.53 µs (➖ 1.07x slower)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 9.62 µs (➖ 1.04x slower) 10.12 µs (➖ 1.10x slower)
8192 1.34 µs (➖ 1.07x slower) 1.33 µs (➖ 1.04x slower)
262144 42.29 µs (➖ 1.06x faster)
hyperv-ws2025 / intel (Windows) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 1.20 µs (➖ 1.00x faster)
vec_bytes 764.45 ns (➖ 1.00x slower)
2.93 ms (➖ 1.03x faster)

payload_allocation

slot_pool_segmented
262144 734.72 ns (➖ 1.00x faster)
65536 209.40 ns (➖ 1.02x slower)

sandboxes

create_initialized_and_drop
medium 101.75 ms (➖ 1.09x faster)

slot_pool

alloc_dealloc_1500 alloc_dealloc_4096 alloc_dealloc_128
9.57 ns (➖ 1.00x slower) 10.24 ns (➖ 1.04x slower) 9.59 ns (➖ 1.00x slower)

snapshot_files

load_snapshot_unverified
small 624.38 µs (➖ 1.12x slower)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
262144 7.60 µs (➖ 1.03x slower) 7.62 µs (➖ 1.03x slower)
65536 2.26 µs (➖ 1.01x slower) 2.29 µs (➖ 1.07x faster)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 8.42 µs (➖ 1.15x faster) 8.33 µs (➖ 1.00x faster)
8192 1.04 µs (➖ 1.00x faster) 1.10 µs (➖ 1.05x slower)
262144 41.14 µs (➖ 1.22x faster)

Reported by cargo ci bench-report --candidate run:39828625144 --config-file bench_report.toml.

@simongdavies
simongdavies merged commit fd9fc1e into main Oct 22, 2026
121 of 127 checks passed
@simongdavies
simongdavies deleted the simongdavies-split-rust-toolchains branch October 22, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/dependencies For PRs that update dependencies or related components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants