While browsing through the Cranelift documentation, I noticed that public docs are only available for the host architecture, specifically x64
. I assume this is because crates.io publishes documentation for Wasmtime as a whole rather than for individual crates. When compiling the docs locally using cargo doc --open
for Wasmtime, it generates host-specific documentation, whereas Cranelift produces docs for all architectures.
Is there a plan to switch to publishing individual crate documentation?
I assume this is because crates.io publishes documentation for Wasmtime as a whole rather than for individual crates.
It is actually for the exact opposite reason. Docs on docs.rs are generated for each individual crate. Cranelift-codegen doesn't specify that the all-arch feature should be enabled when building docs on docs.rs. When doing a local doc build however, feature unification likely causes the all-arch enable at https://github.com/bytecodealliance/wasmtime/blob/6a5a4f272a1788617308c36a34eb6dc3442e2b24/cranelift/Cargo.toml#L53 to be picked up when documenting cranelift-codegen.
Does this mean that feature unification is not enabled when building on docs.rs? Would it make sense to customize docs.rs builds in this case?
Docs.rs documents a crate at a time, while locally you generally document a whole workspace at once. Feature unification only applies when everything gets done in a single cargo invocation.
Would it make sense to customize docs.rs builds in this case?
Yes
we should do all features for docs.rs plus the nightly attribute to doc required features, the same way we do in wasmtime
would love to approve + merge a PR doing this for cranelift, if you'd like to make one!
Sure, I’ve just submitted a PR for this: https://github.com/bytecodealliance/wasmtime/pull/9493
Quick question – the PR was merged a week ago, but the docs (for cranelift-codegen
) published on crates.io still don't seem to reflect the changes. Did I miss something?
crates.io contains only published crates (and docs.rs shows docs for published crates); there hasn't been a release since your PR was merged. Our release process is to cut a release branch on the 5th of the month, let it stabilize (watch for fuzzbugs), and release that branch on the 20th; so your PR should go out in our release on Nov 20th.
Oh Ok. Thank you.
Last updated: Nov 22 2024 at 16:03 UTC