-
Notifications
You must be signed in to change notification settings - Fork 155
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 #45
Comments
The goblin parser can be made no std in two ways:
I think 2 would be cooler, and less maintenance burden, but it would also remove niceties of preallocated headers, etc. I guess it’s not too important tho?
In either case have to decide if the automatic struct readers custom derives from scroll are moved into no_std. I had trouble in the past getting custom derives working on no std but I probably just did something stupid ? A downside of this is compile times for no std, since it’ll pull in syn, etc. A downside of not doing it is writing header readers by hand for all the different binary formats again, which will suck and will have to be tested (and fuzzed) all over again. I’m also not sure I want to take on that maintenance burden. Anyway, if this is of interest, someone can open an issue on goblin repo and flesh out there. |
I think the problem is the derives use @whitequark Are you still working on this? If not, I might be able to do some work on it. |
I am not. |
I actually realized the feature flags won’t have to modified greatly or cause larger compile times when using less stuff. If the parser is made no std, and people just want the struct defs, will be the same flags as before, and same compile time. If they want parser will be same, just happens to be no std |
@philipc yea you’re totally right about std uses. I think I tried pulling out all the std uses and make them a constant value in the generated code but I couldn’t get that working either. Anyway should be easy fix on scroll_derive side. Only problem is it forces anyone using it to have no_std and/or the extern core :/ Maybe a std feature flag for the derive would help ...? |
Looks like the only hardoh wow everything transitively depends on std::io my eyes my eyes are burningstd
dependency isstd::io::Cursor
here, which really should usegoblin::peek_bytes
but that is by some mistake covered underif_std!
.The text was updated successfully, but these errors were encountered: