fix(cuda_std): pin glam to "0.30" to match the rest of the workspace#398
Open
samlaf wants to merge 1 commit into
Open
fix(cuda_std): pin glam to "0.30" to match the rest of the workspace#398samlaf wants to merge 1 commit into
samlaf wants to merge 1 commit into
Conversation
cuda_std declared its glam dependency with an unbounded lower bound and no
upper cap:
glam = { version = ">=0.22", default-features = false, features = [...] }
With default-features = false, this is a latent breakage: glam's "Type
features" change (PR #727, shipped in 0.33) gated the vector types behind
cargo features. glam keeps `all-types` in its `default`, so ordinary
consumers see no change -- but anyone who disables default features loses
the integer/size/f64 types unless they re-enable them.
cuda_std relies on those gated types:
- glam::UVec2 / UVec3 (u32) in src/thread.rs
- glam::USizeVec2 / USizeVec3 (size) in src/rt/mod.rs
- `pub use glam;` re-exports the whole crate to kernel authors
So on glam >=0.33 with defaults off, cuda_std fails to compile (e.g. cannot
find glam::UVec2). The unbounded ">=0.22" let a fresh resolve float straight
across the 0.32 -> 0.33 break.
Why it wasn't already broken in-tree: the other glam consumers in this
workspace (cust, cust_core, optix) all pin glam = "0.30", which unifies the
dependency graph to 0.30.9 -- a version that predates the type gating, so all
types are present regardless of default-features. The bug only bites a
*standalone* consumer of cuda_std, where nothing else caps glam.
Fix: pin cuda_std to glam = "0.30", matching the other three crates. This
caps the bound, keeps the whole workspace on one tested version (0.30.9;
Cargo.lock unchanged), and needs no type-feature re-enabling because 0.30
does not gate types (and `all-types` does not exist there). Behavior is
preserved.
Follow-up (separate change): hoist glam into [workspace.dependencies] so its
version is defined once and cannot drift across crates again -- this drift is
exactly what allowed cuda_std to diverge from the others.
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.
Context
Ran into this glam issue when running https://rust-gpu.github.io/rust-cuda/guide/getting_started.html
Bug
cuda_std declared its glam dependency with an unbounded lower bound and no upper cap:
With default-features = false, this broke rust-cuda: glam's Type features PR gated the vector types behind cargo features. glam keeps
all-typesin itsdefault, so ordinary consumers see no change -- but anyone who disables default features loses the integer/size/f64 types unless they re-enable them.cuda_std relies on those gated types:
pub use glam;re-exports the whole crate to kernel authorsSo on glam >=0.33 with defaults off, cuda_std fails to compile (e.g. cannot find glam::UVec2). The unbounded ">=0.22" let a fresh resolve float straight across the 0.32 -> 0.33 break.
Why it wasn't already broken in-tree: the other glam consumers in this workspace (cust, cust_core, optix) all pin glam = "0.30", which unifies the dependency graph to 0.30.9 -- a version that predates the type gating, so all types are present regardless of default-features. The bug only bites a standalone consumer of cuda_std, where nothing else caps glam.
Fix
pin cuda_std to glam = "0.30", matching the other three crates. This caps the bound, keeps the whole workspace on one tested version (0.30.9; Cargo.lock unchanged), and needs no type-feature re-enabling because 0.30 does not gate types (and
all-typesdoes not exist there). Behavior is preserved.Follow-up suggestion
Hoist glam into [workspace.dependencies] so its version is defined once and cannot drift across crates again -- this drift is exactly what allowed cuda_std to diverge from the others.