Skip to content

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

@tayloraswift

Description

@tayloraswift

Description

https://forums.swift.org/t/error-target-swiftwarningcontrol-imports-another-target-swiftdiagnostics-in-the-package-without-declaring-it-a-dependency/85966

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

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

Steps to Reproduce

$ git clone https://github.com/swiftlang/swift-syntax
$ git checkout 603.0.0
$ swift build --explicit-target-dependency-import-check=error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions