rerun-if-changed doesn't handle past timestamps #10791
Labels
A-build-scripts
Area: build.rs scripts
A-rebuild-detection
Area: rebuild detection and fingerprinting
C-bug
Category: bug
S-triage
Status: This issue is waiting on initial triage.
Problem
Using
rerun-if-changed
to a file that changes, but changes with old timestamps, Cargo won't detect that it needs to run. For example:foo
with timestamp 1.cargo build
withrerun-if-changed
offoo
. This marks the build script as timestamp 5.foo
with timestamp 2.cargo build
again, it doesn't pick up the change from timestamp 1 to 2 because both values are less than 5.I would expect any change to the file to cause it to re-run the build script.
The real-world use case is in the rust LLVM build system. It extracts LLVM from a downloaded tarball. The
rustc_llvm
build script has arerun-if-changed=/path/to/llvm-config
. When rustbuild determines a new tarball needs to be downloaded, therustc_llvm
build script doesn't get the memo and doesn't get rerun. This can cause it to link against the wrong file.Steps
The following is a test using Cargo's testsuite:
Possible Solution(s)
A few possible options:
Notes
No response
Version
The text was updated successfully, but these errors were encountered: