-
Notifications
You must be signed in to change notification settings - Fork 258
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
Do not use std imports #949
Do not use std imports #949
Conversation
@@ -218,6 +218,7 @@ impl RuntimeGenerator { | |||
let types_mod = type_gen.generate_types_mod()?; | |||
|
|||
Ok(quote! { | |||
extern crate alloc; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should move extern crate alloc
to codegen/src/lib.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey,
In order to make this work in no-std, we must migrate from using std::io:Error
(feature-gate it)
Thus, currently it does only work in std and I think migrating to no-std is quite a big task.
Can you write up an issue why you need this in no-std
?
Even for WASM support subxt is using std but I guess it could useful in when doing offline or something?
The reasoning for no_std comes from this PR: The idea as I understand it from chats with @pmikolajczyk41 is that it may be nice to be able to provide to contracts a custom environment containing a In this case, only the runtime types and none of the actual subxt interface stuff needs to be My general feeling is that if we can make the types that are generated Anyway, step one is seeing whether the contracts guys want a |
Access to the types generated by the pallet calls is something we want indeed.
Agree with this. If we are doing I am just catching up with everything around this work, but from what I understand I don't see any big blockers to getting something working |
Substitute
std::
imports in the generated code withcore::
oralloc::
to enable using macro within no-std context.