Skip to content

Fix rerun-if-changed directive syntax to use double colon (#82)#88

Merged
sytherax merged 1 commit into
mainfrom
fix-issue-82
Oct 19, 2025
Merged

Fix rerun-if-changed directive syntax to use double colon (#82)#88
sytherax merged 1 commit into
mainfrom
fix-issue-82

Conversation

@sytherax

Copy link
Copy Markdown
Collaborator

@gooroo-dev

gooroo-dev Bot commented Oct 19, 2025

Copy link
Copy Markdown

Please double check the following review of the pull request:

🐞Mistake 🤪Typo 🚨Security 🚀Performance 💪Best Practices 📖Readability ❓Others
1 0 0 0 0 0 0

Changes in the diff

  • 🐞 Changed the syntax of the cargo rerun-if-changed directive from cargo:rerun-if-changed to cargo::rerun-if-changed.

Identified Issues

ID Type Details Severity Confidence
001 🐞Mistake Incorrect syntax for cargo rerun-if-changed directive in wgsl_bindgen/src/bindgen/wgsl_bindgen_impl.rs line 44: cargo::rerun-if-changed instead of cargo:rerun-if-changed 🔴High 🔴High

Issue 001

Explanation

The line in the diff changes:

println!("cargo:rerun-if-changed={file}");

to

println!("cargo::rerun-if-changed={file}");

The correct syntax for the Cargo build script directive is with a single colon (:), not double colons (::). Using double colons will cause Cargo to ignore the directive, so the build script won't rerun when the file changes.

Fix

Revert the change back to the correct syntax:

println!("cargo:rerun-if-changed={file}");

Explanation of the fix

Cargo expects the directive to be exactly cargo:rerun-if-changed=... with a single colon. This is documented in Cargo's build script documentation. Using double colons is a syntax error for Cargo directives and will break the intended functionality.

Suggested fix code snippet

-        println!("cargo::rerun-if-changed={file}");
+        println!("cargo:rerun-if-changed={file}");

Missing tests for the incoming changes

Since this is a build script directive, it is difficult to write a unit test for this exact print statement. However, you can add an integration test or manual test instructions to verify that when a watched file changes, Cargo reruns the build script.

Suggested test approach:

  • Add a test that runs the build script and modifies one of the watched files.
  • Confirm that Cargo reruns the build script after the file modification.
  • This can be done manually or with an integration test harness that invokes Cargo builds and checks timestamps.

No automated test code is provided here due to the nature of the change.

Summon me to re-review when updated! Yours, Gooroo.dev
React or reply to give your feedback!

@sytherax
sytherax merged commit c95c546 into main Oct 19, 2025
5 of 7 checks passed
@sytherax
sytherax deleted the fix-issue-82 branch March 30, 2026 16:32
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.

1 participant