{"record":{"id":"242b217b7ea7ed5e","repo":"jdx/mise","slug":"install-command-cannot-be-used-with-filter-bins","errorCode":null,"errorMessage":"install_command cannot be used with filter_bins","messagePattern":"install_command cannot be used with filter_bins","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/backend/spm.rs","lineNumber":154,"sourceCode":"\n    fn install_command(&self) -> eyre::Result<Option<String>> {\n        let Some(value) = self.values.raw().opts.get(\"install_command\") else {\n            return Ok(None);\n        };\n        let Some(command) = value.as_str() else {\n            bail!(\"install_command must be a non-empty string\");\n        };\n        let command = command.trim();\n        if command.is_empty() {\n            bail!(\"install_command must be a non-empty string\");\n        }\n        Ok(Some(command.to_string()))\n    }\n\n    fn source_install_command(&self) -> eyre::Result<Option<String>> {\n        let command = self.install_command()?;\n        if command.is_some() && self.filter_bins().is_some() {\n            bail!(\"install_command cannot be used with filter_bins\");\n        }\n        Ok(command)\n    }\n}\n\n#[async_trait]\nimpl Backend for SPMBackend {\n    fn get_type(&self) -> BackendType {\n        BackendType::Spm\n    }\n\n    fn ba(&self) -> &Arc<BackendArg> {\n        &self.ba\n    }\n\n    fn get_dependencies(&self) -> eyre::Result<Vec<&str>> {\n        Ok(vec![\"swift\"])\n    }","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/backend/spm.rs#L136-L172","documentation":"The SPM backend treats 'install_command' (a fully custom source install command) and 'filter_bins' (selecting which binaries to expose) as mutually exclusive configuration strategies: a custom install command controls the whole build, so filtering its produced binaries via filter_bins is unsupported and rejected.","triggerScenarios":"source_install_command finds both install_command and filter_bins set in the same spm tool's options and bails instead of guessing which takes precedence.","commonSituations":"Incrementally editing tool options and leaving both keys present; combining example snippets from different configs; trying to trim a custom build's outputs with filter_bins.","solutions":["Remove either install_command or filter_bins from the tool's options","If using a custom install_command, drop filter_bins (or have the command itself place only the desired binaries)","If you only need binary filtering, drop the custom install_command and let the default build run"],"exampleFix":"# before\n[tools.\"spm:mypkg\"]\ninstall_command = \"swift build -c release\"\nfilter_bins = [\"mypkg\"]\n# after\n[tools.\"spm:mypkg\"]\ninstall_command = \"swift build -c release\"","handlingStrategy":"validation","validationCode":"# detect the conflict before running mise\nawk '/^\\[tools/{t=1} t&&/install_command/{a=1} t&&/filter_bins/{b=1} END{if(a&&b) print \"conflict: install_command + filter_bins\"}' mise.toml","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Choose one install strategy per tool: custom install_command OR filter_bins","Review a tool's whole options block after incremental edits","Move binary selection into the custom command itself when using install_command"],"tags":["spm","swift","config","conflicting-options"],"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"}