{"record":{"id":"529600796d4a0092","repo":"jdx/mise","slug":"macos-release-targets-cannot-declare-a-libc-family","errorCode":null,"errorMessage":"macOS release targets cannot declare a libc family","messagePattern":"macOS release targets cannot declare a libc family","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/remote.rs","lineNumber":1613,"sourceCode":"    format!(\"{RELEASE_BASE_URL}/v{version}/{filename}\")\n}\n\nfn release_asset_name(os: &str, arch: &str, libc: Option<LibcFlavor>) -> Result<String> {\n    let release_arch = match arch {\n        \"x86_64\" => \"x64\",\n        \"aarch64\" => \"arm64\",\n        \"armv7\" => \"armv7\",\n        _ => {\n            bail!(\n                \"mise {} has no official precompiled artifact for {os}/{arch}; set mise_bin, remote_mise, or bootstrap_command\",\n                env!(\"CARGO_PKG_VERSION\")\n            )\n        }\n    };\n    let suffix = match os {\n        \"macos\" if matches!(arch, \"x86_64\" | \"aarch64\") => {\n            if libc.is_some() {\n                bail!(\"macOS release targets cannot declare a libc family\");\n            }\n            format!(\"macos-{release_arch}\")\n        }\n        \"linux\" if matches!(arch, \"x86_64\" | \"aarch64\" | \"armv7\") => match libc {\n            Some(LibcFlavor::Glibc) => format!(\"linux-{release_arch}\"),\n            Some(LibcFlavor::Musl) => format!(\"linux-{release_arch}-musl\"),\n            None => bail!(\"Linux release targets require a detected libc family\"),\n        },\n        _ => {\n            bail!(\n                \"mise {} has no official precompiled artifact for {os}/{arch}; set mise_bin, remote_mise, or bootstrap_command\",\n                env!(\"CARGO_PKG_VERSION\")\n            )\n        }\n    };\n    Ok(format!(\"mise-v{}-{suffix}\", env!(\"CARGO_PKG_VERSION\")))\n}\n","sourceCodeStart":1595,"sourceCodeEnd":1631,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/remote.rs#L1595-L1631","documentation":"mise release assets encode libc only for Linux (glibc/musl); macOS artifacts have no libc suffix. If a RemotePlatform targets macOS but carries a libc flavor, the platform description is internally inconsistent (there is no such release asset), so release_asset_name rejects it.","triggerScenarios":"Constructing or parsing a RemotePlatform with os=\"macos\" and libc=Some(...) — e.g. platform string \"macos/arm64/glibc\" misconfigured in remote settings, or a platform parser misclassifying a target.","commonSituations":"Copy-pasting a linux platform spec (linux/x64/musl) and changing only the OS to macos; a config generator that always emits a libc component; misparsing remote uname output on a macOS host.","solutions":["Remove the libc component from the macOS platform spec (use macos/x64 or macos/arm64)","Fix the platform parsing/config so libc is only set for linux targets","If a tool auto-detects libc on macOS, ensure it maps darwin to libc=None"],"exampleFix":"// before\nRemotePlatform { os: \"macos\", arch: \"arm64\", libc: Some(LibcFlavor::Musl) }\n// after\nRemotePlatform { os: \"macos\", arch: \"arm64\", libc: None }","handlingStrategy":"type-guard","validationCode":"if platform.os == \"macos\" { assert(platform.libc.is_none(), \"macOS targets must not set libc\") }","typeGuard":"fn platform_is_valid(os: &str, libc: Option<LibcFlavor>) -> bool { os != \"macos\" || libc.is_none() }","tryCatchPattern":"match res { Err(e) if e.message.contains(\"libc family\") => sanitize_platform_spec(), other => other? }","preventionTips":["Only attach libc flavor to linux platform specs","Validate platform strings (os/arch[/libc]) before storing them in config","Fix generators that unconditionally emit a libc component"],"tags":["macos","libc","invalid-platform"],"backgroundTag":"conflicting-config-options","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"}