Skip to content

fix: add rerun-if-changed to avoid unnecessary rebuilds#1

Merged
littledivy merged 3 commits intodenoland:mainfrom
kajukitli:fix-rerun-if-changed
Mar 3, 2026
Merged

fix: add rerun-if-changed to avoid unnecessary rebuilds#1
littledivy merged 3 commits intodenoland:mainfrom
kajukitli:fix-rerun-if-changed

Conversation

@kajukitli
Copy link
Copy Markdown
Contributor

The build script was missing cargo:rerun-if-changed directives, causing Cargo to rerun it on every build. Additionally, bindgen's CargoCallbacks was emitting rerun-if-changed for generated headers in OUT_DIR (whose path changes between builds) and system headers.

Fixed by:

  1. Adding explicit rerun-if-changed for all source files, headers, and template files
  2. Removing CargoCallbacks from bindgen since we now manually track all relevant files

Verified locally:

$ cargo build
   Compiling libnghttp2 v1.68.0-rc.0
    Finished ...
$ cargo build
    Finished ... target(s) in 0.02s  # no recompile
$ cargo build
    Finished ... target(s) in 0.02s  # no recompile

The build script was missing cargo:rerun-if-changed directives, causing
Cargo to rerun it on every build. Additionally, bindgen's CargoCallbacks
was emitting rerun-if-changed for generated headers in OUT_DIR (whose
path changes between builds) and system headers.

Fixed by:
1. Adding explicit rerun-if-changed for all source files, headers, and
   template files
2. Removing CargoCallbacks from bindgen since we now manually track all
   relevant files
Comment thread build.rs Outdated
Comment on lines +41 to +43
// All source files
const SOURCES: &[&str] = &[
"nghttp2/lib/sfparse.c",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kajukitli This is duplicate. See source files listed below

@littledivy littledivy merged commit 72ea8e6 into denoland:main Mar 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants