Migrate rustc_codegen_spirv
env vars to codegen args.
#959
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.
This PR adds a pair of centralized env vars to
spirv-builder
:RUSTGPU_RUSTFLAGS
: setsRUSTFLAGS
only for shader crates (and their deps)rustc
invocations usingrustc_codegen_spirv
as the codegen backends-Z time-passes
or-Z self-profile
requires editingspirv-builder
's source by handRUSTGPU_CODEGEN_ARGS
: shorthand for-Cllvm-args=...
in the above variable-C llvm-args
is a bad name that does not fit with non-LLVM codegen backends, even if they all have similar concepts of backend-specific flags, and we want to avoid showing it to users, if possible)rustc_codegen_spirv
-specific flags (most of them for debugging) that used to be individual untracked¹ env vars¹ Both of these are properly registered with Cargo in
spirv-builder
(to trigger rebuilds when they change), which is an improvement over the old env vars, which neither rustc nor Cargo knew anything about.The docs have more information on the new "codegen args", but here's a quick preview:
(most of the output omitted, but hopefully what was kept is representative)
I couldn't find a way to ban
env
inrustc_codegen_spirv
via e.g. clippy, so instead I did it in a CI script.