Skip to content
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

Failure to build component containing flags shape #119

Closed
eduardomourar opened this issue Aug 19, 2023 · 3 comments · Fixed by #122
Closed

Failure to build component containing flags shape #119

eduardomourar opened this issue Aug 19, 2023 · 3 comments · Fixed by #122

Comments

@eduardomourar
Copy link
Contributor

I am using cargo-component from commit 29fea4a.

While trying to build a component that contains a flags shape (example here), the following error is presented (reproduced here):

error[E0433]: failed to resolve: use of undeclared crate or module wit_bindgen
--> src/lib.rs:1:1
|
1 | cargo_component_bindings::generate!();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared crate or module wit_bindgen
|
= note: this error originates in the macro cargo_component_bindings::generate (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0412]: cannot find type Permissions in this scope
--> src/lib.rs:1:1
|
1 | cargo_component_bindings::generate!();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
|
= help: consider importing this struct:
std::fs::Permissions
= note: this error originates in the macro cargo_component_bindings::generate (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared type Permissions
--> src/lib.rs:1:1
|
1 | cargo_component_bindings::generate!();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type Permissions
|
= help: consider importing this struct:
std::fs::Permissions
= note: this error originates in the macro cargo_component_bindings::generate (in Nightly builds, run with -Z macro-backtrace for more info)

@peterhuene
Copy link
Member

It looks like I might have missed a place where the generated code was assuming wit_bindgen for the runtime path.

I'll get this fixed in upstream wit-bindgen and resolve this issue once we get it patched.

@peterhuene
Copy link
Member

peterhuene commented Aug 19, 2023

This line is the problem. Looks like we should also be reexporting bitflags from cargo_component_bindings as well.

@peterhuene
Copy link
Member

I've put up bytecodealliance/wit-bindgen#645 to address this; once that merges, a small change is required to cargo-component to resolve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants