swiftlang/swift-package-manager

`swift run --repl` fails to properly load dependencies

Open

#10,307 opened on Jul 16, 2026

View on GitHub
 (4 comments) (0 reactions) (0 assignees)Swift (1,462 forks)batch import
buggood first issue

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 package etc.

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

  1. git clone https://github.com/xcode-actions/swift-process-invocation.git
  2. cd swift-process-invocation
  3. swift run --repl
  4. 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

Contributor guide