Skip to content

Conversation

@leighmcculloch
Copy link
Member

@leighmcculloch leighmcculloch commented May 16, 2025

What

Move the Rust xdrgen generator, currently embedded in xdrgen, into this repository. Use xdrgen the library with the generator located here as a custom generator to generate the Rust code for the XDR.

Why

The Rust generator is tightly coupled with the code in this repository. It would be pretty painful to use the generator in isolation of this code. The workflow we use when updating the generated code is to change xdrgen then test it with rs-stellar-xdr. The tight coupling makes that pretty awkward.

I think looking forward it's more ideal that generators live near the SDKs they generate code for. Maybe one day the Rust generator becomes so unstable we aren't changing it anymore, and then it could move back into xdrgen as a built-in generator. But at the moment this move will make iterating on rs-stellar-xdr much more convenient and faster.

The change bringing the generator into this repository creates new opportunities. We could rewrite some of the generator to share common types between curr and next, which would probably make the stellar-xdr crate smaller / faster to build and easier to use. But this PR focused just on moving the generator over. Improvements can follow separately.

Merging

Dependent on:

Related:

@leighmcculloch leighmcculloch marked this pull request as ready for review May 16, 2025 12:38
@leighmcculloch leighmcculloch marked this pull request as draft May 16, 2025 12:38
@leighmcculloch leighmcculloch marked this pull request as ready for review May 20, 2025 03:24
@leighmcculloch leighmcculloch enabled auto-merge May 20, 2025 03:24
@leighmcculloch leighmcculloch added this pull request to the merge queue May 20, 2025
Merged via the queue into main with commit eec3e22 May 20, 2025
11 checks passed
@leighmcculloch leighmcculloch deleted the xdrgen branch May 20, 2025 15:56
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.

3 participants