Skip to content

chore: Fix docs.rs build failure - #95

Closed
Bravo555 wants to merge 1 commit into
cobalt-org:masterfrom
Bravo555:chore/fix-docsrs-build
Closed

chore: Fix docs.rs build failure#95
Bravo555 wants to merge 1 commit into
cobalt-org:masterfrom
Bravo555:chore/fix-docsrs-build

Conversation

@Bravo555

Copy link
Copy Markdown

kstring fails to build on docs.rs because feature doc_auto_cfg was removed from nightly in 1.92.0.
Replace it with doc_cfg.

Fix can be verified using RUSTFLAGS="--cfg docsrs" cargo +nightly-2025-11-28 check

kstring fails to build on docs.rs[1] because feature `doc_auto_cfg` was
removed from nightly in 1.92.0.
Replace it with `doc_cfg`.

[1]: https://docs.rs/crate/gstreamer/latest/builds/2623006

Signed-off-by: Marcel Guzik <mguzik555@gmail.com>
@epage

epage commented Dec 1, 2025

Copy link
Copy Markdown
Member

For verifying this, you recommend

$ RUSTFLAGS="--cfg docsrs" cargo +nightly-2025-11-28 check

In your Cargo.toml, you have:

[package.metadata.docs.rs]
all-features = true
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"]

Is there a reason you are using RUSTFLAGS / rustc-args for this? RUSTFLAGS applies to you and all of your dependencies. RUSTDOCFLAGS / rustdoc-args applies to just the packages being documented.

The reason I'm pushing back on this is because this maintains a brittle state where your ability to be documented is dependent on whether a nightly feature was broken in any of your dependencies that uses it. So far when I've asked about this for any of my packages, no one has had a need for me to merge a fix and publish it. Yes, I'll eventually need to fix this but it is fixed in my repo template and will be propagated here next time I update from the template.

@Bravo555

Bravo555 commented Dec 2, 2025

Copy link
Copy Markdown
Author

Is there a reason you are using RUSTFLAGS / rustc-args for this? RUSTFLAGS applies to you and all of your dependencies. RUSTDOCFLAGS / rustdoc-args applies to just the packages being documented.

The reason I'm pushing back on this is because this maintains a brittle state where your ability to be documented is dependent on whether a nightly feature was broken in any of your dependencies that uses it. So far when I've asked about this for any of my packages, no one has had a need for me to merge a fix and publish it.

I see, the problem was with gstreamer-rs reapplying the docsrs feature to dependencies when building, which they seem to have already fixed when I made this issue and now it fails to build for a different reason. So the problem was not in kstring and I just didn't understand how docsrs build process works. Sorry for making noise!

I'll close the issue since it's not blocking anything and you are aware of the feature rename and have the fix ready in the template. Thanks for the clarification!

@Bravo555 Bravo555 closed this Dec 2, 2025
@epage

epage commented Dec 2, 2025

Copy link
Copy Markdown
Member

Note that docs.rs automatically adding that cfg is relatively new (from the summer?) and people are likely not to have heard of it.

@Bravo555
Bravo555 deleted the chore/fix-docsrs-build branch December 3, 2025 10:02
epage added a commit that referenced this pull request Aug 25, 2026
This causes enough issues with zizmor
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.

2 participants