Skip to content

fix(ci): xcodebuild -resolvePackageDependencies after tuist generate (#96) - #98

Merged
wei18 merged 1 commit into
mainfrom
fix/ci-package-resolve-2
May 22, 2026
Merged

wei18 merged 1 commit into
mainfrom
fix/ci-package-resolve-2

Conversation

@wei18

@wei18 wei18 commented May 22, 2026

Copy link
Copy Markdown
Owner

Closes #96. Adds explicit xcodebuild -resolvePackageDependencies with -onlyUsePackageVersionsFromResolvedFile NO after tuist generate, so AdMob/UMP SDKs can fetch on the first build (Tuist disables automatic resolution; workspace Package.resolved is gitignored).

bash -n OK.

§未決 (deferred):

  • Cache SourcePackages/ between builds (likely already retained within workflow)
  • Commit Package.resolved (workspace regenerated each run; defer until reproducibility incident)

…96)

Fixes #96. Build #9 failed:
  xcodebuild: error: Could not resolve package dependencies:
    a resolved file is required when automatic dependency resolution is disabled
    Running resolver because: 'swift-package-manager-google-mobile-ads' was added

Tuist disables automatic resolution; workspace has no Package.resolved
(generated, gitignored). Run explicit xcodebuild -resolvePackageDependencies
with -onlyUsePackageVersionsFromResolvedFile NO to allow first-fetch.

bash -n OK.

Closes #96.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@wei18
wei18 merged commit 1211058 into main May 22, 2026
@wei18
wei18 deleted the fix/ci-package-resolve-2 branch May 22, 2026 13:25
wei18 added a commit that referenced this pull request May 22, 2026
Build #10 (after PR #98) failed:
  Could not resolve package dependencies:
    Running resolver because: 'swift-snapshot-testing' was added

PR #98's -scheme Sudoku limited resolve to app-target deps; snapshot-
testing is a SudokuKit test-target dep. Drop -scheme for workspace-wide
resolve.

bash -n OK. Closes #99.

Co-authored-by: Claude Opus 4.7 <[email protected]>
wei18 added a commit that referenced this pull request May 23, 2026
…105)

Per Tuist 4 design (post #6823, Oct 2024): when a project's external
SwiftPM deps live transitively inside local Package.swift packages
(our case — AdMob/UMP/snapshot-testing all pulled via Packages/
SudokuKit/ + Packages/AppMonetizationKit/), Tuist generates the
canonical .package.resolved file at the **project root** and
symlinks Sudoku.xcworkspace/xcshareddata/swiftpm/Package.resolved
→ /<repo>/.package.resolved.

The file is intentionally NOT gitignored — commit it so Xcode
Cloud's xcodebuild finds the resolved file via the symlink (which
Tuist regenerates on every `tuist generate`).

This is the proper Tuist 4 fix for #104, NOT a ci_post_clone.sh
patch. Previous PRs #98/#100 added explicit `xcodebuild
-resolvePackageDependencies` in block 3.3 as a fallback — kept as
safety net for fresh-checkout edge cases but no longer the primary
mechanism.

Closes #104. Investigation:
- tuist install help: no SwiftPM resolve when no Tuist/Package.swift
- tuist generate flags: no skip-resolution option
- Tuist PR #6823: bug fix that landed Oct 2024 — generates root
  .package.resolved for transitive-only-remote-dep projects
- Local verification: tuist generate creates symlink correctly

Co-authored-by: Claude Opus 4.7 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ci): Xcode Cloud — xcodebuild fails to resolve SwiftPM packages (no committed Package.resolved at workspace)

1 participant