Create inner workspace for rust guests to reduce compile time#1501
Merged
Conversation
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
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.lockfiles 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. |
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.
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 gueststime 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