Skip to content

Commit

Permalink
chore: mention fix for building docs in contributing guide (#3618)
Browse files Browse the repository at this point in the history
I ran into this when writing the docs for `Handle::block_on`. Seems to
be caused by a bug in cargo. Until that is fixed I think it makes sense
to mention it in the contributing guide.
  • Loading branch information
davidpdrsn committed Mar 16, 2021
1 parent f107c4f commit cc90a5c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,27 @@ arguments to many common cargo commands. This section lists some commonly needed
commands.

Some commands just need the `--all-features` argument:

```
cargo build --all-features
cargo check --all-features
cargo test --all-features
```

When building documentation normally, the markers that list the features
required for various parts of Tokio are missing. To build the documentation
correctly, use this command:

```
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features
```

There is currently a [bug in cargo] that means documentation cannot be built
from the root of the workspace. If you `cd` into the `tokio` subdirectory the
command shown above will work.

[bug in cargo]: https://github.com/rust-lang/cargo/issues/9274

The `cargo fmt` command does not work on the Tokio codebase. You can use the
command below instead:

Expand Down

0 comments on commit cc90a5c

Please sign in to comment.