Hive
fix(cli): bundle Swift runtime libraries
GitHub issue · Closed
What changed
The macOS CLI release bundler now runs swift-stdlib-tool against the shipped tuist executable and ProjectDescription.framework, copies any required Swift runtime libraries into build/vendor, and adds rpaths so dyld can resolve vendored libraries next to the executable.
The release script also signs any copied dylibs before signing tuist and ProjectDescription.framework, and includes vendor in the notarization bundle.
Why
Tuist 4.199.0 includes the SwifterPM revision that removes the raw SwiftPM library dependency, but the released macOS binary can still require Swift runtime compatibility libraries from the Xcode 26 toolchain. In particular, otool -L on the 4.199.0 binary still shows @rpath/libswiftCompatibilitySpan.dylib, and swift-stdlib-tool --print reports that the binary needs libswiftCompatibilitySpan.dylib.
On machines that already have /usr/lib/swift/libswiftCompatibilitySpan.dylib, the binary launches. On older CI images, dyld fails before main because the release artifact does not bundle that compatibility dylib.
Root cause
The release archive already includes vendor in tuist.zip, but the macOS release path never populated it with Swift runtime dylibs or added an rpath for it. With Xcode 26, parts of the statically linked CLI graph can autolink Swift span compatibility symbols, so the binary must either find those symbols in the host OS Swift runtime or in the release artifact.
Impact
This makes the macOS CLI artifact self-contained for Swift runtime compatibility dylibs required by the toolchain, which should unblock consumers running Tuist on CI images that do not yet have the Xcode 26 Swift runtime shim installed system-wide.
Validation
bash -n mise/tasks/cli/bundle.shgit diff --check- Installed released
tuist@4.199.0with mise and verifiedtuist versionprints4.199.0 - Confirmed
otool -Lon 4.199.0 still lists@rpath/libswiftCompatibilitySpan.dylib - Confirmed
xcrun swift-stdlib-tool --print --scan-executable ... --platform macosxreportslibswiftCompatibilitySpan.dylib - Replayed the copy and rpath flow against the installed 4.199.0 artifact in
/private/tmp - Confirmed the replayed artifact contains
vendor/libswiftCompatibilitySpan.dylib - Confirmed
tuisthas@executable_path/vendorin its rpaths after the replay - After ad-hoc signing the replayed temp artifact, confirmed
/private/tmp/.../tuist versionprints4.199.0