What happened?
When all three of these conditions hold:
- A pure-Swift SPM package (no
.h headers, no @objc interop) is included as an external dependency.
- It’s promoted to
.framework via PackageSettings.productTypes (e.g. productTypes: ["Logging": .framework]).
- The build is constrained to a single architecture via the
ARCHS or EXCLUDED_ARCHS build setting (any variant: ARCHS = arm64, EXCLUDED_ARCHS = x86_64, EXCLUDED_ARCHS[sdk=iphonesimulator*] = x86_64, or excluding the other arch).
…then tuist cache <consumer-target> fails because Xcode auto-generates a module.modulemap for the SPM-promoted framework that references <Module>-Swift.h. Under Xcode 26’s tightened explicit-modules dependency scanner, the scan against that modulemap runs before Swift has emitted the bridging header, so Clang aborts with header not found.
Multi-arch builds happen to work — Xcode’s build-phase scheduling produces -Swift.h early enough that the dep scanner finds it. ONLY_ACTIVE_ARCH=YES also works (xcodebuild treats it differently for generic destinations). Only an explicit ARCHS=/EXCLUDED_ARCHS= triggers the failure.
Expected behavior: tuist cache should succeed regardless of arch settings. Pure-Swift SPM products promoted to .framework should have a modulemap that does not depend on a build-phase ordering quirk to be valid.
How do we reproduce it?
A standalone 4-file minimal project (no App target, no UI, no in-tree fixture modification needed).
Files
Zipped: tuist-cache-bug-repro.zip
Tuist.swift:
import ProjectDescription
let tuist = Tuist(project: .tuist())
Tuist/Package.swift:
// swift-tools-version: 5.9
@preconcurrency import PackageDescription
#if TUIST
import ProjectDescription
let packageSettings = PackageSettings(
// Promote the pure-Swift `Logging` SPM product to a dynamic framework.
productTypes: ["Logging": .framework],
// Single-arch simulator build — the bug trigger.
baseSettings: .settings(
base: ["EXCLUDED_ARCHS[sdk=iphonesimulator*]": "x86_64"]
)
)
#endif
let package = Package(
name: "Repro",
dependencies: [
.package(url: "https://github.com/apple/swift-log", from: "1.0.0"),
]
)
Project.swift:
import ProjectDescription
let project = Project(
name: "Repro",
targets: [
.target(
name: "Consumer",
destinations: .iOS,
product: .framework,
bundleId: "dev.tuist.Consumer",
sources: ["Sources/**"],
dependencies: [
.external(name: "Logging"),
]
),
]
)
Sources/Consumer.swift:
import Logging
public enum Consumer {
public static func makeLogger() -> Logger {
Logger(label: "dev.tuist.repro")
}
}
Commands
tuist install
tuist cache Consumer --configuration Debug
Error log
[2026-05-27T16:16:18Z] [debug] [Noora] Error alert: ✖ Error
- Message: The command '/usr/bin/xcrun xcodebuild build -scheme Binaries-Cache-iOS -workspace /private/tmp/tuist-cache-bug-repro/Repro.xcworkspace -destination generic/platform=iOS Simulator SKIP_INSTALL=NO DEBUG_INFORMATION_FORMAT=dwarf STRIP_INSTALLED_PRODUCT=YES SWIFT_SERIALIZE_DEBUGGING_OPTIONS=NO ONLY_ACTIVE_ARCH=NO CODE_SIGN_IDENTITY= CODE_SIGN_ENTITLEMENTS= CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO COMPILER_INDEX_STORE_ENABLE=NO -configuration Debug SYMROOT=/private/var/folders/mm/1g4_22v926g2_xv6cyd3l5tc0000gn/T/CacheWarm-BD458357-FC5E-4C13-A61F-44232EF8F223/derived-data/Build/Products -resultBundlePath /private/var/folders/mm/1g4_22v926g2_xv6cyd3l5tc0000gn/T/CacheWarm-BD458357-FC5E-4C13-A61F-44232EF8F223/derived-data/509B42B7-ADE0-4778-AAE8-DB24DE283CD6 -derivedDataPath /private/var/folders/mm/1g4_22v926g2_xv6cyd3l5tc0000gn/T/CacheWarm-BD458357-FC5E-4C13-A61F-44232EF8F223/derived-data' terminated with the code 65:
error: clang dependency scanning failure: /private/var/folders/mm/1g4_22v926g2_xv6cyd3l5tc0000gn/T/CacheWarm-BD458357-FC5E-4C13-A61F-44232EF8F223/derived-data/Build/Products/Debug-iphonesimulator/Logging.framework/Modules/module.modulemap:2:10: error: header 'Logging-Swift.h' not found
Logging-efdab6b4.input:1:1: fatal error: could not build module 'Logging'
/tmp/tuist-cache-bug-repro/Sources/Consumer.swift:1:8: error: unable to resolve module dependency: 'Logging'
import Logging
^
/tmp/tuist-cache-bug-repro/Sources/Consumer.swift:1:8: note: a dependency of main module 'Consumer'
import Logging
^
error: clang dependency scanning failure: /private/var/folders/mm/1g4_22v926g2_xv6cyd3l5tc0000gn/T/CacheWarm-BD458357-FC5E-4C13-A61F-44232EF8F223/derived-data/Build/Products/Debug-iphonesimulator/Logging.framework/Modules/module.modulemap:2:10: error: header 'Logging-Swift.h' not found
Logging-fa1b7f76.input:1:1: fatal error: could not build module 'Logging'
/tmp/tuist-cache-bug-repro/Sources/Consumer.swift:1:8: error: unable to resolve module dependency: 'Logging'
import Logging
^
/tmp/tuist-cache-bug-repro/Sources/Consumer.swift:1:8: note: a dependency of main module 'Consumer'
import Logging
^
** BUILD FAILED **
macOS version
15.5 (24F74)
Tuist version
4.195.7
Xcode version
26.5 (Build 17F42) locally. Also reproduces on Xcode 26.3 .