Adjust deps/features to avoid rebuilds of rustc_codegen_spirv
.
#183
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.
We've never added any automation for this so it keeps drifting.
The core issue here looks like this (after running all these commands at least once):
That is,
rustc_codegen_spirv
gets rebuilt for different downstream uses of it.While duplicating the initial build work would be unfortunate on its own, it's much worse to also have rebuild friction just from going back & forth between examples/tools.
(I believe this is worse than for the average crate, because Cargo can't allow N simultaneous copies of
librustc_codegen_spirv-*.so
- the usual hash suffix would interfere with dylib usage, and this also applies to almost everything other thanrlib
s, e.g. executables are also built without a hash suffix etc.)After this PR (after running all these commands at least once):
This is accomplished in two major ways:
cargo deny
enforcement)example-runner-ash
was on the previous version ofash
, and the upgrade for breaking changes was pretty involved(including fixing previously-UB usage of
Box<T>
being moved while also passing around&T
borrows hidden via*const T
in Vulkanstruct
s)winit
(will open as a separate PR)crates/rustc_codegen_spirv/Cargo.toml
"phony" depscargo-hikari
etc.?)rustc_codegen_spirv
would be compared(click to expand ridiculous hack)
echo compiletests example-runner-{ash,wgpu} | xargs -n1 bash -c 'cargo build -p "$0" --release --no-default-features --features use-installed-tools -Z unstable-options --unit-graph' | jq -s 'map(.units | map(del(.dependencies)) | group_by(.pkg_id) | map({key:.[0].pkg_id, value:.}) | from_entries) as $P | ([$P[] | keys[]] | unique | map(select(. as $k | $P | map(select(has($k))) | length > 1))) as $shared | ($shared | map({key:.,value:[$P[][.]]}) | from_entries) | map_values(transpose | map(select(map(objects) | unique | length > 1)) | map(if (map(objects | del(.features)) | unique | length) == 1 then map(objects | .features | "features: \(join("+"))") else . end) | unique | select(length > 0))'
that "one-liner" would output JSON like this (at least for
compiletests
vsexample-runner-wgpu
, before starting to make feature-unifying changes):