Skip to content

Use the standard docsrs cfg instead of our own docs feature - #492

Merged
mxpv merged 1 commit into
mainfrom
docs
Sep 4, 2026
Merged

Use the standard docsrs cfg instead of our own docs feature#492
mxpv merged 1 commit into
mainfrom
docs

Conversation

@mxpv

@mxpv mxpv commented Sep 3, 2026

Copy link
Copy Markdown
Member

docs.rs has failed to build containerd-shim since v0.7.0 (0.6.0 is the last release with published docs):

error[E0658]: `#[doc(cfg)]` is experimental
  --> src/lib.rs:77:32
   |
77 | #[cfg_attr(docsrs, doc(cfg(not(feature = "async"))))]

doc(cfg) requires #![feature(doc_cfg)] at the crate root, which was never added. docs.rs is the only place that builds with --cfg docsrs, so the attribute activates there and nowhere else, and every local and CI build kept passing.

  • Add #![cfg_attr(docsrs, feature(doc_cfg))] to the shim crate root. This fixes the broken docs publishing.

  • Replace our own docs feature with the docsrs cfg that docs.rs sets automatically [1]. Both gated the same thing, the README include, so there is no reason to carry a second toggle for it. The [package.metadata.docs.rs] blocks go away with it.

Both doc jobs now run on nightly with --cfg docsrs, matching what docs.rs actually invokes, so this cannot regress unnoticed again.

[1] https://docs.rs/about/builds

docs.rs has failed to build `containerd-shim` since v0.7.0 (0.6.0 is the
last release with published docs):

    error[E0658]: `#[doc(cfg)]` is experimental
      --> src/lib.rs:77:32
       |
    77 | #[cfg_attr(docsrs, doc(cfg(not(feature = "async"))))]

`doc(cfg)` requires `#![feature(doc_cfg)]` at the crate root, which was
never added. docs.rs is the only place that builds with `--cfg docsrs`,
so the attribute activates there and nowhere else, and every local and
CI build kept passing.

- Add `#![cfg_attr(docsrs, feature(doc_cfg))]` to the shim crate root.
  This fixes the broken docs publishing.

- Replace our own `docs` feature with the `docsrs` cfg that docs.rs
  sets automatically [1]. Both gated the same thing, the README
  include, so there is no reason to carry a second toggle for it. The
  `[package.metadata.docs.rs]` blocks go away with it.

Both doc jobs now run on nightly with `--cfg docsrs`, matching what
docs.rs actually invokes, so this cannot regress unnoticed again.

[1] https://docs.rs/about/builds
@github-actions github-actions Bot added C-shim-protos Shim protos C-shim Containerd shim C-logging Shim logging C-client Containerd client C-snapshots Remote snapshotter C-runc runc helper T-CI Changes in project's CI labels Sep 3, 2026
@mxpv
mxpv requested a review from a team September 3, 2026 02:00
@mxpv
mxpv added this pull request to the merge queue Sep 4, 2026
Merged via the queue into main with commit d3960fa Sep 4, 2026
30 checks passed
@mxpv
mxpv deleted the docs branch September 4, 2026 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-client Containerd client C-logging Shim logging C-runc runc helper C-shim Containerd shim C-shim-protos Shim protos C-snapshots Remote snapshotter T-CI Changes in project's CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants