Skip to content

Use --all-features for cargo publish #52

Description

@sirewix

It's unclear what --features param for cargo publish is used for. My hypothesis is that it's passed into cargo doc on the server side. cargo publish and cargo doc produce docs that miss feature gated items, see famedly_rust_utils for example. cargo doc --all-features includes all feature gated items but doesn't label them. Labeling can be achieved with #![feature(doc_auto_cfg)] which requires nightly compiler. My current suggestion is to use something like

#![cfg_attr(all(doc, not(doctest)), feature(doc_auto_cfg))]

this would require nightly compiler for cargo doc, but for everything else (including doctests) will not.

Moreover docs.rs supports some metadata in Cargo.toml, including

[package.metadata.docs.rs]
all-features = true

It is also documented that docs.rs uses nightly compiler by default.

As for the shipyard.rs it's quite unclear, I suppose we just need to test it.

There's no documentation on whether something like [package.metadata.docs.rs] exists for shipyard.rs, so I guess we can presume that it doesn't, and the only option is to try to simply pass --all-features to cargo publish in hope that it'll be bassed to cargo doc on shipyard side

Metadata

Metadata

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentation

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions