Skip to content

include patterns should report invalid paths #14390

Closed as not planned
Closed as not planned
@folkertdev

Description

@folkertdev

Problem

In rust-lang/libz-sys#205 I fixed a case where a typo in the include list meant that some files were not included in the published package. The fix was simple:

include = [
    # ...
-    "src/zlib-ng/arch/s390x/**.[ch]",
+   "src/zlib-ng/arch/s390/**.[ch]",
    # ...
]

The fact that this invalid path did not get reported meant that the package was broken for the s390x target. Not great.

Proposed Solution

Intuitively I think every include line should match at least one file. In any other cases, it's redundant (can be removed) or a typo (very valuable to report to the user).

If that sounds reasonable I'd be happy have a go at implementing it.

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Error and warning messages generated by Cargo itself.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-packageCommand-publishS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions