{"record":{"id":"05ce370698316364","repo":"jdx/mise","slug":"swiftpm-artifact-bundles-require-a-release-version","errorCode":null,"errorMessage":"SwiftPM artifact bundles require a release version; {display_version} selects a Git revision and must be built from source","messagePattern":"SwiftPM artifact bundles require a release version; (.+?) selects a Git revision and must be built from source","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/backend/spm.rs","lineNumber":650,"sourceCode":"        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}\n\n/// Restricts `executables` to those listed in `filter_bins`, preserving the\n/// original declaration order from `Package.swift` rather than the order in","sourceCodeStart":632,"sourceCodeEnd":668,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/backend/spm.rs#L632-L668","documentation":"Artifact bundles are only published for tagged release versions. should_try_artifactbundle rejects requests that resolve to a Git revision (branch, commit SHA, ref) when artifact bundles are required or mandated, because there is no release asset to download.","triggerScenarios":"install_version_ or git_revisions_skip_or_reject_artifact_bundles calls should_try_artifactbundle with a revision where revision.is_git_revision() is true and either opts.requires_artifactbundle(mode) or artifactbundle_only is true — e.g. pinning 'swiftlint@main' or a commit SHA while bundles-only is required.","commonSituations":"Pinning a tool to a git ref/branch/SHA in mise.toml while spm.artifactbundle_only is true; using ref:main style versions for a SwiftPM tool.","solutions":["Pin a release version/tag instead of a git revision","Allow source builds: set spm.artifactbundle_only = false and don't require artifactbundle","Set artifactbundle = false on that tool entry so it builds from source"],"exampleFix":"// before\n[tools.swiftlint]\nversion = 'ref:main'\n// after\n[tools.swiftlint]\nversion = '0.54.0'","handlingStrategy":"validation","validationCode":"// pin only release tags when bundles are mandated\ncase \"$MISE_TOOL_VERSION\" in ref:*|sha*|main|master|HEAD) echo \"git revision incompatible with artifactbundle_only\";; esac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use tagged releases for SwiftPM tools under bundles-only policy","If you need a git revision, explicitly set artifactbundle = false for that tool"],"tags":["swiftpm","git-revision","versioning"],"backgroundTag":"unsupported-operation","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"}