Closed
Description
Crate name: geozero
Build failure link: https://docs.rs/crate/geozero/0.7.2/builds/355163
Additional details:
geozero has the following Cargo.toml entry:
[package.metadata.docs.rs]
all-features = true
rustc-args = ["--cfg", "docsrs"]
cfg(docsrs)
is required for a doc.rs build of the dependency gdal
: https://github.com/georust/gdal/blob/master/build.rs#L3
The failing tokio-stream
crate does in fact set a feature twice based on docsrs
: https://github.com/tokio-rs/tokio/blob/master/tokio-stream/src/lib.rs#L17-L23
But a local doc build is successful!
Activity
jyn514 commentedon Feb 27, 2021
This should be reported upstream to Tokio, we can't fix it on our end.
Local builds don't pass --cfg docsrs by default.
Nemo157 commentedon Feb 27, 2021
There is a bug somewhere here since
tokio-stream
successfully built its docs, and it appears to activate the cfg for its build. Mayberustdoc
allows duplicate features, whilerustc
doesn't?pka commentedon Feb 27, 2021
PR: tokio-rs/tokio#3561
I tried to imitate docs.rs build with
cargo +nightly doc --all-features --config 'build.rustflags=["--cfg", "docsrs"]' -Z unstable-options
Am I missing something?
Nemo157 commentedon Feb 27, 2021
I've opened rust-lang/rust#82588 for the rustdoc bug that allowed
tokio-stream
's docs to succeed.Using
cargo +nightly doc --all-features --config 'build.rustflags=["--cfg", "docsrs"]' -Z unstable-options
on a crate that depends ontokio-stream
I get the build failure, but at least on my machine I had to overrideCARGO_HOME
for it to avoid loading my~/.cargo/config
, which setstarget.x86_64-unknown-linux-gnu.rustflags
overriding thebuild.rustflags
config.pka commentedon Feb 27, 2021
So nothing else to be done here, I think. Thanks @jyn514 and @Nemo157 for looking into it!