swiftlang/swift-package-manager

SwiftPM should only build direct dependencies of a test target as @testable

rauhul opened this issue · 1 comments

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

Given graph A -> B -> BTests. BTests should not be able to testable import A. See the attached repro project. repro.zip

The issue with the current behavior is the following graph causes a huge amount of code to be rebuilt with no value: swift-syntax -> MMIOMacros -> MMIOMacrosTests

I suspect making a chance here would break some existing workflows, so we should proceed with caution.