{"record":{"id":"0e597a0394563024","repo":"jdx/mise","slug":"platform-bin-spec-must-be-in-format-platform-path","errorCode":null,"errorMessage":"Platform bin spec must be in format 'platform:path', got: {}","messagePattern":"Platform bin spec must be in format 'platform:path', got: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/generate/tool_stub.rs","lineNumber":538,"sourceCode":"            // Format: platform:url\n            let parts: Vec<&str> = spec.splitn(2, ':').collect();\n            if parts.len() != 2 {\n                bail!(\n                    \"Platform spec must be in format 'platform:url' or just 'url' (for auto-detection). Got: {}\",\n                    spec\n                );\n            }\n\n            let platform = parts[0].to_string();\n            let url = parts[1].to_string();\n            Ok((platform, url))\n        }\n    }\n\n    fn parse_platform_bin_spec(&self, spec: &str) -> Result<(String, String)> {\n        let parts: Vec<&str> = spec.splitn(2, ':').collect();\n        if parts.len() != 2 {\n            bail!(\n                \"Platform bin spec must be in format 'platform:path', got: {}\",\n                spec\n            );\n        }\n\n        let platform = parts[0].to_string();\n        let bin_path = parts[1].to_string();\n\n        Ok((platform, bin_path))\n    }\n\n    async fn analyze_url(\n        &self,\n        url: &str,\n        mpr: &std::sync::Arc<crate::ui::multi_progress_report::MultiProgressReport>,\n    ) -> Result<(String, u64, Option<String>)> {\n        // Create a temporary directory for download and extraction\n        let temp_dir = tempfile::tempdir()?;","sourceCodeStart":520,"sourceCodeEnd":556,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/cli/generate/tool_stub.rs#L520-L556","documentation":"Each --platform-bin value must be exactly `platform:path` with a colon separating the platform target from the binary path inside the extracted archive. parse_platform_bin_spec splits on the first ':' and rejects values with no colon at all.","triggerScenarios":"Passing `--platform-bin tool.exe` or `--platform-bin ./bin/tool` (no platform prefix); quoting errors that split the pair; on Windows-style specs where extra colons shift the split, e.g. `--platform-bin windows-x64:C:\\path\\tool.exe` (the first colon wins, so this specific form is fine, but `C:\\path` alone is not).","commonSituations":"Hand-writing platform-bin lists for cross-platform stubs; assuming --platform-bin mirrors --bin's bare-path syntax.","solutions":["Always include the platform prefix: `--platform-bin windows-x64:tool.exe --platform-bin linux-x64:bin/tool`","For a single platform-neutral binary path, use plain `--bin bin/tool` instead of --platform-bin","Verify the platform token matches one mise recognizes (e.g. linux-x64, osx-arm64) — an unknown platform string parses but will never match at install time"],"exampleFix":"# before\nmise generate tool-stub ./ctl --platform-bin bin/ctl.exe\n# after\nmise generate tool-stub ./ctl --platform-bin windows-x64:bin/ctl.exe","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\nfor spec in \"${platform_bins[@]}\"; do\n  [[ \"$spec\" == *:* ]] || { echo \"bad platform-bin spec (need platform:path): $spec\" >&2; exit 2; }\ndone\nmise generate tool-stub ./out --platform-bin \"${platform_bins[@]}\"","typeGuard":null,"tryCatchPattern":"mise generate tool-stub ./out --platform-bin \"$spec\" 2>err.log || { grep -q 'platform:path' err.log && echo \"fix platform-bin spec: $spec\" >&2 && exit 2; }","preventionTips":["Use plain --bin for single platform-neutral binary paths","Use one recognized platform token per binary (linux-x64, osx-arm64, windows-x64)"],"tags":["cli","tool-stub","argument-format","mise"],"backgroundTag":"invalid-argument-format","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}