Skip to content

Missing diagnostic about missing dependency #6607

@dabrahams

Description

@dabrahams

Description

Description

Check out the missing-dependency-diagnostic tag from the https://github.com/val-lang/val project, follow the setup instructions if you haven't already, and do swift -vv test. You will get link errors. It turns out that this change is missing, but SPM / the swift compiler doesn't tell me about it:

diff --git a/Package.swift b/Package.swift
index fa1d158f..3203e9c4 100644
--- a/Package.swift
+++ b/Package.swift
@@ -75,6 +75,7 @@ let package = Package(
       dependencies: [
         "Utils",
         .product(name: "LLVM", package: "Swifty-LLVM"),
+        .product(name: "Collections", package: "swift-collections"),
       ],
       swiftSettings: allTargetsSwiftSettings),
 

This is a big problem because often these missing dependencies don't result in link errors (like the state of that project at 5806c04fcb2b9). The project builds/runs/tests but who knows what misbehavior may have resulted from the mis-specification of Package.swift. If my tests fail, is it because of some unspecified dependency? Can't tell.

Expected behavior

No response

Actual behavior

No response

Steps to reproduce

No response

Swift Package Manager version/commit hash

Swift Package Manager - Swift 5.8.0

Swift & OS version (output of swift --version ; uname -a)

swift-driver version: 1.75.2 Apple Swift version 5.8 (swiftlang-5.8.0.124.2 clang-1403.0.22.11.100)
Target: arm64-apple-macosx13.0
Darwin DaveA-MBP14.localdomain 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar 6 20:59:28 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6000 arm64

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions