{"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/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/plugins/core/swift.rs#L236-L272","documentation":"While resolving lockfile info for the core swift plugin, mise performs an HTTP HEAD request against the swift.org download URL for the requested release/platform pair. If that request fails (typically a 404), it means Swift does not publish a toolchain artifact for that URL, so mise refuses to record it in the lockfile. This prevents lockfiles from pinning artifacts that can never be downloaded.","triggerScenarios":"Calling `mise use swift@<version>` or resolving swift lockfile info for a (version, target) combination whose download URL does not exist — e.g. a distro/arch pair like ubi9/aarch64 for a release that has no such build, or a mistyped version. The bail fires when HTTP.head(&url) returns Err.","commonSituations":"Requesting a Swift release on a platform/arch combo that upstream never published; a release whose published platform matrix changed (older or newer releases drop/add pairs); a transient network failure or proxy blocking swift.org HEAD requests; an invalid version string producing a malformed URL.","solutions":["Pick a Swift version that is published for your platform/arch — check https://swift.org/download for the release's platform matrix.","Verify network access to swift.org (curl -I the URL); retry if it was a transient failure or proxy issue.","Choose a different distribution/arch pair supported by that release, or use a container/OS image Swift does publish builds for."],"exampleFix":"// before\nmise use swift@6.0.1  # on ubi9/aarch64 which has no published build\n// after\nmise use swift@6.0.2  # release that publishes ubi9 aarch64 toolchains","handlingStrategy":"validation","validationCode":"let url = format!(\"https://swift.org/builds/swift-6.0.1-release/ubuntu2204/swift-6.0.1-RELEASE/swift-6.0.1-ubuntu22.04.tar.gz\");\nlet status = reqwest::Client::new().head(&url).send().await?.status();\nif !status.is_success() {\n    eprintln!(\"swift {version} not published for this platform ({status}); pick another version/arch\");\n}","typeGuard":null,"tryCatchPattern":"match resolve_lock_info(version, target) {\n    Err(e) if e.to_string().contains(\"does not publish\") => choose_published_version(),\n    Err(e) => return Err(e),\n    Ok(info) => info,\n}","preventionTips":["Check the swift.org release platform matrix before pinning a version for an uncommon distro/arch pair.","Prefer releases known to publish builds for your target OS/arch.","Pin swift versions in CI on the same platform you deploy on."],"tags":["network","http","swift","lockfile","platform-support"],"backgroundTag":"http-request-failed","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}