Triple

Build static Linux binaries on your Mac.
Use a Swift library, CLI, or native app.

Strips a copy of the executable and verifies it again. Resource bundles are preserved. Export the executable and resource bundles together. The destination must be new and its parent directory must exist.
import Foundation
import Triple

let result = try await Triple.build(
    URL(filePath: "./MyServer"),
    for: .linux(.arm64)
)

print(result.executable.path)

MyServer

Target
Linux ARM64
Build
Release
Linking
Static · Musl
Executable
Unstripped
Output
.build/

Includes required resource bundles.

Cross-compilation
in one line of Swift.

Add the package.

In Package.swift, add Triple to your dependencies, then add its library product to your target.

Source build. Use the pinned rebrand revision; earlier release tags use the previous module name.

Package dependency
.package(
    url: "https://github.com/mottzi/Triple.git",
    revision: "99c216dda112be33f7359d3fd5bf8d0334f20498"
)
Target dependency
.product(
    name: "Triple",
    package: "Triple"
)

Build your package.

Pass your package directory. Triple returns the verified executable and its resource bundles.

Swift
import Foundation
import Triple

let result = try await Triple.build(URL(filePath: "/path/to/MyServer"))

print(result.executable.path)

Triple builds your only executable for x86-64 Linux in release mode by default. It installs missing components and resolves dependencies.

Requirements and compatibility

On your Mac

Apple silicon, macOS 13+, and Xcode or Command Line Tools with Swift 6.3+. Run library callers outside the App Sandbox. With your approval, Triple can install Swiftly, a toolchain, and its matching Static Linux SDK.

In your package

Your executable and dependencies must support Linux Musl. Build only packages you trust. SwiftPM executes manifests and may run plugins with your permissions. Keep the executable and resource bundles together.

Verified output

Triple verifies ELF64 format, architecture, static linking, and required resources. It withholds the result if monitored sources change during compilation. Deploy the output with your own tools.

Resource bundles

Triple returns the resources linked to your executable, including those from dependencies. Both .resources and .bundle formats are supported.

Triple.
For your terminal.

Build Linux executables from your terminal. Use JSON output to automate builds in scripts and CI.

Pre-rebrand SwiftlyKitCLI 0.2.0 running in Ghostty, building and exporting HelloServer for x86-64 Linux with Swift 6.3.3. Verification succeeds, and the file command confirms a statically linked Linux executable.
Pre-rebrand capture. HelloServer built for x86-64 Linux, with its executable and resources exported together.

Install from source.

Terminal
git clone https://github.com/mottzi/TripleCLI.git
cd TripleCLI
./install.sh

Builds and installs triple in ~/.local/bin and adds it to your shell’s PATH if needed.

Build your package.

From your package directory
triple build . \
  --architecture aarch64 \
  --install-environment \
  --resolve-dependencies

The flags explicitly permit environment installation and dependency resolution.

Command reference

Package paths default to the current directory. Add --help to a command for its full options.

triple assess .
Inspect one environment without changing it. Use environments to list compatible choices.
triple products .
List executable products in a prepared environment. Select one with --product MyServer.
triple build . --json
Write one result or error to stdout and suppress progress. Use --verbose for live output instead.
--output-path ./dist/Server
Export the executable and resources to a directory. The parent must exist. Add --replace-output to replace an existing destination.

Triple.
Made for your Mac.

Build Linux executables with native macOS controls.

These captures show the previous name, SwiftlyKitApp. Updated Triple screenshots are pending.

Set your build.

Open your package. Choose an executable, Linux architecture, and Swift version.

Pre-rebrand SwiftlyKitApp ready to build Vapor-Deployer for x86-64 Linux in release mode with Swift 6.4.0 and binary stripping enabled.

Build. Then export.

Follow live output. Export the verified executable and its resources together.

Pre-rebrand SwiftlyKitApp after a successful Vapor-Deployer build for x86-64 Linux with Swift 6.4.0, showing stripping output, the success status, and the build files action.