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
A somewhat lighter-weight alternative that works today is cargo component check. It still prints the errors, but it doesn't do as much work so it is faster. That said, I agree, a way to generate just the bindings is a good idea.
This is a slightly bigger change, but what @sunfishcode what do you think about re-introducing a macro to generate the bindings, or a build.rs?
Reading over the previous context it seems like we removed it in order to increase build speed, but it really seems like what we want is to hook into the build process and ensure bindings are built (and if they can't be, to error early/quickly) -- I think in most of the ecosystem outside of cargo-component this is done with macros that possibly output to local files for easy review (otherwise people lean on cargo-expand)...
I agree with both of you here and want to point out that the experience of cargo component new and being greeted with tons of "red squigglies" isn't great. My immediate first thought was:
oh, I should add information about the binding generation command to component-docs so that people can at least know to run that before the open src/lib.rs
And then found this issue because it doesn't exist (yet!). That made me start to think again about the whole starting experience here.
Hey @sunfishcode IMO that's perfect, thanks -- the bindings subcommand was more than enough, and the new integration sounds like it'll be a very ergonomic change.
The README and related documentation should probably be changed to match as well, but I'm in favor of making that a separate, focused issue (so we can capture the parts to change, and maybe even do a bit of a docs overhaul for this crate).
Activity
sunfishcode commentedon Dec 13, 2024
A somewhat lighter-weight alternative that works today is
cargo component check. It still prints the errors, but it doesn't do as much work so it is faster. That said, I agree, a way to generate just the bindings is a good idea.vados-cosmonic commentedon Dec 21, 2024
This is a slightly bigger change, but what @sunfishcode what do you think about re-introducing a macro to generate the bindings, or a
build.rs?Reading over the previous context it seems like we removed it in order to increase build speed, but it really seems like what we want is to hook into the build process and ensure bindings are built (and if they can't be, to error early/quickly) -- I think in most of the ecosystem outside of
cargo-componentthis is done with macros that possibly output to local files for easy review (otherwise people lean oncargo-expand)...I agree with both of you here and want to point out that the experience of
cargo component newand being greeted with tons of "red squigglies" isn't great. My immediate first thought was:And then found this issue because it doesn't exist (yet!). That made me start to think again about the whole starting experience here.
Add a `bindings` subcommand.
sunfishcode commentedon Jan 3, 2025
I've now submitted #366 which adds a
bindingssubcommand which just regenerates the bindings.@vados-cosmonic I also added some code to auto-generate the bindings as part of
cargo component new, which should improve the startup experience.I'm not opposed to larger changes, but I'm curious if these simple fixes are enough.
vados-cosmonic commentedon Jan 4, 2025
Hey @sunfishcode IMO that's perfect, thanks -- the
bindingssubcommand was more than enough, and thenewintegration sounds like it'll be a very ergonomic change.The README and related documentation should probably be changed to match as well, but I'm in favor of making that a separate, focused issue (so we can capture the parts to change, and maybe even do a bit of a docs overhaul for this crate).
Add a `bindings` subcommand. (bytecodealliance#366)
sunfishcode commentedon Jan 7, 2025
The new
bindingssubcommand andcargo component newimprovements are now released in cargo-component 0.20.