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

no_std support #25

Open
orsinium opened this issue Aug 11, 2024 · 2 comments · May be fixed by #26
Open

no_std support #25

orsinium opened this issue Aug 11, 2024 · 2 comments · May be fixed by #26

Comments

@orsinium
Copy link

Thank you for the project! We're looking into using wasm-coredump in wasmi for generating coredumps. The problem is that wasmi is designed for no_std environments and wasm-coredump depends on leb128 which requires std. Would you be interested in leb128 having no_std support?

Making leb128 no_std is quite easy. The only problem is that there is no io::Read and io::Write in core yet. The solution is to use embedded-io which provides no_std io traits and can also automatically convert everything implementing std::io traits. Would you be ok with leb128 having a dependency on embedded-io?

@fitzgen
Copy link
Member

fitzgen commented Aug 19, 2024

Would you be ok with leb128 having a dependency on embedded-io?

I think this is fine, if we do the following approach

  • always #![no_std]
  • optional dep on embedded-io
  • feature for nostd that enables dep:embedded-io and associated code paths
  • feature for std that enables extern crate std; and associated code paths
  • std is enabled by default

@fitzgen
Copy link
Member

fitzgen commented Aug 19, 2024

This way, std usage doesn't need embedded-io

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 a pull request may close this issue.

2 participants