[ci] fix docsrs error for bdk crate#1011
Conversation
a8fe510 to
789cb99
Compare
| name = "mnemonic_to_descriptors" | ||
| path = "examples/mnemonic_to_descriptors.rs" | ||
| required-features = ["all-keys"] | ||
| doc-scrape-examples = true |
There was a problem hiding this comment.
I've never heard of this feature before. Interested to see how this works. Unfortunately our new examples are in their own crates so this won't work there.
There was a problem hiding this comment.
At least the bdk crate still has some code in it's own examples, and in the future it would be nice to put some simple examples in all the crates just to get the code added to the docs.
There was a problem hiding this comment.
Nevermind, I removed the doc-scrape-examples feature, can add back later if we want it.
| - name: Build docs | ||
| run: cargo doc --no-deps | ||
| env: | ||
| RUSTDOCFLAGS: '--cfg docsrs -Dwarnings' |
There was a problem hiding this comment.
shouldn't you keep -Dwarnings.
There was a problem hiding this comment.
The -Dwarnings isn't in the command that docs.rs uses so I left it off. I did confirm that with the new command string I added catches the feature(doc_cfg) issue when run locally or remotely. Also I can't see where in the docs that -Dwarnings is a flag that rustdoc cares about.
https://doc.rust-lang.org/cargo/commands/cargo-rustdoc.html
There was a problem hiding this comment.
Correction: it looks like --cfg docsrs and -Dwarnings are both flags passed through to rustc. I'm pretty sure other jobs like clippy will fail first, but doesn't hurt to add it here also. I added it back as part of the build.rustdocflags and force pushed.
There was a problem hiding this comment.
I rolled back all changes except the one I think really mattered which was adding #![cfg_attr(docsrs, feature(doc_cfg))] to bdk crate lib.rs.
If that's not enough to fix docs.rs I'll take another stab at it for the next alpha.
|
Ugh. Now with the |
e365778 to
f82be73
Compare
|
@LLFourn I simplified this down to just what should be needed to fix the original issue that was breaking the docs.rs rustdocs. Please approve if OK with you, this is the last thing before we can cut the alpha.1 release. |
LLFourn
left a comment
There was a problem hiding this comment.
LGTM thanks @notmandatory
Description
Fixes #955
Notes to the reviewers
#![cfg_attr(docsrs, feature(doc_cfg))]tobdkcrate lib.rs.Update nightly_docs workflow to use similar build command that docs.rs uses (and fails if above not done).For example docs artifact produced see: https://github.com/bitcoindevkit/bdk/actions/runs/5326442890Changelog notice
none
Checklists
All Submissions:
cargo fmtandcargo clippybefore committing