Fix builds on docs.rs and document all features
Gir no longer generates a dox feature for building the documentation without linking the libraries. Because of that the entry for [package.metadata.docs.rs]
in the Cargo.toml
file needs to be changed a little bit for the builds to succeed. Even though gstreamer itself does not use docs.rs for its documentation, many smaller projects do. If the builds fail for gstreamer on docs.rs, all builds from crates that depend on gstreamer also fail and they would not be able to use docs.rs.
This is what the correct entry in the Cargo.toml usually should look like (source):
[package.metadata.docs.rs]
all-features = true
# For build.rs scripts
rustc-args = ["--cfg", "docsrs"]
# For rustdoc
rustdoc-args = ["--cfg", "docsrs"]
Since https://github.com/gtk-rs/gir/pull/1487 was merged, all you have to do for the -sys crates to have the correct entry, is to remove features = []
from [package.metadata.docs.rs]
. Gir will then replace it with all-features=true
and activate the required rustc args and rustdoc args.
The Cargo.toml file of the safe wrapper crates will not be changed by gir, so they need to be changed manually.