Skip to content

fix glam 0.33 breakage#609

Merged
Firestar99 merged 7 commits into
mainfrom
glam33
Jun 8, 2026
Merged

fix glam 0.33 breakage#609
Firestar99 merged 7 commits into
mainfrom
glam33

Conversation

@Firestar99
Copy link
Copy Markdown
Member

glam 0.33 introduced a feature for each type of vector to speed up compile times. This caused rust-gpu to break when used with glam 0.33, which is completely our fault, since we declare our dependency on glam to be forwards compatible even across breaking changes:

glam = { version = ">=0.30.8", default-features = false }

The simple fix is to just require glam 0.33, like the second commit does:

-glam = { version = ">=0.30.8", default-features = false }
+glam = { version = "0.33.0", default-features = false, features = ["u32", "i32", "f64"] }

However, there are a few important libraries that still depend on an older glam version, like the most recent release of bevy_math still depending on glam v0.30.*.

Instead, I would like to propose that we have one feature for each glam version, and default to the most recent one:

[features]
default = ["glam_0_33"]
glam_0_33 = ["dep:glam_0_33"]
glam_0_32 = ["dep:glam_0_32"]
glam_0_31 = ["dep:glam_0_31"]
glam_0_30 = ["dep:glam_0_30"]

And within lib.rs we'll switch on the feature gate to select the glam version:

#[cfg(feature = "glam_0_30")]
pub use ::glam_0_30 as glam;
#[cfg(feature = "glam_0_31")]
pub use ::glam_0_31 as glam;
#[cfg(feature = "glam_0_32")]
pub use ::glam_0_32 as glam;
#[cfg(feature = "glam_0_33")]
pub use ::glam_0_33 as glam;

Note that this does not support multiple glam versions simultaneously, but I don't think that matters. Maintaining this is cheap, so we can just maintain backwards compatible for whatever N versions that we can be bothered to.

Expect a crates alpha release soon after merging this.

close #602

Copy link
Copy Markdown
Collaborator

@LegNeato LegNeato left a comment

Choose a reason for hiding this comment

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

Agreed this is a good fix.

Can we put raw glam in cargo-deny w/ an override for so we can't use it directly w/o CI failing?

@Firestar99 Firestar99 added this pull request to the merge queue Jun 8, 2026
Merged via the queue into main with commit a27c036 Jun 8, 2026
24 checks passed
@Firestar99 Firestar99 deleted the glam33 branch June 8, 2026 18:01
@nazar-pc
Copy link
Copy Markdown
Contributor

nazar-pc commented Jun 8, 2026

Docs failed to build with these changes: https://github.com/Rust-GPU/rust-gpu/actions/runs/27157018177/job/80162386469

@Firestar99 Firestar99 mentioned this pull request Jun 8, 2026
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.

spirv-std incompatible with shipped glam version

3 participants