{"record":{"id":"18dde676d779f798","repo":"jdx/mise","slug":"artifactbundle-false-conflicts-with-spm-artifact","errorCode":null,"errorMessage":"artifactbundle = false conflicts with spm.artifactbundle_only","messagePattern":"artifactbundle = false conflicts with spm\\.artifactbundle_only","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/backend/spm.rs","lineNumber":647,"sourceCode":"\nfn package_revision(tv: &ToolVersion) -> Option<PackageRevision> {\n    match &tv.request {\n        ToolRequest::Ref { ref_, ref_type, .. } if matches!(ref_type.as_str(), \"ref\" | \"rev\") => {\n            Some(PackageRevision::Git(ref_.clone()))\n        }\n        _ => None,\n    }\n}\n\nfn should_try_artifactbundle(\n    revision: &PackageRevision,\n    opts: &SpmOptions<'_>,\n    mode: ArtifactBundleMode,\n    artifactbundle_only: bool,\n    display_version: &str,\n) -> eyre::Result<bool> {\n    if mode == ArtifactBundleMode::SourceOnly && artifactbundle_only {\n        bail!(\"artifactbundle = false conflicts with spm.artifactbundle_only\");\n    }\n    if revision.is_git_revision() && (opts.requires_artifactbundle(mode) || artifactbundle_only) {\n        bail!(\n            \"SwiftPM artifact bundles require a release version; {display_version} selects a Git revision and must be built from source\"\n        );\n    }\n    Ok(!revision.is_git_revision() && mode != ArtifactBundleMode::SourceOnly)\n}\n\nfn with_install_env(mut command: Expression, tv: &ToolVersion) -> Expression {\n    for (key, value) in tv.install_env() {\n        command = match value.into_string() {\n            Some(value) => command.env(key, value),\n            None => command.env_remove(key),\n        };\n    }\n    command\n}","sourceCodeStart":629,"sourceCodeEnd":665,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/backend/spm.rs#L629-L665","documentation":"should_try_artifactbundle validates option combinations: if a tool entry sets artifactbundle = false (source-only) while the global setting spm.artifactbundle_only is true, the requirements are contradictory and mise refuses to guess.","triggerScenarios":"Calling should_try_artifactbundle with ArtifactBundleMode::SourceOnly while artifactbundle_only is true — i.e. a mise tool config with [tool].artifactbundle = false for a SwiftPM tool plus settings spm.artifactbundle_only = true.","commonSituations":"A project's mise.toml disables artifact bundles for one tool while a global/company setting mandates artifact bundles for all SwiftPM tools.","solutions":["Remove artifactbundle = false from the tool entry, or","Set spm.artifactbundle_only = false so the per-tool override wins","Pick one policy: either bundles-only globally or per-tool opt-outs"],"exampleFix":"// before (mise.toml)\n[tools.swiftlint]\nversion = '0.54.0'\nartifactbundle = false\n# plus settings: spm.artifactbundle_only = true\n// after\n[tools.swiftlint]\nversion = '0.54.0'\n# artifactbundle = false removed; obey global bundles-only policy","handlingStrategy":"validation","validationCode":"// search configs for conflicting settings\nmise settings get spm.artifactbundle_only\ngrep -n 'artifactbundle' mise.toml .config/mise.toml 2>/dev/null","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Decide bundle policy at one level (global OR per-tool), not both","Audit shared settings files when adding per-tool artifactbundle overrides"],"tags":["swiftpm","config-conflict","validation"],"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"}