Skip to content

Release docs.rs publishing#33

Merged
gregnazario merged 3 commits intomainfrom
cursor/release-docs-rs-publishing-4917
Feb 10, 2026
Merged

Release docs.rs publishing#33
gregnazario merged 3 commits intomainfrom
cursor/release-docs-rs-publishing-4917

Conversation

@gregnazario
Copy link
Contributor

Configure docs.rs metadata, update doc attributes, and align CI/release workflows to enable successful documentation publishing to docs.rs.

This PR addresses several issues: redundant doc(cfg) annotations due to doc_auto_cfg (now part of doc_cfg on nightly), missing docs.rs metadata for aptos-sdk-macros, lack of check-cfg for docsrs, and CI/release workflow inconsistencies with docs.rs build environments. It also includes a fix for the aptos-codegen binary to ensure --all-features builds pass.


Open in Cursor Open in Web

- Replace redundant manual doc(cfg(...)) annotations with doc_auto_cfg
  (merged into doc_cfg on nightly 1.92+, which docs.rs uses)
- Add [package.metadata.docs.rs] to aptos-sdk-macros crate
- Add targets = ["x86_64-unknown-linux-gnu"] to docs.rs metadata for
  both crates to speed up builds
- Add [lints] workspace config with check-cfg for docsrs to prevent
  unexpected_cfgs warnings
- Both crates inherit workspace lints
- Update CI docs job to use nightly with --cfg docsrs for docs.rs parity
- Update release workflow verify step to test docs build with nightly
  and --cfg docsrs, matching what docs.rs will use
- Fix aptos-codegen binary to use current_thread tokio runtime
  (was failing with --all-features due to missing rt-multi-thread)

Co-authored-by: Greg Nazario <greg@gnazar.io>
@cursor
Copy link

cursor bot commented Feb 10, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@gregnazario gregnazario marked this pull request as ready for review February 10, 2026 16:07
The rust-toolchain.toml specifies channel = "1.90" (stable), which
overrides the nightly toolchain installed by dtolnay/rust-toolchain.
Since feature(doc_cfg) requires nightly, all cargo doc commands in CI
must explicitly use +nightly to bypass the toolchain file override.

Co-authored-by: Greg Nazario <greg@gnazar.io>
The docsrs cfg is only passed as a rustdoc flag, not a rustc flag, so
the unexpected_cfgs lint never fires during normal compilation. The
cfg_attr(docsrs, ...) in lib.rs simply evaluates to false when docsrs
is not set, without triggering any warnings.

Co-authored-by: Greg Nazario <greg@gnazar.io>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Aligns crate metadata, doc configuration, and CI/release workflows so aptos-sdk (and aptos-sdk-macros) build documentation successfully in a docs.rs-like environment.

Changes:

  • Add/align package.metadata.docs.rs (and workspace lints) so docs.rs builds use --cfg docsrs and don’t warn on cfg(docsrs).
  • Remove redundant #[cfg_attr(docsrs, doc(cfg(...)))] annotations in favor of centralized docs.rs configuration.
  • Update CI/release workflows to run docs builds with nightly and --cfg docsrs, and adjust aptos-codegen tokio runtime configuration.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/aptos-sdk/src/transaction/authenticator.rs Removes docs.rs-only doc(cfg(...)) attributes for the keyless-gated API.
crates/aptos-sdk/src/lib.rs Removes docs.rs-only doc(cfg(...)) attribute for the macros re-export.
crates/aptos-sdk/src/bin/codegen.rs Uses #[tokio::main(flavor = "current_thread")] for the codegen binary.
crates/aptos-sdk/src/account/ed25519.rs Removes docs.rs-only doc(cfg(...)) attributes for mnemonic-gated APIs.
crates/aptos-sdk/Cargo.toml Enables workspace lints + adds docs.rs metadata (all-features, docsrs cfg, target).
crates/aptos-sdk-macros/Cargo.toml Enables workspace lints + adds docs.rs metadata (all-features, docsrs cfg, target).
Cargo.toml Adds workspace rust lint config for unexpected_cfgs with check-cfg for docsrs.
.github/workflows/release.yml Adds nightly docs build parity step using --cfg docsrs and cargo +nightly doc.
.github/workflows/ci.yml Switches docs checks to nightly + docsrs cfg; adds macros docs check.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.90"
- name: Install Rust nightly (required for doc_auto_cfg and docs.rs parity)
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow text says nightly is required for doc_auto_cfg, but there’s no #![feature(doc_auto_cfg)] usage anywhere in the repo (aptos-sdk only enables doc_cfg under docsrs). Consider renaming this step to reference doc_cfg (or enable doc_auto_cfg if that’s what you intended to rely on).

Suggested change
- name: Install Rust nightly (required for doc_auto_cfg and docs.rs parity)
- name: Install Rust nightly (required for doc_cfg/docs.rs parity)

Copilot uses AI. Check for mistakes.
Comment on lines +172 to 174
- name: Install Rust nightly (required for doc_auto_cfg feature)
uses: dtolnay/rust-toolchain@nightly

Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step name mentions doc_auto_cfg, but the codebase doesn’t appear to use #![feature(doc_auto_cfg)] (only doc_cfg is enabled for docsrs). Updating the step name to match the actual feature being used would avoid confusion.

Copilot uses AI. Check for mistakes.
@gregnazario gregnazario merged commit eab7f5f into main Feb 10, 2026
14 checks passed
@gregnazario gregnazario deleted the cursor/release-docs-rs-publishing-4917 branch February 10, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants