-
Notifications
You must be signed in to change notification settings - Fork 212
Next #131
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
This patch is adding `Metadata` type used in `cargo::ops::CompileOptions` to customize docs.rs builds. An example metadata in Cargo.toml: ```text [package] name = "test" [package.metadata.docs.rs] features = [ "feature1", "feature2" ] all-features = true no-default-features = true default-target = "x86_64-unknown-linux-gnu" rustc-args = [ "--example-rustc-arg" ] rustdoc-args = [ "--example-rustdoc-arg" ] dependencies = [ "example-system-dependency" ] ``` This patch is still work in progress and aiming to fix: #29, #48 and #50 - [ ] Save default target to database. - [ ] Install system dependencies before building a package.
This will significantly improve build times but it will use tons of more disk space
Docs.rs is never running rustc on main crate and because of this reason, cargo is ignoring rustdoc-args when rustc-args set. Users must define rustdoc-args to manipulate rustc.
latest_version function is now taking &Vec<String> instead of Json because of versions used in CrateDetails.
Why are |
@retep998 I have to build rust compiler for all tier one platforms myself and it is taking tremendous amount time. Is there any crate that only supports |
@onur The one case I can think of where the API of a crate would change is bindings to the CRT. MinGW and VC++ both provide a different CRT, MinGW using the ancient Does building the Rust compiler really take that long? I'd imagine you'd simply build the compiler once and have all the tier one platforms configured as targets, and each target only needs a standard library which should only take a few minutes. |
It's ultimately that msvc is the preferred target, so having the docs be for gnu is not great. |
One of my creates do not build on gnu ( https://github.com/gabdube/native-windows-gui ) . Its only because of a missing symbol (and I can create a workaround) but I guess the deeper you go in the winapi, the more likely these issues can popup. |
@onur oh one more thing; we should talk about what it would take to get you off of a custom rustdoc. Is there a particular reason you went with it this way instead of sending changes upstream? |
@steveklabnik my rustdoc is basically ignoring html_root_url from crate root and setting it to docs.rs even if its not defined. Also, I might be wrong but rustc only cares about @retep998 unfortunately building windows targets are only possible on a windows host, and apple targets requires apple host etc. I am using 3 different host machine to build rust compiler for all tier 1 platforms. It's just not automated like nightly builds and manual steps are taking too much time. But if I am not mistaken a windows-gnu host can build windows-msvc targets and it should be easy to add windows-msvc target. I'll add windows-msvc target again when I am free. |
We might; I'd want to talk about the details, but I'd much prefer that we extend rustdoc for your use-case than have you on a custom rust. |
This is pretty awesome work!
Huh, good, I am not blind. On another note: I see that the metadata supports only a default target. |
I re-enabled MSVC targets. |
Thanks for this. The intercrate linking is also really nice. |
This is first major upgrade to docs.rs
Container OS upgrade
External crate links
Docs.rs started using a slightly modified rust compiler. This compiler is setting
html_root_url
for all crates and it's dependencies. This is fixing every single external crate link (along with types, traits etc.) in documentations. To achieve this docs.rs is also using a slightly modified cargo.You can see this feature in documentation of CargoError implementors. Docs.rs is now resolving every external link properly.
Note:
i686-pc-windows-msvc
andx86_64-pc-windows-msvc
targets are no longer supported, docs.rs will try to build documentation fori686-pc-windows-gnu
andx86_64-pc-windows-gnu
targets for windows operating system.Non-default features
This is one of the most requested feature for docs.rs. You can now tell docs.rs to build documentation for the features you want. A simple
package.metadata.docs.rs
section in yourCargo.toml
will do the job:You can check docsrs-test crate for example.
Note:
default-target
is not implemented yet.Shared target directory
Docs.rs no longer builds every single dependency from scratch. It is using a shared
deps
directory to store all build artifacts. This change improved builds times significantly. A simple comparison from build logs of cargo crate:This allowed me to build entire crates.io-index in 5 days (only the latest versions of crates).
Crate details in navigation
You can see crate details in navigation:
I believe this is providing more essential information in documentations. It looks a bit odd in chrome, hope someone help to make it look better in major browsers.
Transition
cratesfyi-prefix
directory with the new one.Issues
RUSTDOCFLAGS
somehow #48