-
-
Notifications
You must be signed in to change notification settings - Fork 224
Add serde behind feature flag for some builtins #237
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
In godot-rust/gdnative#743, we decided against serializing Rid
because it's not a persistent value.
Also, implementing serde
support entails more than the derive-macros, namely:
- Finding a persisted representation for each type -- this is not always a 1:1 mapping of the
struct
/enum
definition. For example forProjection
, should we just storecols
or something else? - This would need to be accompanied by tests,
serde_json
should be enough. Tests also serve as expressive code that visualizes how the persisted format looks. - While this wouldn't need to be implemented right now, it's probably good to think about how to support composite types like
Array
,PackedArray
,Dictionary
,Variant
.
In general, it may be a bit early to decide all the things already. Some of the interfaces are still changing (including composite types). Also, we'd need to check that this doesn't make our CI run significantly longer; or just enable serde
in the Linux unit-test.
@jrockett6 For an initial version, we would need concretely:
Do you think that's possible? |
Yep, sounds good. I'll get a revision out this week. |
25d51d3
to
ced187f
Compare
@Bromeon I updated to include tests and remove RID support, I think the only outstanding thing for the initial version (apart from potential review changes) is adding the feature flag to the linux CI. I'm a bit lost on where this should be added though, some suggestions on how to modify the yaml file would be very helpful 😁 |
Sure! 🙂 You can extend/rename: - name: linux-threads
os: ubuntu-20.04
artifact-name: linux
godot-binary: godot.linuxbsd.editor.dev.x86_64
rust-extra-args: --features threads as follows: - name: linux-features
os: ubuntu-20.04
artifact-name: linux
godot-binary: godot.linuxbsd.editor.dev.x86_64
rust-extra-args: --features threads,serde |
ced187f
to
ad52498
Compare
API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-237 |
Thank you! 🙂 bors r+ |
237: Add serde behind feature flag for some builtins r=Bromeon a=jrockett6 Pretty straightforward here, though I hope I got all the types that made sense. I'm not familiar with the FFI stuff, so to be safe I left out anything with "Opaque" fields. Let me know if there is anything else here that I can help with. Co-authored-by: jrockett6 <[email protected]>
Build failed: |
ad52498
to
bf6fea7
Compare
bors r+ |
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page.
|
Pretty straightforward here, though I hope I got all the types that made sense. I'm not familiar with the FFI stuff, so to be safe I left out anything with "Opaque" fields. Let me know if there is anything else here that I can help with.