Skip to content

Commit

Permalink
Disable wgpu-core documentation as a workaround for gfx-rs#4905.
Browse files Browse the repository at this point in the history
This enables `cargo doc` to succeed in a reasonable amount of time,
as long as the reader isn't looking for documentation for `wgpu-core`
itself.
  • Loading branch information
kpreid committed Jul 18, 2024
1 parent 8aed6ed commit 905f7e4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ Bottom level categories:

## Unreleased

### Bug Fixes

#### General

- As a workaround for [issue #4905](https://github.com/gfx-rs/wgpu/issues/4905), `wgpu-core` is undocumented unless the `wgpu-core-doc` feature is enabled. By @kpreid in [#5987](https://github.com/gfx-rs/wgpu/pull/5987).

## 22.0.0 (2024-07-17)

### Overview
Expand Down
8 changes: 8 additions & 0 deletions wgpu-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ fragile-send-sync-non-atomic-wasm = [
"wgt/fragile-send-sync-non-atomic-wasm",
]

## Enable full documentation.
## If this feature is not enabled, `wgpu-core`'s documentation will be empty.
## This feature is a workaround for <https://github.com/rust-lang/rust/issues/114891>
## tracked in wgpu as <https://github.com/gfx-rs/wgpu/issues/4905>,
## to enable projects which do not need `wgpu-core` documentation to still use `cargo doc`
## practically. When that bug is fixed, this feature should be removed.
wgpu-core-doc = []

#! ### Backends, passed through to wgpu-hal
# --------------------------------------------------------------------

Expand Down
14 changes: 14 additions & 0 deletions wgpu-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
//! It is designed for integration into browsers, as well as wrapping
//! into other language-specific user-friendly libraries.
//!
#![cfg_attr(
not(any(not(doc), feature = "wgpu-core-doc")),
doc = "\
## Documentation hidden
As a workaround for [an issue in rustdoc](https://github.com/rust-lang/rust/issues/114891)
that [affects `wgpu-core` documentation builds \
severely](https://github.com/gfx-rs/wgpu/issues/4905),
the documentation for `wgpu-core` is empty unless built with
`cargo doc --features wgpu-core-doc`, which may take a very long time.
"
)]
#![cfg(any(not(doc), feature = "wgpu-core-doc"))]
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
//!
Expand Down

0 comments on commit 905f7e4

Please sign in to comment.