{"record":{"id":"11a408abfd5511e7","repo":"cross-rs/cross","slug":"unsupported-os-in-target-abi-abi-system-system","errorCode":null,"errorMessage":"unsupported os in target, abi: {abi:?}, system: {system:?} ","messagePattern":"unsupported os in target, abi: (.+?), system: (.+?) ","errorType":"validation","errorClass":"eyre::ErrReport","httpStatus":null,"severity":"error","filePath":"src/docker/image.rs","lineNumber":361,"sourceCode":"impl Os {\n    pub fn from_target(target: &TargetTriple) -> Result<Self> {\n        let mut iter = target.triple().rsplit('-');\n        Ok(\n            match (\n                iter.next().ok_or_else(|| eyre::eyre!(\"malformed target\"))?,\n                iter.next().ok_or_else(|| eyre::eyre!(\"malformed target\"))?,\n            ) {\n                (\"darwin\", _) => Os::Darwin,\n                (\"freebsd\", _) => Os::Freebsd,\n                (\"netbsd\", _) => Os::Netbsd,\n                (\"illumos\", _) => Os::Illumos,\n                (\"solaris\", _) => Os::Solaris,\n                // android targets also set linux, so must occur first\n                (\"android\", _) => Os::Android,\n                (_, \"linux\") => Os::Linux,\n                (_, \"windows\") => Os::Windows,\n                (abi, system) => {\n                    eyre::bail!(\"unsupported os in target, abi: {abi:?}, system: {system:?} \")\n                }\n            },\n        )\n    }\n\n    pub fn new(s: &str) -> Result<Self> {\n        use serde::de::IntoDeserializer;\n\n        Self::deserialize(<&str as IntoDeserializer>::into_deserializer(s))\n            .wrap_err_with(|| format!(\"architecture {s} is not supported\"))\n    }\n}\n\nimpl std::fmt::Display for Os {\n    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n        self.serialize(f)\n    }\n}","sourceCodeStart":343,"sourceCodeEnd":379,"githubUrl":"https://github.com/cross-rs/cross/blob/8c1a8aa4b661711f4b7b6ac07c2e8929ce2f7d27/src/docker/image.rs#L343-L379","documentation":"`ImagePlatform::from_target` maps a Rust target triple's (abi, system) pair onto a known Os. If the operating-system/ABI combination is not in the supported table (solaris, android, linux, windows and their recognized variants), it fails, refusing to guess a container image for an unknown platform.","triggerScenarios":"Calling `from_target` (or `ImagePlatform::new`) with a target triple whose OS part is unsupported, e.g. `wasm32-unknown-unknown`, `x86_64-unknown-freebsd`, or `aarch64-apple-darwin` if not handled upstream.","commonSituations":"Building for exotic/embedded targets, WebAssembly targets, BSD variants, or newly added Rust tier-2/3 targets not yet covered by cross's image mapping.","solutions":["Use a target with a supported OS (linux, windows, android, solaris variants).","Provide a custom Docker image for the target in cross config instead of relying on auto-detection.","Check the target triple for typos (e.g. `unknown` in the vendor slot confusing the parse)."],"exampleFix":"// before\nImagePlatform::from_target(\"wasm32-unknown-unknown\")? // unsupported os\n// after\nImagePlatform::from_target(\"x86_64-unknown-linux-gnu\")?","handlingStrategy":"validation","validationCode":"const SUPPORTED: [&str; 4] = [\"linux\", \"windows\", \"android\", \"solaris\"];\nif !SUPPORTED.iter().any(|os| target.contains(os)) {\n    return Err(format!(\"target {target} has an unsupported OS\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check cross's supported target list before adding a target to your build matrix.","For exotic OSes (BSD, wasm), provide a custom image in cross config instead of relying on from_target.","Keep cross updated so newly supported targets are recognized."],"tags":["docker","target-triple","platform","unsupported"],"backgroundTag":"unsupported-platform","analyzedSha":"8c1a8aa4b661711f4b7b6ac07c2e8929ce2f7d27","analyzedAt":"2026-09-13T15:10:43.988Z","contentChangedAt":"2026-09-13T15:10:43.988Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}