Skip to content

"Couldn't install toolchain" #1649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
4 of 11 tasks
mwlon opened this issue Mar 16, 2025 · 7 comments
Open
4 of 11 tasks

"Couldn't install toolchain" #1649

mwlon opened this issue Mar 16, 2025 · 7 comments

Comments

@mwlon
Copy link

mwlon commented Mar 16, 2025

Checklist

Describe your issue

When trying to cross-compile for Linux from my aarch64-apply-darwin machine, I get this error:

 % cross build --release -p pco_java --target x86_64-unknown-linux-gnu
error: toolchain 'nightly-x86_64-unknown-linux-gnu' may not be able to run on this system
note: to build software for that platform, try `rustup target add x86_64-unknown-linux-gnu` instead
note: add the `--force-non-host` flag to install the toolchain anyway
Error: 
   0: couldn't install toolchain `nightly-x86_64-unknown-linux-gnu`
   1: `rustup toolchain add nightly-x86_64-unknown-linux-gnu --profile minimal` failed with exit status: 1

I've gone through the setup and ensured that Docker is running. Why might I be getting this error?

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

other (specify in description)

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

0.2.5

Example

No response

Additional information / notes

I notice when I run cross --version, I get this warning:

[cross] warning: `cross` does not provide a Docker image for target aarch64-apple-darwin, specify a custom image in `Cross.toml`.
[cross] note: Falling back to `cargo` on the host.

I suspect this is related.

@Emilgardis
Copy link
Member

This is fixed on the main branch

@mwlon
Copy link
Author

mwlon commented Mar 17, 2025

Will there be a new release soon?

@conorzhong
Copy link

Will there be a new release soon?

Use cargo install cross --git https://github.com/cross-rs/cross instead of cargo install cross

@JMLX42
Copy link

JMLX42 commented Mar 20, 2025

Use cargo install cross --git https://github.com/cross-rs/cross instead of cargo install cross

Sadly we build CI images that contain cross and it is installed with a pinned version:

# renovate: datasource=github-releases depName=cross-rs/cross versioning=semver
CROSS_VERSION="0.2.5"
cargo install cross --git https://github.com/cross-rs/cross --tag v${CROSS_VERSION} 

And we rely on Renovate to update cross.

If we use cargo install cross --git https://github.com/cross-rs/cross then there is no way to know exactly what is being installed.

@Emilgardis
Copy link
Member

You can specify --rev, do note that a build from git will use images with the tag :main if not specified in config

@JMLX42
Copy link

JMLX42 commented Mar 20, 2025

You can specify --rev, do note that a build from git will use images with the tag :main if not specified in config

@Emilgardis thank you for the suggestion. But a git commit hash cannot be updated by Renovate. Meaning we have to chose between:

  • 0.2.5 that does not work with Rust 1.85+
  • a more recent commit hash that might add more problems than it solves and will have to be updated manually

Is a fix release entirely out of the question?

@Emilgardis
Copy link
Member

A fix release would be very heavy, i do not want to myself try to support that as I'd have to fix some very old stuff.

I could maybe do a beta release, but see #1290

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants