{"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":"validation","errorClass":"eyre::Report","httpStatus":null,"severity":"warning","filePath":"src/system/deps.rs","lineNumber":197,"sourceCode":"pub 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":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/system/deps.rs#L179-L215","documentation":"A vfox plugin's PLUGIN.systemDependencies entries describe host prerequisites as capability checks. Each entry must set exactly one of bin (PATH executable), pkgconfig (.pc module), sharedlib (soname), or command (exit-0 shell command). Setting none or more than one fails this conversion; mise then warns and skips the bad entry while keeping the rest of the plugin usable, so this is surfaced as a warning, not a fatal error.","triggerScenarios":"A plugin's Lua PLUGIN table contains an empty dependency table {}, or combines checks like { bin = \"gcc\", pkgconfig = \"libxml-2.0\" }, in the systemDependencies list.","commonSituations":"Plugin authors writing new systemDependencies metadata; assuming more fields means OR/AND semantics; copy-pasting an entry and forgetting to delete the other kind fields.","solutions":["Keep exactly one check field per entry — split combined checks into multiple entries","Use bin for executables, pkgconfig for compiled-library modules, sharedlib for sonames, command as the compound escape hatch","Reload plugin metadata (`mise plugins install --force` or re-resolve) after fixing the Lua table"],"exampleFix":"-- before (plugin .lua PLUGIN table)\nsystemDependencies = {\n  { bin = \"gcc\", pkgconfig = \"libxml-2.0\" },\n}\n\n-- after\nsystemDependencies = {\n  { bin = \"gcc\" },\n  { pkgconfig = \"libxml-2.0\" },\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"-- in plugin tests / CI: validate each entry before shipping\nfor _, dep in ipairs(PLUGIN.systemDependencies or {}) do\n  local n = (dep.bin and 1 or 0) + (dep.pkgconfig and 1 or 0)\n            + (dep.sharedlib and 1 or 0) + (dep.command and 1 or 0)\n  assert(n == 1, 'systemDependencies entry must set exactly one of bin/pkgconfig/sharedlib/command')\nend","tryCatchPattern":null,"preventionTips":["One capability per systemDependencies entry; split stacks into several entries","Use the command escape hatch for anything not expressible as bin/pkgconfig/sharedlib","Test plugin metadata load with `mise registry generate`/plugin test after editing"],"tags":["vfox","plugin","system-dependencies","validation"],"backgroundTag":"exactly-one-field-required","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}