jdx/mise · error

swift does not publish {url}: {err}

Error message

swift does not publish {url}: {err}

What it means

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.

Source

Thrown at src/plugins/core/swift.rs:254

    async fn resolve_lock_info(
        &self,
        tv: &ToolVersion,
        target: &PlatformTarget,
    ) -> Result<PlatformInfo> {
        // Every published Linux build links against glibc, so there is nothing
        // to lock for a musl target. Fail instead of recording a URL that
        // doesn't exist, so `mise lock` reports it as skipped.
        if target.libc() == Some("musl") {
            bail!("swift does not publish musl builds");
        }
        let url = url(tv, target);
        // Not every distro/arch pair is published — `ubi9` has no aarch64 build,
        // for instance — and which pairs exist changes per release, so ask rather
        // than encode a matrix that would go stale. This keeps a lockfile from
        // recording an artifact that isn't there.
        if let Err(err) = HTTP.head(&url).await {
            bail!("swift does not publish {url}: {err}");
        }
        // swift.org publishes no checksum sidecar (only a detached GPG
        // signature), so a checksum can't be resolved without downloading the
        // whole ~1GB toolchain. Record the URL the entry describes; the checksum
        // is filled in when the tool is installed.
        Ok(PlatformInfo {
            url: Some(url),
            ..Default::default()
        })
    }

    async fn security_info(&self) -> Vec<crate::backend::SecurityFeature> {
        use crate::backend::SecurityFeature;

        let mut features = vec![SecurityFeature::Checksum {
            algorithm: Some("sha256".to_string()),
        }];

View on GitHub (pinned to 6f52dcdf99)

Solutions

  1. 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)
  2. Retry once after a transient network failure — the HEAD is not retried internally
  3. If a proxy blocks HEAD, allow swift.org download hosts (download.swift.org, swift.org) or run lock from an unrestricted network
  4. Update swift to a version whose asset matrix includes your distro/arch, then re-run `mise lock`

Example fix

# before
$ mise lock
Error: 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

# after
$ curl -I <that-url>          # confirm 404
# switch mise.toml to a published flavor, e.g. ubuntu24.04 on aarch64
$ mise lock
Defensive patterns

Strategy: retry

Validate before calling

# pre-flight the exact artifact URL before locking:
curl -fsSI "$SWIFT_URL" >/dev/null && mise lock || echo "swift pair not published for this distro/arch"

Try / catch

# retry once on transient network failure, hard-fail on 404
out=$(mise lock 2>&1) || out2=$(mise lock 2>&1) || { echo "$out2"; echo "$out2" | grep -q 404 && exit 1; }

Prevention

When it happens

Trigger: `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.

Common situations: 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.

Related errors


AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22). Data as JSON: /api/errors/7f5651adc4f255fe. Report an issue: GitHub.