Skip to content

rustdoc: add --minimum-supported-rust-version option #96028

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

Conversation

GuillaumeGomez
Copy link
Member

The end goal is of course to make cargo directly pass this option to rustdoc based on its rust-version field.

It currently looks like this:

Screenshot from 2022-04-13 22-25-08

cc @Manishearth
r? @jsha

@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Apr 13, 2022
@rust-highfive
Copy link
Contributor

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez,@Folyd,@jsha

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 13, 2022
@GuillaumeGomez GuillaumeGomez changed the title Minimum supported rust version rustdoc: add --minimum-supported-rust-version option Apr 13, 2022
@GuillaumeGomez GuillaumeGomez added the A-rustdoc-ui Area: Rustdoc UI (generated HTML) label Apr 13, 2022
@Manishearth
Copy link
Member

Is this on every page or just the crate root? I'm not sure if it should be prominently on every page

@GuillaumeGomez
Copy link
Member Author

Only the crate root. I added a test to ensure it was only there too here. I also think that it should be only on the crate page (@jsha seems to agree too based on the zulip discussion).

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the minimum-supported-rust-version branch from 5ea7a05 to 70203b7 Compare April 13, 2022 22:23
@notriddle
Copy link
Contributor

notriddle commented Apr 14, 2022

In short, I'm against this. It seems like you're choosing to make the MSRV the most prominently-shown dependency of a crate because of how easy it is to do, instead of choosing to make the most important dependency the prominent one.

The Rust compiler dependency is the least important dependency, because we ($DAYJOB) aren't actually shipping the compiler (except libstd, I suppose), and because upgrading the compiler is generally quite safe. The compiler itself only matters to our devops people and customers as long as it can produce binaries that run on an LTS build of Ubuntu Server and all currently-supported versions of Windows, which have never been a problem. Bumping the compiler version just works every time we've done it, thanks to the Rust Project's terrific quality control.

The same cannot be said for every random crate you find on crates.io. Those are the dependencies we actually care about, because we need to vet them ourselves, and know enough about what they do to be able to fork them or switch away from them if something happens. Cargo makes it easy to add crate dependencies, but it doesn't actually solve the QA problems. cargo tree is really nice; it should be official.

The most important dependency, for many projects, is the list of supported operating systems. More often than not, you're locked into a particular OS, and a crate that fails to support it is an instant deal-breaker. Our customers overwhelmingly use Windows workstations, while we deploy Linux servers, and no crate is valuable enough to be worth switching.

In short, when evaluating a crate, the dependencies I actually care about are, in order: supported OS, required C libraries, required Rust libraries, and finally MSRV.

@Manishearth
Copy link
Member

Honestly I kinda feel like it should be a part of the docs.rs ribbon UI biut otherwise not in rustdoc. But I'd like to hear from @jsha

@GuillaumeGomez
Copy link
Member Author

The problem is that not crates use docs.rs for their documentation (cc gtk-rs), so if it's on docs.rs, why not directly in rustdoc? But @notriddle's arguments against it make sense too.

@Manishearth
Copy link
Member

Manishearth commented Apr 15, 2022

@GuillaumeGomez Right, I know, but balanced against notriddle's concerns, I feel like docs.rs is a place where we can solve this problem 99% of the time without hitting the same concerns.

People generating their own docs can also do something similar to docs.rs and embed them with a header. I do not think we should offer everything people may want in their own docs as a feature.

@GuillaumeGomez
Copy link
Member Author

Let's close it for the time being then. :)

@GuillaumeGomez GuillaumeGomez deleted the minimum-supported-rust-version branch April 15, 2022 18:10
@jsha
Copy link
Contributor

jsha commented Apr 15, 2022

I'm in agreement with @notriddle and @Manishearth. I think @notriddle expressed it quite well, but to add my own words:

This is useful information, and is thematically very similar to the rest of the information on the crate page on docs.rs (https://docs.rs/crate/rustls/latest): features, homepage, repository, dependencies, README. All of this stuff is available at rustdoc build time. In theory rustdoc could generate that page; as far as I know it's an accident of implementation that docs.rs generates it instead of rustdoc.

I see your point about self-hosted rustdoc instances like https://docs.serde.rs/ and https://gtk-rs.org/gtk-rs-core/stable/latest/docs/glib/index.html. But I think focusing on MSRV misses the point. Self-hosted rustdoc would benefit from having all the information from the crate page on docs.rs. And some of that information is much more useful and important than MSRV. If we want to make self-hosted docs more informative, let's make that a project, to reproduce the crate page from docs.rs (and maybe docs.rs could then phase out its version?). It still might not be a huge priority, but I think that's a more sensible place to put MSRV.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants