Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs.rs for dependent crates seems broken #1295

Closed
mbillingr opened this issue May 29, 2018 · 5 comments
Closed

docs.rs for dependent crates seems broken #1295

mbillingr opened this issue May 29, 2018 · 5 comments
Labels

Comments

@mbillingr
Copy link

mbillingr commented May 29, 2018

I just published a new version of a crate that depends on serde, and noticed that the documentation went missing. Here is the build log: https://docs.rs/crate/arff/0.2.0/builds/101512.

Compiling serde v1.0.63
Running rustc --crate-name serde .cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.63/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="std"' --cfg 'feature="default"' -C metadata=f2d60ad5195a964a -C extra-filename=-f2d60ad5195a964a --out-dir /home/cratesfyi/cratesfyi/debug/deps -L dependency=/home/cratesfyi/cratesfyi/debug/deps --cap-lints allow --cfg de_boxed_c_str --cfg de_rc_dst --cfg integer128
error[E0658]: 128-bit type is unstable (see issue #35118)

(excerpt)

I do not use 128 bit integers and did not enable them (at least not intentionally). Running the test suite and building the docs works on CI and locally.

No idea what's going on there :) I'm not even really sure this is an issue with serde, but no other dependencies are affected as far I can tell.

Cheers

P.S.: Looks like other recently upgraded crates are affected too (e.g. validator, rkv)

@mbillingr mbillingr changed the title Documentation of dependent crates seems broken docs.rs for dependent crates seems broken May 29, 2018
@hcpl
Copy link
Contributor

hcpl commented May 29, 2018

Related commit: c81bab1.

I think the fix should have used a Cargo feature instead of a rustc cfg to allow downstream crates to use it when building on docs.rs. Like:

[package.metadata.docs.rs]
features = ["serde/docs_rs_temporary_workaround"]

@hcpl
Copy link
Contributor

hcpl commented May 29, 2018

I do not use 128 bit integers and did not enable them (at least not intentionally). Running the test suite and building the docs works on CI and locally. No idea what's going on there :)

@mbillingr if you don't mind, I'd prefer explaining this whole situation with a timeline (using YYYY.MM.DD format to eliminate confusions):

  • 2018.03.16: the rustc version docs.rs is using now is nightly-2018-03-16 (you can see that from build logs).
  • 2018.03.27: i128 support has been stabilized; this occurred when nightly was 1.26.
  • 2018.03.29: Rust 1.25 was released and Rust 1.26 became beta.
  • 2018.05.10: Rust 1.26 was released which contains features people were yearning for: 128-bit integers as primitive types, impl Trait, inclusive range ..= syntax and more. For the full list of new features see https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1250-2018-03-29.
  • Since 2018.05.10 till today: as the aforementioned features finally became stable, people started to use them in many places -- because they are very convenient. Which means bumping the minimal stable Rust version that is able to compile their code to 1.26.
    On the other side of the coin, libraries that work with numerical primitives have to support new {i,u}128 types. If not, these libraries will likely annoy those who expect the support already and confuse those not familiar with the history of Rust. This also produces a chain effect by blocking dependent libraries from accessing the new types at all and the more "core" the library is the more widespread the effect will be. serde is definitely one of these -- which prompted implementing i128 & u128 support for it too.

Seems like the natural progression of a language to make code work better and look prettier -- and this makes people happy.

Alas, there is a roadblock: the rustc version on docs.rs hasn't been updated since 2018.03.16! The code uploaded to docs.rs justifiably assumes docs.rs to have at least the latest stable Rust, or even better, the latest nightly (it includes everything the latest stable is capable of). As you witnessed yourself, this is not the case. Many people have already reported this to https://github.com/onur/docs.rs/issues/23.

Thankfully, the work needed to fix this is ongoing: there is a PR filed to docs.rs repo to update its Rust version: https://github.com/onur/docs.rs/pull/207. But it it unknown when the PR gets merged. Time will tell.

@mbillingr
Copy link
Author

@hcpl thank you for the detailed explanation. I had not realized docs.rs was using an old version of rustc (somehow focussing on the 1.26 part and missing the 2018-03-16).

I guess the issue can be closed, or maybe you want to leave it open for now as a landing pad for other misguided souls?

@dtolnay
Copy link
Member

dtolnay commented May 30, 2018

I published Serde 1.0.64 with a workaround that should make this work. To confirm, I published a version of serde_json and it seems to have built successfully in docs.rs. Thanks all!

Before: https://docs.rs/serde_json/1.0.18/serde_json/
After: https://docs.rs/serde_json/1.0.19/serde_json/

@dtolnay dtolnay closed this as completed May 30, 2018
@hcpl
Copy link
Contributor

hcpl commented May 30, 2018

@mbillingr anyone may copy around my comment (#1295 (comment)) to spread the information if they wish so. Or they can just link to the comment which also works.

@dtolnay oh wow -- 34a7108#diff-beade9a1819c15eaafbb1eb58aca7e3bR57 -- that's a nice trick, I like it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants