Skip to content
Latchkey

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.

swift
error: an out-of-date resolved file was detected at /Package.resolved, which is not allowed when automatic dependency resolution is disabled

Common 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

  1. Run a normal swift package resolve to update the pins.
  2. Commit the refreshed Package.resolved.
  3. Keep --disable-automatic-resolution in CI to enforce reproducibility.
Terminal
swift package resolve
git add Package.resolved
# CI keeps: swift build --disable-automatic-resolution

Re-pin when an upstream revision disappears

If a pinned commit was force-removed upstream, resolve to a current revision and commit the new pin.

Terminal
swift package update <dependency>
git add Package.resolved

How to prevent it

  • Regenerate and commit Package.resolved with every dependency change.
  • Keep --disable-automatic-resolution on in CI for deterministic builds.
  • Prefer tags over floating commits so pins stay resolvable.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →