From 292261045829727f11879fbcb6febeea316cc382 Mon Sep 17 00:00:00 2001 From: Charlie Tonneslan Date: Sat, 16 May 2026 19:36:03 -0400 Subject: [PATCH] shared: point users at cargo and cross-toolchains in no-image error When `cross` runs against a target it doesn't ship an image for (typical examples: x86_64-apple-darwin, x86_64-pc-windows-msvc) the error just told the user to specify a custom image in Cross.toml, which isn't very actionable if you don't already know what an image for that target looks like. Two cases that come up a lot: - target == host (or basically host, like macOS-on-macOS). Plain cargo already works. - target needs the proprietary Apple/MSVC SDKs. The community cross-toolchains repo has Dockerfiles for that. Mention both in the error so people can find their next step without having to ask in chat. Closes #1447. Signed-off-by: Charlie Tonneslan --- src/docker/shared.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/docker/shared.rs b/src/docker/shared.rs index abad682a1..964f216ce 100644 --- a/src/docker/shared.rs +++ b/src/docker/shared.rs @@ -1202,8 +1202,12 @@ pub(crate) fn group_id() -> String { #[derive(Debug, thiserror::Error)] pub enum GetImageError { #[error( - "`cross` does not provide a Docker image for target {0}, \ - specify a custom image in `Cross.toml`." + "`cross` does not provide a Docker image for target {0}. \ + If your target is the host (or close to it, e.g. macOS or Windows on \ + macOS/Windows), you can typically just use `cargo` directly. \ + Otherwise, specify a custom image in `Cross.toml`, or see \ + https://github.com/cross-rs/cross-toolchains for community-built \ + images covering targets like `*-apple-darwin` and `*-pc-windows-msvc`." )] NoCompatibleImages(String), #[error("platforms for provided image `{0}` are not specified, this is a bug in cross")]