Skip to content

Improve error message "public headers ("include") directory path for <target> is invalid or not contained in the target" #7734

Description

@JetForMe

Description

You get this if you don't add C-family files inside the target’s source directory, without adding the include directory. I had misnamed my directory includes, and it took some googling to realize my mistake. Better would be to have two separate messages:

  1. "Target missing required public header directory ("include")".
  2. "Target public header directory ("include") is invalid" (ideally with a link to the docs explaining what a valid directory looks like).

Expected behavior

No response

Actual behavior

No response

Steps to reproduce

No response

Swift Package Manager version/commit hash

No response

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

swift-driver version: 1.110 Apple Swift version 6.0 (swiftlang-6.0.0.4.52 clang-1600.0.21.1.3)
Target: arm64-apple-macosx14.0
Darwin eclipsem1.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions