spirv-builder: fall back to hashed codegen dylibs#549
Merged
LegNeato merged 1 commit intoRust-GPU:mainfrom Apr 2, 2026
Merged
Conversation
Firestar99
approved these changes
Apr 2, 2026
Member
Firestar99
left a comment
There was a problem hiding this comment.
I assume this is something newer nightlies introduced? Cause I'm not aware of cargo adding a hash to the .so.
If it is, it may finally resolve the many warnings some projects get on windows about conflicting debug symbol files from .dll and .lib files being named the same.
spirv-builder only looks for the exact
librustc_codegen_spirv.{so,dylib,dll} filename in the dylib search path.
That works in the rust-gpu workspace, but it misses external build.rs
consumers where Cargo only exposes hashed deps artifacts such as
librustc_codegen_spirv-<hash>.so. This showed up in a downstream
workspace update to current rust-gpu main where the consumer path only
had hashed backend artifacts available to default SpirvBuilder
discovery.
Keep preferring the exact filename when present, then fall back to the
newest hashed rustc_codegen_spirv dylib in the same search paths. Add
tests for exact matches, hashed fallback, and exact-over-hashed
precedence.
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 free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
spirv-builderonly looks for the exactlibrustc_codegen_spirv.{so,dylib,dll}filename in the dylib search path.That works in the
rust-gpuworkspace, but it misses externalbuild.rsconsumers where Cargo only exposes hashed deps artifacts such aslibrustc_codegen_spirv-(hash).so. This showed up in a downstream workspace update to currentrust-gpumain where the consumer path only had hashed backend artifacts available.Keep preferring the exact filename when present, then fall back to the newest hashed
rustc_codegen_spirvdylib in the same search paths. Add tests for exact matches, hashed fallback, and exact-over-hashed precedence.