spmx

Introduction

What spmx is, what it changes in your worktree workflow, and where to start.

spmx is a macOS command-line tool that keeps one global store of Swift Package Manager checkouts, binary artifacts and macro prebuilts, and clones it into each Git worktree with APFS copy-on-write.

One global store cloned into many worktreesThe global store at ~/.spmx/store holds checkouts, artifacts and prebuilts once. The clonefile system call clones them into the SourcePackages folder of each Git worktree, sharing disk blocks until a file is modified.~/.spmx/storecheckouts/<identity>-<revision>artifacts/<identity>/<target>prebuilts/<toolchain>/<package>clonefile()worktree-a SourcePackages/checkouts · artifacts · prebuiltsworktree-b SourcePackages/checkouts · artifacts · prebuiltsworktree-c SourcePackages/checkouts · artifacts · prebuilts
Diagram: the global store is cloned into every worktree with APFS copy-on-write.

Why it exists

Xcode derives the DerivedData folder name from a hash of the workspace path, so every new worktree starts with an empty SourcePackages. Each one downloads its own copy of the same dependencies.

spmx removes that cost. A package is downloaded once, stored under ~/.spmx/store, and cloned into any worktree that needs it. Clones share disk blocks until a file is modified.

Start here

Maintained by LuisRibeirooLast updated Edit this page on GitHub