`swift run --repl` fails to properly load dependencies
#10,307 opened on Jul 16, 2026
Repository metrics
- Stars
- (10,145 stars)
- PR merge metrics
- (Avg merge 9d 4h) (62 merged PRs in 30d)
Description
Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?
- Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands,
swift build,swift test,swift packageetc.
Description
This is a re-write of https://github.com/swiftlang/swift/issues/90687, because I’ve been told the package manager is a better location for the bug.
Setup:
A package that has a target (e.g. Dest) depending on non-Swift target(s) (e.g. Dep1 and Dep2, tested with C, ObjC), and whose target(s) do not contain a module.modulemap.
Issue:
Running swift run --repl gives a REPL in which Dest cannot be imported (we get a “missing required module” error, for the modules Dep1 and Dep2, other dependencies work fine).
Expected behavior
The import should work.
Actual behavior
We get the error missing required modules: 'CMacroExports', 'CNSTaskHelptender'.
Steps to reproduce
- git clone https://github.com/xcode-actions/swift-process-invocation.git
- cd swift-process-invocation
- swift run --repl
- Once in the REPL (if you can get there; there is another issue that can prevent getting there, but relaunching should do the trick), try to
import ProcessInvocation.
Swift Package Manager version/commit hash
Swift Package Manager - Swift 6.4.0-dev (Xcode 27.0 beta 3 (27A5218g))
Swift & OS version (output of swift --version ; uname -a)
swift-driver version: 1.168.4 Apple Swift version 6.4 (swiftlang-6.4.0.25.4 clang-2100.3.25.1) Target: arm64-apple-macosx27.0.0 Darwin Frizlabs-MacBook-Pro-Beta-Mojo.local 27.0.0 Darwin Kernel Version 27.0.0: Mon Jun 29 21:26:19 PDT 2026; root:xnu-13432.0.50.501.3~1/RELEASE_ARM64_T6031 arm64