Skip to content

spirv-builder: fall back to hashed codegen dylibs#549

Merged
LegNeato merged 1 commit intoRust-GPU:mainfrom
LegNeato:fixbuilder
Apr 2, 2026
Merged

spirv-builder: fall back to hashed codegen dylibs#549
LegNeato merged 1 commit intoRust-GPU:mainfrom
LegNeato:fixbuilder

Conversation

@LegNeato
Copy link
Copy Markdown
Collaborator

@LegNeato LegNeato commented Apr 2, 2026

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.

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.

Copy link
Copy Markdown
Member

@Firestar99 Firestar99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@LegNeato LegNeato added this pull request to the merge queue Apr 2, 2026
Merged via the queue into Rust-GPU:main with commit ddb039b Apr 2, 2026
13 checks passed
@LegNeato LegNeato deleted the fixbuilder branch April 2, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants