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

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.

Please see Add explicit target dependency by SimplyDanny · Pull Request #3195 · swiftlang/swift-syntax · GitHub, 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!)