Hive Hive
Sign in

xcodebuild archive ignores build settings for SPM-resolved dependency targets

GitHub issue · Open

Metadata
Source
tuist/tuist #10102
Updated
Jun 16, 2026
Domains
Generated projects
Details

Description

When archiving a Tuist-generated workspace that resolves dependencies through SPM (Package.swift), build settings passed via the command line or xcconfig files are silently ignored for SPM dependency targets. Only the primary scheme target receives the settings.

Environment

  • Tuist 4.162.1
  • Xcode 26.2 / Swift 6.2.4
  • RevenueCat purchases-ios 5.66.0 (source SPM dependency)
  • iOS 26+ deployment target

Steps to reproduce

  1. Declare a source SPM dependency in Tuist/Package.swift (e.g., RevenueCat)
  2. Generate the workspace with tuist generate --no-open
  3. Attempt to archive with build settings that should apply to all targets:
xcodebuild archive \
-workspace moode.xcworkspace \
-scheme moode \
OTHER_SWIFT_FLAGS="-Xfrontend -no-verify-emitted-module-interface" \
SWIFT_VALIDATE_EMITTED_MODULE_INTERFACE=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES

Expected behavior

OTHER_SWIFT_FLAGS and SWIFT_VALIDATE_EMITTED_MODULE_INTERFACE=NO should propagate to all targets in the build graph, including SPM-resolved dependencies.

Actual behavior

The flags apply only to the primary scheme target. SPM dependency targets (e.g., RevenueCat) still run swiftinterface verification and fail. Passing the same flags via -xcconfig or adding .unsafeFlags() to Package.swift swiftSettings also had no effect.

Impact

This blocks vendoring SPM dependencies as XCFrameworks with BUILD_LIBRARY_FOR_DISTRIBUTION=YES, since dependency targets fail swiftinterface verification that can’t be suppressed.

Workaround

Use the dependency as a regular source SPM dependency without BUILD_LIBRARY_FOR_DISTRIBUTION. This avoids the swiftinterface verification path entirely.

Notes

This may ultimately be an xcodebuild limitation rather than a Tuist issue — SPM’s build system appears to resolve dependency target settings independently of workspace-level settings. Filing here because Tuist generates the workspace and may have a way to influence how SPM dependency build settings are configured at generation time.

Comments
L
linear[bot] Mar 28, 2026
D
dosubot[bot] Mar 28, 2026

This is a known limitation with how Tuist handles SPM dependency build settings. Build settings passed via command line or xcconfig files are not propagated to SPM dependency targets—they’re generated as separate Xcode projects with isolated settings.

The solution is to configure SPM dependency build settings through PackageSettings in your Tuist/Package.swift:

#if TUIST
import struct ProjectDescription.PackageSettings
let packageSettings = PackageSettings(
baseSettings: .settings(
configurations: [
.debug(name: "Debug"),
.release(name: "Release")
],
settings: [
"BUILD_LIBRARY_FOR_DISTRIBUTION": "YES",
"SWIFT_VALIDATE_EMITTED_MODULE_INTERFACE": "NO",
"OTHER_SWIFT_FLAGS": "$(inherited) -Xfrontend -no-verify-emitted-module-interface"
]
)
)
#endif

Then regenerate with tuist generate. This applies those settings at generation time to all SPM dependency targets.

This was confirmed as the official approach by the maintainers. Related issues: #7437, #9044.

If you run into further issues with this approach, I’d recommend posting to the community forum in the Help category for a deeper discussion.

To reply, just mention @dosu.


Share context across your team and agents. Try Dosu.

Leave Feedback Learn about tuist with Dosu Add Dosu to your team