Skip to content

Incorrect toolchain check when running cross with active or default toolchain #1678

@Rileran

Description

@Rileran

Checklist

Describe your issue

When running any cross command, cross tries to download the stable version while it is already installed.

This is because when running rustup toolchain list, my toolchain stable has a suffix (active, default), which makes the check fail. I believe adding the --quiet flag at the end of the command should fix the issue.

I have tried both the latest stable 0.2.5 version and the lastet version on the main branch (9e2298e at the time of writing)

Two months ago, on a version not released yet, the command rustup toolchain list was replaced with rustup --quiet toolchain list. This however does not fix the issue as the --quiet flag applies to the rustup command and not the list command.

What target(s) are you cross-compiling for?

No response

Which operating system is the host (e.g computer cross is on) running?

  • macOS
  • Windows
  • Linux / BSD
  • other OS (specify in description)

What architecture is the host?

  • x86_64 / AMD64
  • arm32
  • arm64 (including Mac M1)

What container engine is cross using?

  • docker
  • podman
  • other container engine (specify in description)

cross version

cross 0.2.5

Example

$ cross --help -v
+ cargo metadata --format-version 1
+ rustc --print sysroot
+ rustup toolchain list
+ rustup --verbose toolchain add stable-x86_64-unknown-linux-gnu --profile minimal
debug: read metadata version: '12'
debug: updating existing install for 'stable-x86_64-unknown-linux-gnu'
debug: toolchain directory: '/home/user/.rustup/toolchains/stable-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
debug: creating temp file: /home/user/.rustup/tmp/yivvct2ihzgg02o9_file
debug: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256'
debug: downloading with reqwest
debug: deleted temp file: /home/user/.rustup/tmp/yivvct2ihzgg02o9_file
debug: toolchain is already up to date

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.86.0 (05f9846f8 2025-03-31)

info: checking for self-update
+ rustup target list --toolchain stable-x86_64-unknown-linux-gnu
+ rustup component list --toolchain stable-x86_64-unknown-linux-gnu
[cross] note: Falling back to `cargo` on the host.
+ cargo --help -v
Rust's package manager

Usage: cargo [+toolchain] [OPTIONS] [COMMAND]
       cargo [+toolchain] [OPTIONS] -Zscript <MANIFEST_RS> [ARGS]...
...

Example of rustup toolchain list result

$ rustup toolchain list
stable-x86_64-unknown-linux-gnu (active, default)
nightly-x86_64-unknown-linux-gnu

Additional information / notes

No response

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