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 }}
This repository was archived by the owner on Apr 10, 2026. It is now read-only.
cargo gpu clippy allows you to run clippy with a spirv target, which can check code hidden by #[cfg(target_arch = "spirv")], that cargo clippy --all-targets does not.
Also adds cargo gpu check, not sure how useful it'll be.
WON'T add cargo gpu fmt since cargo fmt is fully target independent. We could use the fmt of the rust-gpu rust toolchain, but at worst that'll get you different formatting from whatever stable toolchain you're using.
Would it be possible to make the same thing usable through programmatic API? For example, when cargo clippy is running, my build script would do clippy lint on a crate too (right now I just skip the build completely for clippy).
Both enum Command and Command::run are public, so you can just construct an instance and call run? Though after #132, you'd have to depend on the full cargo-gpu and won't be able to use the minified cargo-gpu-install.
Although, you could easily replicate it's behaviour by changing the spirv_builder.cargo_cmd to "clippy" and check that the build fails with NoArtifactProduced. Maybe we should even move that to cargo-gpu-install, since it is that trivial?
I'd appreciate some simple way through cargo-gpu-install.
Here is how I check for clippy/Miri/rustdoc to have a placeholder shader.
I do that because I know the code wouldn't run and I do not inspect it at compile time in const fn enough to trigger any errors (though I do process it in const fn).
It'd be nice if a similar thing worked internally, but maybe .unwrap_single() would return Option<&Path> in that case, so I can recognize between when build artifact was not produced on purpose.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cargo gpu clippyallows you to run clippy with a spirv target, which can check code hidden by#[cfg(target_arch = "spirv")], thatcargo clippy --all-targetsdoes not.Also adds
cargo gpu check, not sure how useful it'll be.WON'T add
cargo gpu fmtsincecargo fmtis fully target independent. We could use the fmt of the rust-gpu rust toolchain, but at worst that'll get you different formatting from whatever stable toolchain you're using.enabled by
crate-type = ["dylib"]on shader crates rust-gpu#477