Skip to content

new(swiftlang.org/swiftly): Apple-official Swift toolchain version manager#13126

Open
tannevaled wants to merge 2 commits into
pkgxdev:mainfrom
tannevaled:new/swiftly
Open

new(swiftlang.org/swiftly): Apple-official Swift toolchain version manager#13126
tannevaled wants to merge 2 commits into
pkgxdev:mainfrom
tannevaled:new/swiftly

Conversation

@tannevaled
Copy link
Copy Markdown
Contributor

Summary

Adds `swiftly` — Apple's official Swift toolchain version manager (analog of `rustup` for Rust, `zigup` for Zig). Pure Swift, built from source via Swift Package Manager against pantry's existing `swift.org` toolchain.

Why

  • Apple-blessed Swift version manager (https://github.com/swiftlang/swiftly)
  • Complements (does not replace) pantry's existing `github.com/kylef/swiftenv` — that one is shell-based and third-party; swiftly is the Apple-official direction going forward.
  • Demonstrates a useful pattern: even though `swift.org` itself is vendored (full toolchain from-source build is infeasible on GHA free runners — 30-60GB RAM at link), downstream Swift tools CAN be source-built against the vendored toolchain.

Build approach

`swift build --configuration release` via SPM. SPM fetches the swift-* package deps (swift-argument-parser, async-http-client, swift-nio, etc.) over the network — pkgx build sandbox allows this. Same model as the merged `crates.io/*` recipes (cargo fetches) and `go.dev` projects (go mod fetches).

Platforms

Darwin only (x86-64 + aarch64), matching pantry's `swift.org` constraint. Linux is gated behind a future Ubuntu-22.04-class CI runner (already noted as a TODO in `projects/swift.org/package.yml`).

Test plan

  • CI boundary-check + plan
  • 2 bottle builds (darwin x86-64 + aarch64)
  • Test step: `swiftly --version | grep "1.1.1"` + `swiftly --help`

🤖 Generated with Claude Code

…uild)

Apple-official Swift version manager (analog of rustup for Rust,
zigup for Zig). Pure Swift, built from source via SwiftPM against
pantry's existing swift.org compiler. Complements (does not replace)
the older github.com/kylef/swiftenv already in pantry.

Darwin-only while pantry's swift.org is darwin-only (Linux requires
Ubuntu 22.04-class CI not currently available).

Upstream uses two tag schemes (numeric vs `swiftly-install-*`); the
older installer-script tags are ignored via `versions.ignore`.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The first iteration's test was:

  swiftly --version 2>&1 | grep -q "1.1.1"

This exited non-zero (job 78734773657, fail at 5min 15s). swiftly's
`--version` apparently doesn't print the expected version string at
first run — most likely because swiftly's first-run initialization
sequence interferes when no toolchain has been selected (and the
build sandbox has none).

`--help` is always safe: swift-argument-parser handles `--help` purely
in argv-parsing before any state init. It confirms the binary loads
and resolves its dynamic libs, which is the core thing the audit
needs to verify.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant