Skip to content

cargo lambda build installs unintended stable toolchain #894

@Creanciel

Description

@Creanciel

Description

When running cargo lambda build in an environment where only a specific toolchain version is installed (e.g., 1.90.0 or 1.91.0), the command automatically installs the stable toolchain instead of using the currently active toolchain.

Steps to Reproduce

  1. Install only a specific toolchain version (e.g., 1.90.0 or 1.91.0)
  2. Verify the active toolchain with rustup show
  3. Run cargo lambda build --release --target aarch64-unknown-linux-musl
  4. Observe that rustup +stable target add ... is executed, installing the stable toolchain

Expected Behavior

The command should use the currently active toolchain (e.g., 1.90.0) and add the target component to that toolchain: rustup +1.90.0 target add aarch64-unknown-linux-musl

Actual Behavior

The command attempts to use the stable toolchain, which triggers an installation: rustup +stable target add aarch64-unknown-linux-musl

Possible Cause

In crates/cargo-lambda-build/src/toolchain.rs:17-22, the channel type (Channel::Stable, etc.) is directly converted to a toolchain name string ("stable", etc.). However, while 1.90.0 is from the stable channel, the toolchain names "1.90.0" and "stable" refer to different toolchains in rustup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions