-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Serialization support for ncollide #297
Comments
Explicit |
Thank you for taking this @syberant!
I agree adding
It is acceptable as long as it is compatible with WASM.
We used it at some point in the past. If it isn't used any more, feel free to remove the dependency.
Don't worry about this, the is no rush! |
It looks like |
The entirety of serialization support should be an optional feature, since serde is a large dep that is not universally required. |
@Ralith Yes, this is true. What I meant to say is that we should have two features. One feature, say, |
Thanks for catching the issue so quickly, I hadn't thought about WASM-compatibility of serialization and was using the already existing feature |
Relevant issues regarding compatibility with WASM: |
This issue is related to dimforge/nphysics#203. It is about implementing (de)serialization capabilities to ncollide so they can be used when adding those capabilities to nphysics.
As said in the linked issue I'm willing to make a PR for this myself and I will use this issue to discuss the questions specific to ncollide.
The first thing I did in my temporary fork was adding
#![deny(bare_trait_objects)]
to src/lib.rs and using cargo fix to putdyn
in front of every trait object, thereby making them easily recognisable. This was ~250 changes and originally meant only for development purposes but I think it is sufficiently handy and non-intrusive that it may be a good idea to keep it. If this is done it should most likely be in a different PR to keep changes manageable.Then I started
derive
-ing the crap out of everything and doing a few manual implementations which only containedunimplemented!
when I ran into problems. I'm still looking at the problem of trait objects but typetag, as suggested by @Ralith, seems to fix it without security concerns by basically making an enum out of things. I also looked at serde_traitobject but that serialized the vtable pointer and could allow arbitrary code execution (I think, about 99% sure and the crate also warns of its insecurity) and is specific to a binary. Question: Is a dependency like typetag acceptable? Otherwise I would end up probably implementing about the same thing but less mature.I have also looked at the serialization support of some dependencies:
I'm currently in the middle of my test week and will resume work on this next weekend, sorry for being a bit slow right now.
The text was updated successfully, but these errors were encountered: