Merge pull request #2132 from lightpanda-io/fix/html5ever-cargo-cache-invalidation

build: track html5ever Rust sources as cargo step inputs
This commit is contained in:
Adrià Arrufat
2026-04-10 17:14:14 +02:00
committed by GitHub

View File

@@ -241,6 +241,19 @@ fn linkHtml5Ever(b: *Build, mod: *Build.Module) !void {
"--manifest-path", "src/html5ever/Cargo.toml",
});
// Track Rust sources so edits invalidate the cargo step's cache.
// Without this, Zig keys the step on argv only and won't re-run cargo
// when lib.rs/Cargo.toml change.
for ([_][]const u8{
"src/html5ever/Cargo.toml",
"src/html5ever/Cargo.lock",
"src/html5ever/lib.rs",
"src/html5ever/sink.rs",
"src/html5ever/types.rs",
}) |path| {
exec_cargo.addFileInput(b.path(path));
}
// TODO: We can prefer `--artifact-dir` once it become stable.
const out_dir = exec_cargo.addPrefixedOutputDirectoryArg("--target-dir=", "html5ever");