From 96006daf6e6665dac48ef60e16ccaec3b6988744 Mon Sep 17 00:00:00 2001 From: Samson <16504129+sagudev@users.noreply.github.com> Date: Mon, 30 Sep 2024 13:31:05 +0200 Subject: [PATCH] use rerun-if-changed in script/build.rs (#33502) * use rerun-if-changed in script/build.rs Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * handle rerun on changes in webidl.py Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Address comment nit Signed-off-by: Martin Robinson --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> Signed-off-by: Martin Robinson Co-authored-by: Martin Robinson --- components/script/build.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/script/build.rs b/components/script/build.rs index 52ccbbee784..a0666675c7a 100644 --- a/components/script/build.rs +++ b/components/script/build.rs @@ -16,11 +16,18 @@ fn main() { let start = Instant::now(); let style_out_dir = PathBuf::from(env::var_os("DEP_SERVO_STYLE_CRATE_OUT_DIR").unwrap()); + let css_properties_json = style_out_dir.join("css-properties.json"); let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap()); + println!("cargo::rerun-if-changed=dom/webidls"); + println!("cargo::rerun-if-changed=dom/bindings/codegen"); + println!("cargo::rerun-if-changed={}", css_properties_json.display()); + println!("cargo::rerun-if-changed=../../third_party/WebIDL/WebIDL.py"); + // NB: We aren't handling changes in `third_party/ply` here. + let status = Command::new(find_python()) .arg("dom/bindings/codegen/run.py") - .arg(style_out_dir.join("css-properties.json")) + .arg(&css_properties_json) .arg(&out_dir) .status() .unwrap();