Skip to content
Latchkey

SwiftPM "the package manifest at '/Package.swift' cannot be accessed" in CI

SwiftPM looks for Package.swift in the current working directory and could not read one there. The manifest is missing, the step ran from the wrong directory, or the checkout did not fetch it.

What this error means

swift build or swift test fails immediately with "error: the package manifest at '/Package.swift' cannot be accessed" before any compilation begins.

swift
error: the package manifest at '/Package.swift' cannot be accessed (/Package.swift doesn't exist in file system)

Common causes

The step runs from the wrong working directory

The package lives in a subfolder (for example ios/ or Sources/App), but the job invoked swift build from the repository root where no Package.swift exists.

A shallow or sparse checkout omitted the manifest

A custom checkout that filtered paths, or a submodule that was not initialized, left the directory without its Package.swift.

How to fix it

Run the build from the package directory

  1. Confirm where Package.swift lives in the repo.
  2. Set the step working-directory, or pass --package-path to swift.
  3. Re-run so SwiftPM reads the manifest from the right place.
.github/workflows/ci.yml
- name: Build
  working-directory: ios
  run: swift build

# or without changing directory:
# swift build --package-path ios

Check out the full tree including submodules

Ensure the manifest is actually present on the runner before building.

.github/workflows/ci.yml
- uses: actions/checkout@v4
  with:
    submodules: recursive

How to prevent it

  • Set working-directory explicitly for packages that are not at the repo root.
  • Use --package-path in scripts so the manifest location is unambiguous.
  • Initialize submodules in checkout when the package depends on them.

Related guides

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