Skip to content

Support guest toolchain selection - #83

Open
simongdavies wants to merge 3 commits into
mainfrom
simongdavies-guest-toolchain-selection
Open

simongdavies wants to merge 3 commits into
mainfrom
simongdavies-guest-toolchain-selection

Conversation

@simongdavies

Copy link
Copy Markdown
Member

This pull request introduces support for selecting and using an explicit guest Rust toolchain (via a rust-toolchain.toml file) when running cargo-hyperlight as a library, allowing the guest build to use a different toolchain than the host.

Select installed Cargo and Rust tools consistently for guest preparation and
compilation without changing the host process environment or installing
components. Document the API and cover newer-host/older-guest builds.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 63d06f38-d356-4418-aa31-2473e0f87584
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
@simongdavies simongdavies added the enhancement New feature or request label Oct 20, 2026
@simongdavies
simongdavies requested a balanced review from Copilot October 20, 2026 14:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Cross-platform toolchain switching needs human validation, with unresolved executable-selection and credential-exposure issues.

2 open issues
What changed in this PR

Adds explicit guest Rust toolchain selection for library callers, allowing host and guest builds to use different compilers.

Changes:

  • Parses toolchain files and applies selected compiler executables.
  • Requires preinstalled guest toolchains and Rust sources.
  • Adds documentation, tests, and cross-platform CI coverage.
File Description
tests/​toolchain_file.rs Tests selection errors and cross-version builds.
src/​toolchain.rs Uses effective Cargo for preparation.
src/​sysroot.rs Uses selected tools and checks Rust sources.
src/​lib.rs Controls source installation during preparation.
src/​command.rs Adds the toolchain selection API.
src/​cli.rs Uses effective Cargo for configuration queries.
src/​cargo_cmd.rs Parses toolchain files and resolves executables.
README.md Documents guest toolchain selection.
Cargo.toml Adds TOML parsing dependency.
Cargo.lock Locks new dependencies.
.github/​workflows/​ci.yml Adds Linux and Windows toolchain-selection tests.

Review effort: Balanced

Comment thread src/cargo_cmd.rs
Comment thread src/command.rs Outdated
simongdavies and others added 2 commits October 20, 2026 17:10
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 63d06f38-d356-4418-aa31-2473e0f87584
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
Use the same Cargo executable for preparation and the guest command, with
explicit toolchain selection taking precedence over CARGO overrides.
Keep inherited credentials out of printable command overrides while
preserving environment inheritance and clearing behavior.

Add regression tests for executable selection and credential-free debug
and failure diagnostics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 63d06f38-d356-4418-aa31-2473e0f87584
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
@simongdavies
simongdavies force-pushed the simongdavies-guest-toolchain-selection branch from 8f4696d to ecd1f48 Compare October 20, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants