-
Notifications
You must be signed in to change notification settings - Fork 945
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
wgpu-types error when using serde
feature without tracing feature
#3609
Comments
This is happening because Lines 1608 to 1610 in 7495646
Without the Serialize derive, the I see a few different options so far:
I'd be happy to work up a PR if desired and there's a direction you want to try. |
Thanks for looking into this! |
I looked at this again and wgpu-types doesn't have an explicit serde feature, it's just showing up in docs.rs because serde is optional. That seems like it might be a new feature for docs.rs or I just haven't noticed it before. So part of this was my misunderstanding thinking wgpu-types was exposing an explicit feature for serde. Might still want to handle this in a way that doesn't error, but as it is now is more normal than I originally thought. Could still be nice to expose serialization/deserialization without enabling tracing and replay though, so option 3 still sounds like it might have some value. |
Think I'll probably close this for now unless there is more interest in it. For my own project I've just enabled trace and replay features and I haven't run into any issues, from some light poking around I didn't see anything with a lot of additional overhead that these features enable other than the de/serialization. |
We should still fix this, enabling a feature but not another should not cause compilation errors.
If this is the case, we should probably rename them as well. |
Is there a particular reason we don't just use the serde feature for everything? |
I would be interested in taking up this issue. |
Another alternative I didn't know about at the time is that you can prevent an optional dependency from generating it's own feature by using it in another feature with Probably just need someone to make a call on what we want to try. @KirmesBude feel free to run with this if you want, I had forgotten about it and am not working on the project I used this in anymore. Happy to help where I can though. |
Thanks for the pointers, very much appreciated. I feel like option 3 is definitely something I agree with, but it does seem to divert from the ecosystem standard by removing the "serde" feature. Or could we still have a serde feature with your |
Description
The wgpu-types crate returns an error if compiled with the "serde" feature and not the trace feature.
Repro steps
Expected vs observed behavior
I was expecting it to compile with serde serialization and deserialization of common structs.
Instead it returned many instances of this compile time error :
Platform
7495646d
Addition Info
My use case was trying to load image sampler settings from a file so I can set the texture to be repeating in Bevy. Some of wgpu's types are exposed by Bevy so I thought I would try turning on serde support to be able to load those values from a file directly. This isn't really a big deal for me, but I thought you might want to know about the inconsistency in the features.
The text was updated successfully, but these errors were encountered: