Repository navigation
Description
Summary
The built-in rust profile installs rustup as root and copies the executables from /root/.cargo/bin into /usr/local/bin, but it does not make the installed toolchain available to the configured guest user. The guest can find rustc and cargo, yet both are rustup shims that fail because the user's rustup home contains no toolchain.
Current behavior
scripts/guest/profiles/rust-post.sh currently does this:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
cp /root/.cargo/bin/* /usr/local/bin/ 2>/dev/null || trueThe installer stores the toolchain under root's rustup home. Copying /root/.cargo/bin copies the rustup proxy binaries, not the compiler and standard library managed under /root/.rustup. In a VM created from the resulting image, the guest user sees behavior equivalent to:
$ rustup toolchain list
no installed toolchains
$ rustc --version
rustup could not choose a version of rustc to run
This also means a profile named rust is not sufficient to build the workspace without manual toolchain installation.
Expected behavior
A VM created from an image built with --profile rust should give the configured guest user a usable Rust toolchain immediately. rustc --version, cargo --version, and rustup toolchain list should succeed without accessing root-owned state.
The implementation could install as the guest user after that user exists, or deliberately use shared RUSTUP_HOME/CARGO_HOME locations with suitable ownership. The important contract is that the installed toolchain, components, and future rustup operations work for both the default and custom guest user.
Acceptance criteria
- A fresh image built with the
rustprofile provides a usable toolchain to the configured guest user. - The guest does not depend on
/root/.rustupor other inaccessible root-owned state. - Default and custom guest usernames are covered.
- An integration assertion executes
rustc --versionandcargo --versionas the guest user, rather than only checking that the shim files exist. - The profile recipe/version marker changes so existing stale images are rebuilt when appropriate.
Related: #381 tracks the broader ordering problem for profile scripts and guest-user creation. This issue is independently observable because the current Rust script explicitly installs into root's rustup home and copies only the proxy binaries.
Activity