SwiftPM --disable-automatic-resolution fails on lock drift in CI
--disable-automatic-resolution tells SwiftPM to install exactly what Package.resolved pins and never update it. It is the reproducible CI mode, and it fails on purpose when the manifest and the lock disagree.
What this error means
A CI resolve with --disable-automatic-resolution (or xcodebuild -disableAutomaticPackageResolution) fails whenever a dependency change was not accompanied by a refreshed Package.resolved.
error: an out-of-date resolved file was detected at /Package.resolved, which is not allowed when automatic dependency resolution is disabledCommon causes
A manifest change without a matching resolved update
A dependency bump landed in Package.swift but Package.resolved was not regenerated, so the frozen resolve rejects the mismatch.
A dependency dropped a pinned revision
The pinned commit or tag no longer exists upstream, so the frozen pins cannot be satisfied as recorded.
How to fix it
Refresh the lock, then keep resolution frozen
- Run a normal
swift package resolveto update the pins. - Commit the refreshed
Package.resolved. - Keep
--disable-automatic-resolutionin CI to enforce reproducibility.
swift package resolve
git add Package.resolved
# CI keeps: swift build --disable-automatic-resolutionRe-pin when an upstream revision disappears
If a pinned commit was force-removed upstream, resolve to a current revision and commit the new pin.
swift package update <dependency>
git add Package.resolvedHow to prevent it
- Regenerate and commit
Package.resolvedwith every dependency change. - Keep
--disable-automatic-resolutionon in CI for deterministic builds. - Prefer tags over floating commits so pins stay resolvable.