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

API for publishing documentation #93

Open
chris-zen opened this issue Dec 29, 2016 · 8 comments
Open

API for publishing documentation #93

chris-zen opened this issue Dec 29, 2016 · 8 comments
Labels
A-builds Area: Building the documentation for a crate C-enhancement Category: This is a new feature S-needs-design Status: There's a problem here, but no obvious solution; or the solution raises other questions

Comments

@chris-zen
Copy link

Currently, docs.rs is generating the documentation from crates.io which is very convenient, but there is a limitation to that, the project has to be compilable in a linux machine, which is not the case for all the libraries related to Windows or Mac OSX. There is a lot of effort ongoing in Rust to be a truly portable language across different operating systems, and it is an important limitation that a great service such as docs.rs for hosting documentation is not able to work with those non linux systems.

An idea to alleviate this limitation, would be to provide an API to publish the documentation that has been already generated by the authors of the libraries (using cargo doc in their non linux machine). Then it would be possible to add an extension to cargo to make the publishing as easy as it is to publish a release into crates.io. And why not, the already existing cargo publish could do the job of publishing the library into crates.io and the docs into docs.rs.

How does it sound ? Is it very difficult to achieve ?

@chris-zen
Copy link
Author

I just found this related issue at crates.io which is exactly what I was proposing here.
rust-lang/crates.io#91

@johalun
Copy link

johalun commented May 10, 2017

+1 for this. I just published a FreeBSD-only crate and realized I couldn't get any docs on docs.rs :(

@Kixiron
Copy link
Member

Kixiron commented May 27, 2020

Docs.rs now supports building across multiple targets which include Windows, OSX and Linux

@Kixiron Kixiron closed this as completed May 27, 2020
@jyn514
Copy link
Member

jyn514 commented May 27, 2020

@Kixiron this is not true. We always build on a host of linux, so if the crate has native dependencies only available on other platforms, the build will fail. We allow passing --target, which is not really related to this issue.

@jyn514 jyn514 reopened this May 27, 2020
@jyn514
Copy link
Member

jyn514 commented May 27, 2020

How does it sound ? Is it very difficult to achieve ?

The issue I would be concerned about is making sure that the documentation is not malicious/doesn't have javascript/etc. Ideally we'd have a way to verify that the documentation uploaded is the same as we would generate if we had a MacOS/FreeBSD/Windows host. Otherwise, it's easy to make mistakes where the documentation published isn't reproducible because it depends on something you had installed locally. Ideas about this are welcome!

@Kixiron
Copy link
Member

Kixiron commented May 27, 2020

Unfortunately due to how docker works, the most flexible host OS is Windows, which can run both Windows and Linux containers (but not at the same time which is fun) while every other host can just run its own platform. It's conceivable that if we decoupled the builder from the webserver we could run multiple independent builders (one windows, one linux, one mac) that all do their own target's documentation, but that would require 2-3 times the server costs (maybe more because some targets are more expensive)

@jyn514
Copy link
Member

jyn514 commented May 27, 2020

To be clear, I am not suggesting that docs.rs suddenly gain a (possibly unbounded) number of new hosts to build documentation on. I'm asking for ideas on how to make sure that uploaded docs are reproducible.

@Kixiron
Copy link
Member

Kixiron commented May 27, 2020

Yes, I was just giving the pros/cons of attempting to natively build most/every/whitelisted targets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-builds Area: Building the documentation for a crate C-enhancement Category: This is a new feature S-needs-design Status: There's a problem here, but no obvious solution; or the solution raises other questions
Projects
None yet
Development

No branches or pull requests

4 participants