{"record":{"id":"2428c6c1b967d8a2","repo":"jdx/mise","slug":"invalid-python-precompiled-arch-arch-this-loo-2428c6","errorCode":null,"errorMessage":"invalid python.precompiled_arch={arch:?}: this looks like an OS value. Use python.precompiled_os={arch:?} instead, and set python.precompiled_arch to an architecture such as \"x86_64\" or \"aarch64\".","messagePattern":"invalid python\\.precompiled_arch=(.+?): this looks like an OS value\\. Use python\\.precompiled_os=(.+?) instead, and set python\\.precompiled_arch to an architecture such as \"x86_64\" or \"aarch64\"\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/plugins/core/python.rs","lineNumber":1378,"sourceCode":"    } else {\n        \"python-precompiled.gz\".into()\n    }\n}\n\nfn validate_python_precompiled_settings(settings: &Settings) -> Result<()> {\n    if let Some(arch) = &settings.python.precompiled_arch\n        && let Some((precompiled_arch, precompiled_os)) = split_python_precompiled_triple(arch)\n    {\n        bail!(\n            \"invalid python.precompiled_arch={arch:?}: this looks like a target triple. \\\n             Set python.precompiled_arch={precompiled_arch:?} and \\\n             python.precompiled_os={precompiled_os:?} instead.\"\n        );\n    }\n    if let Some(arch) = &settings.python.precompiled_arch\n        && looks_like_python_precompiled_os_value(arch)\n    {\n        bail!(\n            \"invalid python.precompiled_arch={arch:?}: this looks like an OS value. \\\n             Use python.precompiled_os={arch:?} instead, and set python.precompiled_arch \\\n             to an architecture such as \\\"x86_64\\\" or \\\"aarch64\\\".\"\n        );\n    }\n    Ok(())\n}\n\nfn split_python_precompiled_triple(value: &str) -> Option<(&str, &str)> {\n    [\"-unknown-linux\", \"-apple-darwin\", \"-pc-windows\"]\n        .iter()\n        .find_map(|os_marker| {\n            let index = value.find(os_marker)?;\n            (index > 0).then(|| (&value[..index], &value[index + 1..]))\n        })\n}\n\nfn looks_like_python_precompiled_os_value(value: &str) -> bool {","sourceCodeStart":1360,"sourceCodeEnd":1396,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/plugins/core/python.rs#L1360-L1396","documentation":"python.precompiled_arch must hold an architecture name; when it is set to something that looks like an OS value (e.g. \"linux\", \"macos\"), looks_like_python_precompiled_os_value detects the mistake and mise bails with a message telling you to move the value to python.precompiled_os. This guards against swapped settings that would otherwise never match a precompiled distribution.","triggerScenarios":"Setting `python.precompiled_arch = \"linux\"` (or \"windows\", \"macos\", etc.) and running `mise install python@...`; also hit by the unit tests of validate_python_precompiled_settings.","commonSituations":"Swapping the two settings by accident: OS string pasted into the arch field; docs misread; autocomplete picking the wrong key.","solutions":["Move the value: set python.precompiled_os = \"linux\" and python.precompiled_arch = \"x86_64\" (or \"aarch64\") as the error instructs","Remove the mistaken setting if no precompiled override was intended"],"exampleFix":"// before\n[python]\nprecompiled_arch = \"linux\"\n// after\n[python]\nprecompiled_arch = \"x86_64\"\nprecompiled_os = \"linux\"","handlingStrategy":"validation","validationCode":"const OS_VALUES = new Set([\"linux\",\"macos\",\"darwin\",\"windows\",\"freebsd\"]);\nconst arch = settings.python?.precompiled_arch;\nif (arch && OS_VALUES.has(arch.toLowerCase())) {\n  throw new Error(`'${arch}' is an OS; use python.precompiled_os='${arch}' and set precompiled_arch to e.g. x86_64`);\n}","typeGuard":"const looksLikeArch = (v) => /^(x86_64|aarch64|arm64|i686|ppc64le|s390x)$/i.test(v);\n// usage: if (!looksLikeArch(arch)) reject(...);","tryCatchPattern":null,"preventionTips":["Remember precompiled_arch takes architectures only; OS names belong in precompiled_os","Copy documented example settings verbatim instead of swapping the two keys","Add a config check that validates arch against a known architecture list"],"tags":["python","settings","config-validation"],"backgroundTag":"invalid-config-value","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}