Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to compile with glam enabled #65

Open
petar-andrejic opened this issue Aug 20, 2024 · 0 comments
Open

Fails to compile with glam enabled #65

petar-andrejic opened this issue Aug 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@petar-andrejic
Copy link

petar-andrejic commented Aug 20, 2024

Using the library in a project fails to compile if the glam feature is enabled, with errors of the form "error[E0599]: no function or associated item named div_euclid found for type f64 in the current scope", and so on for all the other std math functions

The most likely culprit is that the cargo configuration for this library uses

glam = { version = "^0.27", default-features = false, features = ["mint"], optional = true }

Since no default features are used, std is not used as its the only default feature. However, if std is not used, its necessary for glam to use the libm feature instead to provide the math functions, which is not provided

This doesn't seem to be caught in testing because the testing configures

test-all-math-libraries = ["cgmath", "glam", "glam/std", "nalgebra"]

and therefore pulls in the standard library for glam, and wouldn't raise the issue.

I'm not very familiar with cargo so I don't know much about enabling features conditionally, but somehow the solution would be that if std is enabled for this crate, its also passed in for glam, and if not, glam/libm is requested.

Steps to reproduce:

cargo init some_proj
cd some_proj
cargo add crevice -F glam
cargo run

Will fail to compile

@LPGhatguy LPGhatguy added the bug Something isn't working label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants