Skip to content

Misspelling of build.rs doesn't get reported #13073

@diondokter

Description

@diondokter

Problem

I was giving a workshop to people new to rust and in one of the exercises they were instructed to create a build.rs file.
However, this person either didn't read this correctly or typo-ed and created builds.rs.

Obviously, (or rather very unobviously) this won't work and it took me and her about 5 minutes to figure out.

Proposed Solution

Cargo could try to see if there's no current build.rs yet and then if there's a file that's a likely misspelling of the name. If it finds that's the case it could output a warning with a suggestion to rename the file.

Notes

There could be false positives with this in theory. But that would be a pretty strange project layout, so I feel that would almost never happen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-build-scriptsArea: build.rs scriptsA-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`S-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