Skip to content

cargo-gpu doesn't recompile things when rust-gpu dependency changes #145

@nazar-pc

Description

@nazar-pc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions