{"record":{"id":"7f5651adc4f255fe","repo":"jdx/mise","slug":"swift-does-not-publish-url-err","errorCode":null,"errorMessage":"swift does not publish {url}: {err}","messagePattern":"swift does not publish (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/plugins/core/swift.rs","lineNumber":254,"sourceCode":"\n    async fn resolve_lock_info(\n        &self,\n        tv: &ToolVersion,\n        target: &PlatformTarget,\n    ) -> Result<PlatformInfo> {\n        // Every published Linux build links against glibc, so there is nothing\n        // to lock for a musl target. Fail instead of recording a URL that\n        // doesn't exist, so `mise lock` reports it as skipped.\n        if target.libc() == Some(\"musl\") {\n            bail!(\"swift does not publish musl builds\");\n        }\n        let url = url(tv, target);\n        // Not every distro/arch pair is published — `ubi9` has no aarch64 build,\n        // for instance — and which pairs exist changes per release, so ask rather\n        // than encode a matrix that would go stale. This keeps a lockfile from\n        // recording an artifact that isn't there.\n        if let Err(err) = HTTP.head(&url).await {\n            bail!(\"swift does not publish {url}: {err}\");\n        }\n        // swift.org publishes no checksum sidecar (only a detached GPG\n        // signature), so a checksum can't be resolved without downloading the\n        // whole ~1GB toolchain. Record the URL the entry describes; the checksum\n        // is filled in when the tool is installed.\n        Ok(PlatformInfo {\n            url: Some(url),\n            ..Default::default()\n        })\n    }\n\n    async fn security_info(&self) -> Vec<crate::backend::SecurityFeature> {\n        use crate::backend::SecurityFeature;\n\n        let mut features = vec![SecurityFeature::Checksum {\n            algorithm: Some(\"sha256\".to_string()),\n        }];\n","sourceCodeStart":236,"sourceCodeEnd":272,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/plugins/core/swift.rs#L236-L272","documentation":"After ruling out musl, swift's resolve_lock_info does an HTTP HEAD against the computed swift.org tarball URL to confirm the distro/arch pair is actually published — the matrix changes per release (ubi9 has no aarch64 build, for instance) and mise prefers asking over encoding a stale matrix. A failed HEAD (404, DNS, proxy rejection) bails with the URL and the underlying error so the lockfile never records an artifact that isn't there.","triggerScenarios":"`mise lock` for swift where the (distro, arch, version) triple has no tarball — e.g. ubuntu2404/aarch64 combos that release skipped — or the HEAD couldn't complete: 403/404 from a mirror, proxy MITM block, offline machine, transient 5xx.","commonSituations":"Cross-arch lock generation (arm64 CI locking for a distro that only ships x86_64); new swift releases that dropped an old ubuntu flavor while the mise.toml still pins that flavor; corporate proxies that answer HEAD with 403; flaky networks mid-lock.","solutions":["Open/curl the URL from the message: if it 404s, the pair isn't published — pick a supported distro flavor or arch (check the release page for that swift version)","Retry once after a transient network failure — the HEAD is not retried internally","If a proxy blocks HEAD, allow swift.org download hosts (download.swift.org, swift.org) or run lock from an unrestricted network","Update swift to a version whose asset matrix includes your distro/arch, then re-run `mise lock`"],"exampleFix":"# before\n$ mise lock\nError: swift does not publish https://download.swift.org/swift-6.0.3-release/ubi9/swift-6.0.3-RELEASE/swift-6.0.3-RELEASE-ubi9-aarch64.tar.gz: HTTP 404\n\n# after\n$ curl -I <that-url>          # confirm 404\n# switch mise.toml to a published flavor, e.g. ubuntu24.04 on aarch64\n$ mise lock","handlingStrategy":"retry","validationCode":"# pre-flight the exact artifact URL before locking:\ncurl -fsSI \"$SWIFT_URL\" >/dev/null && mise lock || echo \"swift pair not published for this distro/arch\"","typeGuard":null,"tryCatchPattern":"# retry once on transient network failure, hard-fail on 404\nout=$(mise lock 2>&1) || out2=$(mise lock 2>&1) || { echo \"$out2\"; echo \"$out2\" | grep -q 404 && exit 1; }","preventionTips":["Pin distro flavors with broad asset coverage (ubuntu22.04/24.04) over niche ones like ubi9","Verify distro/arch pairs per release before adding swift to cross-platform lockfiles","Allow download.swift.org through proxies; HEAD requests are how availability is checked"],"tags":["swift","lockfile","http-404","artifact-matrix","network"],"backgroundTag":"artifact-not-published-for-platform","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}