-
Notifications
You must be signed in to change notification settings - Fork 299
"Upcoming docs.rs changes" #403
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e07ea49
ignore vim temporary files when searching for posts
pietroalbini d4f8e77
add post about the upcoming docs.rs changes
pietroalbini 5c6a99d
address some of the review comments
pietroalbini 3dec78f
update docs.rs breaking change date
pietroalbini eedcf8d
I'm bad at multitasking
pietroalbini 6ff3fb9
last fixes to the post
pietroalbini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
--- | ||
layout: post | ||
title: "Upcoming docs.rs changes" | ||
author: The Rust Infrastructure Team | ||
--- | ||
|
||
On September 30th breaking changes will be deployed to the [docs.rs] build | ||
environment. [docs.rs] is a free service building and hosting documentation for | ||
all the crates published on [crates.io]. It's [open source][docsrs-source], | ||
maintained by the [Rustdoc team][rustdoc-team] and operated by the | ||
[Infrastructure team][infra-team]. | ||
|
||
## What will change | ||
|
||
Builds will be executed inside the [rustops/crates-build-env] Docker image. | ||
That image contains a lot of system dependencies installed to ensure we can | ||
build as many crates as possible. It's already used by [Crater], and we added | ||
pietroalbini marked this conversation as resolved.
Show resolved
Hide resolved
|
||
all the dependencies previously installed in the legacy build environment. | ||
|
||
To ensure we can continue operating the service in the future and to increase | ||
its reliability we also improved the sandbox the builds are executed in, adding | ||
new limits: | ||
|
||
* Each platform will now have **15 minutes** to build its dependencies and | ||
documentation. | ||
* **3 GB of RAM** will be available for the build. | ||
* Network access will be **disabled** (crates.io dependencies will still be | ||
fetched). | ||
* Only the `target/` directory will be writable, and it will be purged after | ||
each build. | ||
|
||
Finally, docs.rs will now use the latest nightly available when building | ||
pietroalbini marked this conversation as resolved.
Show resolved
Hide resolved
|
||
crates, instead of using a manually updated pinned version of nightly. | ||
|
||
## How to prepare for the changes | ||
|
||
To test if your crate builds inside the new environment you can download the | ||
Docker image locally and execute a shell inside it: | ||
|
||
``` | ||
docker pull rustops/crates-build-env | ||
docker run --rm --memory 3221225472 -it rustops/crates-build-env bash | ||
``` | ||
|
||
Once you're in a shell you can install [rustup] (it's not installed by default | ||
in the image), install Rust nightly, clone your crate's repository and then | ||
build the documentation: | ||
|
||
``` | ||
time cargo doc --no-deps | ||
``` | ||
|
||
To aid your testing these commands will limit the available RAM to 3 GB and | ||
show the total execution time of `cargo doc`, but network access will not be | ||
blocked as you'll need to fetch dependencies. | ||
|
||
If your project needs a system dependency missing in the build environment, | ||
please [open an issue][crates-build-env-issue] on the Docker image's | ||
[repository][rustops/crates-build-env] and we'll consider adding it. | ||
|
||
If your crate fails to build because it took more than 15 minutes to generate | ||
its docs or it uses more than 3 GB of RAM please [open an issue][docsrs-issue] | ||
pietroalbini marked this conversation as resolved.
Show resolved
Hide resolved
|
||
and we will consider reasonable limit increases for your crate. We will **not** | ||
enable network access for your crate though: you'll need to change your crate | ||
not to require any external resource at build time. | ||
|
||
We recommend using [Cargo features] to remove the parts of the code causing | ||
build failures, enabling those features with [docs.rs metadata]. | ||
|
||
## Acknowledgements | ||
|
||
The new build environment is based on [Rustwide], the library powering | ||
[Crater]. It was extracted from the Crater codebase, and created both by the | ||
[Crater contributors] and the [Rustwide contributors]. | ||
|
||
The implementation work on the docs.rs side was done by [Pietro Albini][pietro] | ||
and [Onur Aslan][onur], with [QuietMisdreavus][misdreavus] and [Mark | ||
Rousskov][mark] reviewing the changes. | ||
|
||
[docs.rs]: https://docs.rs | ||
[crates.io]: https://crates.io | ||
[docsrs-source]: https://github.com/rust-lang/docs.rs | ||
[rustdoc-team]: https://www.rust-lang.org/governance/teams/dev-tools#rustdoc | ||
[infra-team]: https://www.rust-lang.org/governance/teams/operations#infra | ||
[rustops/crates-build-env]: https://hub.docker.com/r/rustops/crates-build-env | ||
[Crater]: https://github.com/rust-lang/crater | ||
[rustup]: https://rustup.rs | ||
[crates-build-env-issue]: https://github.com/rust-lang/crates-build-env/issues | ||
[docsrs-issue]: https://github.com/rust-lang/crates-build-env/issues | ||
[Cargo features]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section | ||
[docs.rs metadata]: https://docs.rs/about | ||
[rustwide]: https://github.com/rust-lang/rustwide | ||
[Crater contributors]: https://github.com/rust-lang/crater/graphs/contributors | ||
[Rustwide contributors]: https://github.com/rust-lang/rustwide/graphs/contributors | ||
[pietro]: https://github.com/pietroalbini | ||
[onur]: https://github.com/onur | ||
[mark]: https://github.com/Mark-Simulacrum | ||
[misdreavus]: https://github.com/QuietMisdreavus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rephrase this to emphasize the benefits first.
On September 30th, we'll be upgrading docs.rs to use a stronger sandbox when building documentation. This change is not expected to effect the vast majority of users, but it is technically a breaking change, so we want to be sure everyone is aware of it.
what is docs.rs?
[docs.rs] is a free service building and hosting documentation ... (as before)
What will change
...