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

protoc-gen-prost-serde: no_std support #102

Open
tony-iqlusion opened this issue Sep 5, 2024 · 2 comments
Open

protoc-gen-prost-serde: no_std support #102

tony-iqlusion opened this issue Sep 5, 2024 · 2 comments

Comments

@tony-iqlusion
Copy link

Would it be possible to add an option for the generated code to avoid referencing std and things that are only in the prelude when std is linked, e.g. std::result::Result and ToString, and instead use core::result::Result and alloc::string::ToString?

tony-iqlusion added a commit to cosmos/cosmos-rust that referenced this issue Sep 5, 2024
Adds some transforms which enable the generated PBJSON-related code to
be usable in `no_std` environments.

This is a workaround until such a time as it can be implemented natively
in `neoeinstein-prost-serde`. See neoeinstein/protoc-gen-prost#102.

Closes #499
tony-iqlusion added a commit to cosmos/cosmos-rust that referenced this issue Sep 5, 2024
Adds some transforms which enable the generated PBJSON-related code to
be usable in `no_std` environments.

This is a workaround until such a time as it can be implemented natively
in `neoeinstein-prost-serde`. See neoeinstein/protoc-gen-prost#102.

Closes #499
@neoeinstein
Copy link
Owner

Unfortunately the code generated for protoc-gen-prost-serde comes via the pbjson crate. They would need to provide a release that generates no_std compliant code. We could do some post-processing of their generated code, but that would be a potentially brittle transformation, so it would be better if the upstream could do this.

@tony-iqlusion
Copy link
Author

Thanks! I opened an issue on pbjson: influxdata/pbjson#135

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

No branches or pull requests

2 participants