You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cargo-gpu doesn't recompile things when rust-gpu dependency changes #575
I was just testing things and noticed an interesting, both expected and unexpected gotcha: changing rust-gpu dependency doesn't result in shader recompilation when cargo-gpu doesn't change.
I use cargo-gpu-install specifically in build.rs and do not have rust-gpu in build dependencies. So while cargo-gpu reads the version/revision of rust-gpu to decide what backend version to use, changing rust-gpu doesn't have any impact on anything that would result in build.rs being recompiled, as such shader is still built with the old version.
One solution might be to include the Cargo.toml of both the crate and probably the workspace root (if any) too in cargo::rerun-if-changed, though it will also result in too many unnecessary recompilations, so it is not perfect.
I do not have a great solution, but wanted to raise this as a concern that might be quite confusing to others and probably worth fixing.
Activity
Firestar99 commentedon Apr 8, 2026
I assume with updating
rust-gpuyou actually mean changing thespirv-stdrev.Yea a
cargo::rerun-if-changedwould do it, though I'd give it theCargo.lockinstead to also notice automated upgrades bycargo update.Though, I'll delay fixing this issue until cargo-gpu is merged into rust-gpu.
cargo-gpu: rerun build script when `Cargo.lock` changes
cargo-gpu: rerun build script when `Cargo.lock` changes