Skip to content

Emit rerun-if-changed of used and included files #1635

@chrysn

Description

@chrysn

When bindgen is used in build.rs, no cargo:rerun-if-changed lines are emitted that'd cause the build process to be rerun if any source file changed.

On projects where the C source and crates using the -sys crate are actively being developed, this leads to confusing error situations, and users that rm -rf target out of frustration.

I suggest adding an option to generate rerun-if-changed lines for all included files. If there is a danger to lead to long checking times due to lots of system libraries in practice, adding a filter function on the emitted header files could be an option. (That's inspired by gcc's distinction between -MD and MMD, where the latter ignores system header files).

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