-
Notifications
You must be signed in to change notification settings - Fork 48
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
Build Failure with Inline WIT with wit-bindgen
#188
Comments
Could you provide the build error you're encountering? |
The guest project is missing the package metadata that marks it as a component project; currently If you add |
Ah sorry I forgot to add this 🤦
It does! However, would cargo component be willing to change this behaviour and add the component metadata no matter if the The reason being is that:
|
Why wouldn't they use Alternatively, they could just use a template you create so you can embed your |
It would indeed be nice, however it also generates the wit directory, and adds cargo-component-rust to the dependencies, etc. These things aren't needed in my case. I don't want them to be concerned with wit files or anything like that, as my library handles it all.
Also a nice idea, but I wanted to keep things as simple as possible for them. So it's just a regular rust crate, and they need As I mentioned, isn't it a little strange to have the behaviour of the |
With Please review the release notes as there were quite a few breaking changes relating to bindings in that release. |
Description
There's an inconsistency when building a project with inline WIT definitions using
cargo component build
. It fails undercargo component
but succeeds when manually building withcargo
andwasm-tools
withwit-bindgen
given the followinglib.rs
:Reproduction Steps
Manual Build with Cargo and wasm-tools
wasm32-wasi
target:Hello, World!
message:Build with Cargo Component
cargo component
:Expected Behavior
Both build methods should successfully compile and run the project, displaying
Hello, World!
regardless if we use awit
directory withcargo_component_bindings
orwit-bindgen
.Actual Behavior
The build succeeds with manual steps but fails with
cargo component
.Additional Information
Repository Link: GitHub Repository
Is this intended behaviour?
I think it would be ideal if we can just use cargo component with wit-bindgen as an easy way of building wasm components, though it seems like we need to stick to the structure of having a
wit
directory along side oursrc
directory.The text was updated successfully, but these errors were encountered: