-
Notifications
You must be signed in to change notification settings - Fork 2.6k
rerun-if-changed always trigger rebuild on non-exist file #4213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the report! This is expected behavior, though, for Cargo. Cargo needs to rerun a build script when a file is deleted, so if it's not present Cargo doesn't know whether it ws deleted or just didn't exist before. |
I do not understand how you can correctly handle incremental compilation, when the appearance of a file can affect the state of the artifact.
|
Yeah in general Cargo doesn't (and nor do most build systems) have the ability to get rerun when a file appears. Typically this works out as some other file indicate that said file appeared, but right now it's not possible to do so with Cargo. |
Build script calls skeptic which emits information asking cargo to monitor content of README.md.skt.md for changes. If changes to that file are detected cargo should rebuild liquid crate. In case of this project the files does not exist. This causes cargo to trigger a rebuild every time in hope that it will get crated by the build script. The workaround is to crate the file that skeptic asks to monitor which stops cargo from triggering the rebuild. For details consult this issues: * budziq/rust-skeptic#25 * rust-lang/cargo#4213
Build script calls skeptic which emits information asking cargo to monitor content of README.md.skt.md for changes. If changes to that file are detected cargo should rebuild liquid crate. In case of this project the files does not exist. This causes cargo to trigger a rebuild every time in hope that it will get created by the build script. The workaround is to create the file that skeptic asks to monitor which stops cargo from triggering the rebuild. For details consult this issues: * budziq/rust-skeptic#25 * rust-lang/cargo#4213
Build script calls skeptic which emits information asking cargo to monitor content of README.md.skt.md for changes. If changes to that file are detected cargo should rebuild this crate. In case of this project the files does not exist. This causes cargo to trigger a rebuild every time in hope that it will get created by the build script. The workaround is to create the file that skeptic asks to monitor which stops cargo from triggering the rebuild. For details consult this issues: * budziq/rust-skeptic#25 * rust-lang/cargo#4213
40: Reduce needless recompiles r=epage a=epage Build script calls skeptic which emits information asking cargo to monitor content of README.md.skt.md for changes. If changes to that file are detected cargo should rebuild this crate. In case of this project the files does not exist. This causes cargo to trigger a rebuild every time in hope that it will get created by the build script. The workaround is to create the file that skeptic asks to monitor which stops cargo from triggering the rebuild. For details consult this issues: * budziq/rust-skeptic#25 * rust-lang/cargo#4213
Fixes budziq#25. Workaround for rust-lang/cargo#4213.
Fixes #25. Workaround for rust-lang/cargo#4213.
skeptic causes cargo to monitor README.md.skt.md. This file does not exist, nor is it created by any build script. Because of this cargo will always rebuild. Inspired by: assert-rs/assert_cli@ccc8af5 More info: budziq/rust-skeptic#25 rust-lang/cargo#4213
skeptic causes cargo to monitor README.md.skt.md. This file does not exist, nor is it created by any build script. Because of this cargo will always rebuild: $ RUST_LOG=cargo::ops::cargo_rustc::fingerprint=info cargo build ... stale: /home/jvo/.cargo/registry/src/github.com-1ecc6299db9ec823/ply-rs-0.1.1/README.md.skt.md -- missing ... fingerprint error for ply-rs v0.1.1: mtime based components have changed Inspired by: assert-rs/assert_cli@ccc8af5 More info: budziq/rust-skeptic#25 rust-lang/cargo#4213
skeptic causes cargo to monitor README.md.skt.md. This file does not exist, nor is it created by any build script. Because of this cargo will always rebuild: $ RUST_LOG=cargo::ops::cargo_rustc::fingerprint=info cargo build ... stale: /home/.../ply-rs-0.1.1/README.md.skt.md -- missing ... fingerprint error for ply-rs v0.1.1: mtime based components have changed Inspired by: assert-rs/assert_cli@ccc8af5 More info: budziq/rust-skeptic#25 rust-lang/cargo#4213
skeptic causes cargo to monitor README.md.skt.md. This file does not exist, nor is it created by any build script. Because of this cargo will always rebuild even if nothing has been changed: $ RUST_LOG=cargo::ops::cargo_rustc::fingerprint=info cargo build ... stale: /home/.../ply-rs-0.1.1/README.md.skt.md -- missing ... fingerprint error for ply-rs v0.1.1: mtime based components have changed Inspired by: assert-rs/assert_cli@ccc8af5 More info: budziq/rust-skeptic#25 rust-lang/cargo#4213
skeptic causes cargo to monitor README.md.skt.md. This file does not exist, nor is it created by any build script. Because of this cargo will always rebuild even if nothing has changed: $ RUST_LOG=cargo::ops::cargo_rustc::fingerprint=info cargo build ... stale: /home/.../ply-rs-0.1.1/README.md.skt.md -- missing ... fingerprint error for ply-rs v0.1.1: mtime based components have changed Inspired by: assert-rs/assert_cli@ccc8af5 More info: budziq/rust-skeptic#25 rust-lang/cargo#4213
skeptic causes cargo to monitor README.md.skt.md. This file does not exist, nor is it created by any build script. Because of this cargo will always rebuild even if nothing has changed: $ RUST_LOG=cargo::ops::cargo_rustc::fingerprint=info cargo build ... stale: /home/.../ply-rs-0.1.1/README.md.skt.md -- missing ... fingerprint error for ply-rs v0.1.1: mtime based components have changed Compiling ply-rs v0.1.1 ... Finished dev [unoptimized + debuginfo] target(s) in 6.90 secs $ RUST_LOG=cargo::ops::cargo_rustc::fingerprint=info cargo build ... stale: /home/.../ply-rs-0.1.1/README.md.skt.md -- missing ... fingerprint error for ply-rs v0.1.1: mtime based components have changed Compiling ply-rs v0.1.1 ... Finished dev [unoptimized + debuginfo] target(s) in 6.81 secs Inspired by: assert-rs/assert_cli@ccc8af5 More info: budziq/rust-skeptic#25 rust-lang/cargo#4213
Is this truly intended behavior? If cargo knows which directory to watch for changes via enum ChangeHistory {
Exists(Mtime),
NoFile
}
for (path, history) in tracked_changes {
match history {
Exists(mt) => rerun_build_if_mtime_changed(path, mt)
NoFile => rerun_build_if_file_exists(path),
}
} |
Uh oh!
There was an error while loading. Please reload this page.
Original cause: bozaro/lz4-rs#21
Root cause:
README.md
README.md.skt.md
is not presend in my project and cargo always rerun build.I would expect that the restart will only happen if
README.md.skt.md
file appears.Unfortunatelly, adding check for file exists in
Skeptic
is incorrect, because it should rerun if file appears at some time.The text was updated successfully, but these errors were encountered: