{"record":{"id":"5406b4821701efdf","repo":"jdx/mise","slug":"systemdependencies-entry-must-set-exactly-one-of-b","errorCode":null,"errorMessage":"systemDependencies entry must set exactly one of bin/pkgconfig/sharedlib/command","messagePattern":"systemDependencies entry must set exactly one of bin/pkgconfig/sharedlib/command","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/deps.rs","lineNumber":201,"sourceCode":"pub(crate) struct DepStatus {\n    pub dep: SystemDep,\n    /// detected version, if a version was extracted\n    pub found: Option<String>,\n    pub satisfied: bool,\n    /// why it is unsatisfied (or a note when satisfied)\n    pub reason: Option<String>,\n}\n\nimpl TryFrom<vfox::SystemDependency> for SystemDep {\n    type Error = eyre::Error;\n\n    fn try_from(d: vfox::SystemDependency) -> eyre::Result<Self> {\n        let check = match (&d.bin, &d.pkgconfig, &d.sharedlib, &d.command) {\n            (Some(b), None, None, None) => SystemDepCheck::Bin(b.clone()),\n            (None, Some(p), None, None) => SystemDepCheck::PkgConfig(p.clone()),\n            (None, None, Some(s), None) => SystemDepCheck::SharedLib(s.clone()),\n            (None, None, None, Some(c)) => SystemDepCheck::Command(c.clone()),\n            _ => eyre::bail!(\n                \"systemDependencies entry must set exactly one of bin/pkgconfig/sharedlib/command\"\n            ),\n        };\n        // A version constraint is only meaningful for bin/pkgconfig (we probe\n        // `--version` / `--modversion`). If declared on sharedlib/command,\n        // keep the check but drop the version with a warning rather than\n        // silently honoring a constraint that is never enforced.\n        let version = match (&check, &d.version) {\n            (_, None) => None,\n            (SystemDepCheck::Bin(_) | SystemDepCheck::PkgConfig(_), Some(v)) => {\n                Some(VersionConstraint::parse(v)?)\n            }\n            (check, Some(_)) => {\n                warn!(\n                    \"systemDependencies: `version` is only supported for bin/pkgconfig checks, ignoring it for the {} check\",\n                    check.kind()\n                );\n                None","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/deps.rs#L183-L219","documentation":"Schema validation in the `TryFrom<vfox::SystemDependency>` conversion: a `systemDependencies` entry must declare exactly one check kind — `bin`, `pkgconfig`, `sharedlib`, or `command`. Any combination that isn't exactly one Some (zero or multiple set) bails with this message.","triggerScenarios":"Converting a vfox plugin's `SystemDependency` where the entry sets none of the four fields, or sets two or more (e.g. both `bin` and `command`, or `sharedlib` with `pkgconfig`).","commonSituations":"Plugin authors writing `systemDependencies` entries with `bin` plus a `command` fallback for portability; copy-paste leaving both `pkgconfig` and `sharedlib` filled; entries with all fields empty because the author intended a placeholder.","solutions":["Keep only one of `bin`, `pkgconfig`, `sharedlib`, `command` per entry; split multi-check requirements into multiple entries.","Pick the most appropriate single check (e.g. drop `command` if `bin` already names the binary).","If the entry is empty, add the intended check field instead of shipping a placeholder."],"exampleFix":"# before\n[[systemDependencies]]\nbin = \"ffmpeg\"\ncommand = \"ffmpeg -version\"\n# after\n[[systemDependencies]]\nbin = \"ffmpeg\"","handlingStrategy":"validation","validationCode":"let set = [d.bin.is_some(), d.pkgconfig.is_some(), d.sharedlib.is_some(), d.command.is_some()];\nassert_eq!(set.iter().filter(|&&x| x).count(), 1, \"systemDependencies entry must set exactly one check kind\");","typeGuard":"fn exactly_one_check(d: &SystemDependency) -> bool {\n    [d.bin.is_some(), d.pkgconfig.is_some(), d.sharedlib.is_some(), d.command.is_some()]\n        .iter().filter(|&&x| x).count() == 1\n}","tryCatchPattern":null,"preventionTips":["Declare one check kind per systemDependencies entry; split alternatives into separate entries.","Lint plugin manifests for entries with zero or multiple check fields.","Prefer `bin` when a plain executable check suffices."],"tags":["vfox","schema-validation","system-dependencies","mutually-exclusive"],"backgroundTag":"mutually-exclusive-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"}