# Error: Target SwiftWarningControl imports another target (SwiftDiagnostics) in the package without declaring it a dependency

**URL:** <https://forums.swift.org/t/error-target-swiftwarningcontrol-imports-another-target-swiftdiagnostics-in-the-package-without-declaring-it-a-dependency/85966>\
**Category:** Swift Syntax\
**Created:** [April 12, 2026, 1:38am UTC](https://forums.swift.org/t/error-target-swiftwarningcontrol-imports-another-target-swiftdiagnostics-in-the-package-without-declaring-it-a-dependency/85966 "2026-04-12T01:38:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![taylorswift](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/taylorswift/32/43413_2.png) [@taylorswift](https://forums.swift.org/u/taylorswift)\
**Post date:** [April 12, 2026, 1:38am UTC](https://forums.swift.org/t/error-target-swiftwarningcontrol-imports-another-target-swiftdiagnostics-in-the-package-without-declaring-it-a-dependency/85966/1 "2026-04-12T01:38:58Z")

</div>

it almost looks like a prebuilts-linked issue, but in fact, is not. that target really is importing `SwiftDiagnostics` without an actual dependency edge.

this can be seen on Swiftinit, `SwiftWarningControl` does not include `SwiftDiagnostics` either directly, or transitively.

[https://swiftinit.org/docs/swift-syntax/swiftwarningcontrol-product](https://swiftinit.org/docs/swift-syntax/swiftwarningcontrol-product)

please, let us start enforcing `--explicit-target-dependency-import-check=error` in CI religiously, it really is not optional.

---

<div class="post-metadata">

**Author:** ![pyrtsa](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/pyrtsa/32/740_2.png) [@pyrtsa](https://forums.swift.org/u/pyrtsa)\
**Post date:** [April 12, 2026, 9:11am UTC](https://forums.swift.org/t/error-target-swiftwarningcontrol-imports-another-target-swiftdiagnostics-in-the-package-without-declaring-it-a-dependency/85966/2 "2026-04-12T09:11:19Z")

</div>

Please see [Add explicit target dependency by SimplyDanny · Pull Request #3195 · swiftlang/swift-syntax · GitHub](https://github.com/swiftlang/swift-syntax/pull/3195), I think it fixed on `main` what you've also observed. The fix didn't make it to 6.3.0, but see further down for the cherry-pick which will hopefully make it into the next patch releases, too.

(And yes, we really should at least get a warning by default, but what's worse, neither `xcodebuild` nor the new `swiftbuild` build system implement `--explicit-target-dependency-import-check` for now!)
