Disable bindgen's autowatch of cloned includes in outdir#16
Disable bindgen's autowatch of cloned includes in outdir#16
outdir#16Conversation
|
Hmm, I'd still like to figure out the root cause of why The workaround seems simple enough though. |
Yeah I couldn't either. Nothing any of our (or Falco's build scripts) are doing should cause mtime updates AFAICT. How exactly are you reproducing/inducing the spurious rebuilds? I haven't been able to/haven't noticed spurious rebuilds but I might not be doing exactly what you're doing. |
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))makes bindgen autowatch every header the
build.rsclones into OUT_DIR.This can force spurious rebuilds if a cloned header in OUT_DIR gets touched with a new mtime, or whatever.
But we can just turn this off and only trigger rebuilds on:
this ought to be safe because the cloned files in OUT_DIR are transient, and you can't update the clone ref without touching
build.rsitself (which would rerun) - so we really don't need to care about triggering rebuilds if the cloned libscap source headers change.This will not guard against someone or something locally munging files in OUT_DIR and breaking their own build/local OUT_DIR corruption/etc, but that's not likely and if it did happen, a
cargo cleanwould resolve it anyway.