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

Documentation can't be generated on docs.rs for the wasmer-wasix crate #3776

Closed
Michael-F-Bryan opened this issue Apr 18, 2023 · 1 comment
Closed
Assignees
Labels
📚 documentation Do you like to read? 📦 lib-wasi About wasmer-wasi priority-medium Medium priority issue

Comments

@Michael-F-Bryan
Copy link
Contributor

Describe the bug

#3687 (in particular, 72c9d73) means the wasmer-wasix crate to no longer compile out of the box and users now are forced to set wasmer's sys or js flags explicitly.

This behaviour means the docs.rs page for wasmer-wasix v0.2.0 is broken.

Build Errors
[INFO] [stderr] error: At least the `sys` or the `js` feature must be enabled. Please, pick one.
[INFO] [stderr]    --> /opt/rustwide/cargo-home/registry/src/index.crates.io-6f17d22bba15001f/wasmer-3.2.0-beta.2/src/lib.rs:416:1
[INFO] [stderr]     |
[INFO] [stderr] 416 | compile_error!("At least the `sys` or the `js` feature must be enabled. Please, pick one.");
[INFO] [stderr]     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[INFO] [stderr] 
[INFO] [stderr] error[E0432]: unresolved import `crate::vm::VMExternRef`
[INFO] [stderr]  --> /opt/rustwide/cargo-home/registry/src/index.crates.io-6f17d22bba15001f/wasmer-3.2.0-beta.2/src/extern_ref.rs:9:5
[INFO] [stderr]   |
[INFO] [stderr] 9 | use crate::vm::VMExternRef;
[INFO] [stderr]   |     ^^^^^^^^^^^^^^^^^^^^^^ no `VMExternRef` in `vm`
[INFO] [stderr]   |
[INFO] [stderr] help: consider importing this struct instead
[INFO] [stderr]   |
[INFO] [stderr] 9 | use wasmer_vm::VMExternRef;
[INFO] [stderr]   |     ~~~~~~~~~~~~~~~~~~~~~~
[INFO] [stderr] 
[INFO] [stderr] error[E0432]: unresolved imports `crate::vm::VMExtern`, `crate::vm::VMExternFunction`, `crate::vm::VMFuncRef`, `crate::vm::VMFunctionBody`, `crate::vm::VMTrampoline`
[INFO] [stderr]  --> /opt/rustwide/cargo-home/registry/src/index.crates.io-6f17d22bba15001f/wasmer-3.2.0-beta.2/src/externals/function.rs:8:17
[INFO] [stderr]   |
[INFO] [stderr] 8 | use crate::vm::{VMExtern, VMExternFunction, VMFuncRef, VMFunctionBody, VMTrampoline};
[INFO] [stderr]   |                 ^^^^^^^^  ^^^^^^^^^^^^^^^^  ^^^^^^^^^  ^^^^^^^^^^^^^^  ^^^^^^^^^^^^ no `VMTrampoline` in `vm`
[INFO] [stderr]   |                 |         |                 |          |
[INFO] [stderr]   |                 |         |                 |          no `VMFunctionBody` in `vm`
[INFO] [stderr]   |                 |         |                 no `VMFuncRef` in `vm`
[INFO] [stderr]   |                 |         no `VMExternFunction` in `vm`
[INFO] [stderr]   |                 no `VMExtern` in `vm`
[INFO] [stderr]   |
[INFO] [stderr]   = help: consider importing this enum instead:
[INFO] [stderr]           wasmer_vm::VMExtern
[INFO] [stderr]   = help: consider importing this struct instead:
[INFO] [stderr]           wasmer_vm::VMFuncRef
[INFO] [stderr]   = help: consider importing this struct instead:
[INFO] [stderr]           wasmer_vm::VMFunctionBody
[INFO] [stderr]   = help: consider importing this type alias instead:
[INFO] [stderr]           wasmer_vm::VMTrampoline

Solution

The docs.rs backend will check for certain metadata in your Cargo.toml to see which feature flags should be enabled while building. We should use that to tell it the wasmer/sys flag should be enabled whenever documenting the wasmer-wasix crate.

@Michael-F-Bryan Michael-F-Bryan added 📚 documentation Do you like to read? 📦 lib-wasi About wasmer-wasi labels Apr 18, 2023
@Michael-F-Bryan Michael-F-Bryan added the priority-medium Medium priority issue label Apr 18, 2023
@ptitSeb
Copy link
Contributor

ptitSeb commented Apr 25, 2023

Doc is generated now, closing.

@ptitSeb ptitSeb closed this as completed Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 documentation Do you like to read? 📦 lib-wasi About wasmer-wasi priority-medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

2 participants