Skip to content

Create inner workspace for rust guests to reduce compile time#1501

Merged
ludfjig merged 1 commit into
hyperlight-dev:mainfrom
ludfjig:guest_workspace
Jun 3, 2026
Merged

Create inner workspace for rust guests to reduce compile time#1501
ludfjig merged 1 commit into
hyperlight-dev:mainfrom
ludfjig:guest_workspace

Conversation

@ludfjig
Copy link
Copy Markdown
Contributor

@ludfjig ludfjig commented Jun 3, 2026

Reduces time to build rust guests by putting them in a workspace together. This avoids rebuilding hyperlight-libc from scratch and hyperlight-guest-bin from scratch for each guest which is very slow. On my machine just guests time is reduced by 6 minutes.

Aside: rust guests shouldn't need hyperlight-libc (#1483), but this is a good change regardless since hyperlight-guest-bin will be shared even if the libc issue is fixed in the future

Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
@ludfjig ludfjig added the kind/refactor For PRs that restructure or remove code without adding new functionality. label Jun 3, 2026
@ludfjig ludfjig marked this pull request as ready for review June 3, 2026 20:11
Copilot AI review requested due to automatic review settings June 3, 2026 20:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Creates a nested Cargo workspace under src/tests/rust_guests/ so the Rust guest crates build together and can share build artifacts (notably hyperlight-libc / hyperlight-guest-bin), reducing repeated recompilation and improving just guests build time.

Changes:

  • Introduce an inner Cargo workspace for Rust guest crates and consolidate to a single src/tests/rust_guests/Cargo.lock.
  • Update Justfile, CI workflows, Nix flake inputs, and Dependabot configuration to build/fetch/cache against the guest workspace rather than per-guest crates.
  • Remove per-guest Cargo.lock files now that dependency resolution is centralized at the guest workspace root.

Reviewed changes

Copilot reviewed 11 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/tests/rust_guests/simpleguest/Cargo.lock Removed per-crate lockfile in favor of workspace lock.
src/tests/rust_guests/dummyguest/Cargo.lock Removed per-crate lockfile in favor of workspace lock.
src/tests/rust_guests/Cargo.toml New nested workspace definition for Rust guest crates.
src/tests/rust_guests/Cargo.lock Updated lockfile to represent the combined guest workspace resolution.
Justfile Build/clean/fetch/fmt/clippy paths updated to operate on the guest workspace and shared target dir.
flake.nix Switch Nix vendoring/importCargoLock inputs from per-guest manifests to the guest workspace manifest.
dev/check-license-headers.sh Adjust target-dir exclusion to match the new shared guest workspace target/ location.
Cargo.toml Exclude the nested src/tests/rust_guests workspace from the root workspace.
.github/workflows/ValidatePullRequest.yml Update comments/intent around updating the guest workspace lock on Dependabot PRs.
.github/workflows/RustNightly.yml Update caches to the unified guest workspace target paths.
.github/workflows/dep_update_guest_locks.yml Update workflow to refresh/commit only the guest workspace Cargo.lock.
.github/workflows/dep_code_checks.yml Point guest lock fetch and caching to the guest workspace.
.github/workflows/dep_build_guests.yml Point guest build caching to the guest workspace.
.github/dependabot.yml Consolidate guest Dependabot config to a single /src/tests/rust_guests workspace entry.

Copy link
Copy Markdown
Member

@simongdavies simongdavies left a comment

Choose a reason for hiding this comment

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

Nice!! LGTM

@ludfjig ludfjig merged commit 3b73fc1 into hyperlight-dev:main Jun 3, 2026
40 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactor For PRs that restructure or remove code without adding new functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants