jdx/mise · error

swift does not publish musl builds

Error message

swift does not publish musl builds

What it means

When resolving lockfile info for a Swift toolchain on a target platform, mise refuses musl libc targets up front: swift.org publishes no musl-linked Linux builds, so there is no artifact URL to lock. Failing here lets `mise lock` report the target as skipped instead of writing a dead URL into the lockfile.

Solutions

  1. Generate the Swift lockfile only for glibc (gnu) Linux targets and macOS/Windows targets
  2. Use a glibc-based distribution (Debian, Ubuntu, Fedora) for Linux Swift builds
  3. If you need musl-linked Swift, use an alternative distribution channel (e.g. unofficial musl Swift builds) outside mise's swift core plugin

Example fix

// before: locking for a musl target
mise lock swift@6.0 --platform linux-musl
// after: lock glibc targets only
mise lock swift@6.0 --platform linux-gnu
Defensive patterns

Strategy: validation

Validate before calling

function isMuslTarget(t) { return /musl/.test(t); }
if (isMuslTarget(targetTriple)) throw new Error('Skip swift lock generation for musl targets');

Prevention

When it happens

Trigger: Running `mise lock swift` (or any lock/resolve path hitting resolve_lock_info) with a platform target whose libc is musl — e.g. generating lock entries for a musl-based container or Alpine-style target.

Common situations: CI generating lockfiles for multiple targets including musl; a mise.toml/lock workflow targeting Alpine; users assuming swift.org ships musl builds because other languages do.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/ca4cc6d73b771178. Report an issue: GitHub.

Appendix: source

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

    /// A lock entry without a `swift_platform` option was written before the
    /// distro was recorded, so which artifact its checksum describes is
    /// unknowable. Such entries still pin the version; their checksum and URL
    /// are ignored and rewritten for this host's distro on install.
    fn lockfile_options_are_host_specific(&self) -> bool {
        true
    }

    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, &resolve_platform(tv, target).await?);
        // Which distros are published changes from release to release —
        // `debian12` first appears in 5.10, `ubuntu20.04` is gone by 6.3 — 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()
        })
    }

View on GitHub (pinned to 533346cc37)