You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to use bcs in an environment without std support, after some hacking, I've put together a commit that compiles in a no_std environment: xxuejie@7e6b1f3 Some of my changes include:
Switch from std to core for components that exist in both crates, such as core::result::Result
Use Vec and String from alloc instead of std
Add a just-enough io module in no_std environment to minimize changes to existing logic
(Perhaps the most controversial one), I have to use onlyerror, which is like thiserror but works in no_std environment. And for this to work I have to switch to a nightly version of Rust, since core::error::Error is not stable yet. An alternative path is what postcard does now, but we lose the custom message
So my question here is: is no_std support that you would consider to be accepted to upstream? And if so, how do you suggest we deal with the thiserror issue?
Thanks!
The text was updated successfully, but these errors were encountered:
Hi @xxuejie, Thanks for reaching out! I don't think we want to switch to the nightly Rust. I'm open to the idea of a feature std that would activated by default but can be removed to activate your suggestions.
Hey thanks for the reply! I could prepare a PR that adds std as a default-on feature, so the messages defined on errors will only be available when std feature is enabled. Rest of changes are just as described above. This will make sure stable Rust can be used, will that work for your case?
Hi there,
I was trying to use bcs in an environment without std support, after some hacking, I've put together a commit that compiles in a
no_std
environment: xxuejie@7e6b1f3 Some of my changes include:std
tocore
for components that exist in both crates, such ascore::result::Result
Vec
andString
from alloc instead of stdio
module inno_std
environment to minimize changes to existing logiconlyerror
, which is likethiserror
but works inno_std
environment. And for this to work I have to switch to a nightly version of Rust, sincecore::error::Error
is not stable yet. An alternative path is what postcard does now, but we lose the custom messageSo my question here is: is
no_std
support that you would consider to be accepted to upstream? And if so, how do you suggest we deal with thethiserror
issue?Thanks!
The text was updated successfully, but these errors were encountered: