sys: build.rs declares no rerun-if-changed, so edits to the vendored C are silently not rebuilt
We build [Simple](https://simple.dev), an AI platform for business operations. Application logic runs as WASM guests with QuickJS embedded through `rquickjs`, so we track this crate closely.
### The problem
`sys/build.rs` declares only `cargo:rerun-if-env-changed`, so cargo re-runs the build script when a feature flag moves and at no other time. Editing the vendored C therefore changes nothing on its own: the object files already exist, and the engine linked into the resulting binary is the one from before the edit.
Verified on master (`sys/build.rs`, 378 lines): 0 occurrences of `rerun-if-changed`, and the same in the published 0.12.2.
### How we hit it
We carry a patched copy of the vendored engine. To check the patch was actually load-bearing we removed it, rebuilt, and expected a test to fail. It passed. The build took **0.65 seconds** and never recompiled the C — the check was measuring the previous binary while reporting on the current source.
That is the general shape: a change present in the source, absent from the artifact, with nothing in the build output saying so. It affects anyone patching or vendoring the crate, which is exactly the population that needs the guarantee.
### Suggested fix
```rust
for source in ["quickjs.c", "libregexp.c", "libunicode.c", "dtoa.c"] {
println!("cargo:rerun-if-changed=quickjs/{source}");
}
println!("cargo:rerun-if-changed=quickjs/quickjs.h");
println!("cargo:rerun-if-changed=quickjs.bind.h");
```
Happy to open a PR if you'd like it — just say whether you'd prefer the file list enumerated as above or globbed from the submodule directory.
0 条评论