Skip to content

rerun-if-changed on directory does not rerun on new timestamp or file contents #2599

@durka

Description

@durka

I did println!("cargo:rerun-if-changed=dir") where dir is a directory in the same directory as Cargo.toml.

I expected the build script to rerun if any file within dir changes its timestamp or contents. However, it only reruns if files are created or deleted.

I have created a quick-and-dirty test script in this crate. This is the output:

$ uname -mrs
Darwin 13.4.0 x86_64
$ cargo -V
cargo 0.11.0-nightly (d99a7eb 2016-04-19)
$ ./test.sh
......
[PASS] no rerun with no changes
[FAIL] no rerun with changed timestamp
[PASS] rerun with new file
[FAIL] no rerun with changed file contents
[PASS] rerun with deleted file

cc @huonw

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions