What happened?
A plain xcodebuild build of an app target that depends (directly or transitively) on swift-nio’s NIOPosix product fails while compiling NIOCore:
error: Unable to resolve module dependency: 'DequeModule' (in target 'NIOCore' from project 'swift-nio')
error: Unable to resolve module dependency: 'Atomics' (in target 'NIOCore' from project 'swift-nio')
DequeModule comes from swift-collections, Atomics from swift-atomics — both are resolved dependencies in the graph, and the generated project.pbxproj already lists DequeModule.framework/Atomics.framework as build-phase dependencies of the NIOCore target (confirmed by grepping the generated pbxproj for DequeModule.framework in Dependencies / Atomics.framework in Dependencies — 8 matching edges are present). The dependency graph edge exists in the generated project; the framework just isn’t available/built yet when NIOCore’s own compile step tries to import it.
This reproduces with a minimal app target — no App Extension, no custom build configurations, no PackageSettings overrides, nothing beyond a single app target depending on NIOPosix.
Originally found in a larger project (migrating from XcodeGen to Tuist) where the same error appeared through an internal package’s own dependency on swift-nio. Isolated down to just swift-nio + NIOPosix — see the minimal reproduction repo linked below.
Reproduction repository
https://github.com/o-nnerb/tuist-nio-dequemodule-repro
How do we reproduce it?
tuist install
tuist generate --no-open
xcodebuild build \
-project SampleApp.xcodeproj \
-scheme "SampleApp" \
-destination "generic/platform=iOS Simulator" \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO
Error log
/.../Tuist/.build/checkouts/swift-nio/Sources/NIOCore/AsyncChannel/AsyncChannelHandler.swift:15:8: error: Unable to resolve module dependency: 'DequeModule' (in target 'NIOCore' from project 'swift-nio')
note: A dependency of main module 'NIOCore'
.../Sources/NIOCore/AsyncSequences/NIOAsyncSequenceProducer.swift:15:8: note: Also imported here
.../Sources/NIOCore/AsyncSequences/NIOAsyncWriter.swift:16:8: note: Also imported here
.../Sources/NIOCore/AsyncSequences/NIOThrowingAsyncSequenceProducer.swift:15:8: note: Also imported here
/.../Tuist/.build/checkouts/swift-nio/Sources/NIOCore/AsyncSequences/NIOAsyncWriter.swift:15:8: error: Unable to resolve module dependency: 'Atomics' (in target 'NIOCore' from project 'swift-nio')
note: A dependency of main module 'NIOCore'
.../Sources/NIOCore/FileHandle.swift:15:8: note: Also imported here
error: Clang dependency scanning failure: (in target 'NIOCore' from project 'swift-nio')
macOS version
27.0 (Build 26A5421a)
Tuist version
4.205.0
Xcode version
27.0 (Build 27A5237l)