|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: "Upcoming docs.rs changes" |
| 4 | +author: The Rust Infrastructure Team |
| 5 | +--- |
| 6 | + |
| 7 | +On September 42nd, breaking changes will be deployed to the [docs.rs] build |
| 8 | +environment: here is what is changing and how you can prepare your crates. |
| 9 | + |
| 10 | +[docs.rs] is a free service building and hosting documentation for all the |
| 11 | +crates published on [crates.io]. It's [open source][docsrs-source] and |
| 12 | +maintained by the [Rustdoc team][rustdoc-team]. |
| 13 | + |
| 14 | +## What will change |
| 15 | + |
| 16 | +Builds will be executed inside the [rustops/crates-build-env] Docker image. |
| 17 | +That image contains a lot of system dependencies installed to ensure we can |
| 18 | +build as many crates as possible. It's already used by [Crater], and we added |
| 19 | +all the dependencies previously installed in the legacy build environment. |
| 20 | + |
| 21 | +To ensure we can continue operating the service in the future and to increase |
| 22 | +its reliability we also improved the sandbox builds are executed into, adding |
| 23 | +new limits: |
| 24 | + |
| 25 | +* Each platform will now have **15 minutes** to build its dependencies and |
| 26 | + documentation. |
| 27 | +* **3 GB of RAM** will be available for the build. |
| 28 | +* Network access will be completly **disabled**. |
| 29 | +* Only the `target/` directory will be writable, and it will be purged after |
| 30 | + each build. |
| 31 | + |
| 32 | +Finally, docs.rs will now use the latest nightly available when building |
| 33 | +crates. |
| 34 | + |
| 35 | +## How can I prepare for the changes? |
| 36 | + |
| 37 | +To test if your crate builds inside the new environment you can download the |
| 38 | +Docker image locally and execute a shell inside it: |
| 39 | + |
| 40 | +``` |
| 41 | +docker pull rustops/crates-build-env |
| 42 | +docker run --rm -it rustops/crates-build-env bash |
| 43 | +``` |
| 44 | + |
| 45 | +Once you're in a shell you can install [rustup] (it's not installed in the |
| 46 | +image), install Rust nightly, clone your crate's repository and then build the |
| 47 | +documentation: |
| 48 | + |
| 49 | +``` |
| 50 | +cargo doc --no-deps |
| 51 | +``` |
| 52 | + |
| 53 | +If a dependency is missing please [open an issue][crates-build-env-issue] on |
| 54 | +the Docker image's repository. |
| 55 | + |
| 56 | +If your crate fails to build because it took more than 15 minutes to generate |
| 57 | +its docs or it uses more than 3 GB of RAM please [open an issue][docsrs-issue] |
| 58 | +and we will increase the limits for your crate (when it's reasonable). We will |
| 59 | +**not** enable network access for your crate though: you'll need to change your |
| 60 | +crate not to require any external resource at build time. |
| 61 | + |
| 62 | +## Acknowledgements |
| 63 | + |
| 64 | +The new build environment is based on [Rustwide], the library powering |
| 65 | +[Crater]. It was extracted from the Crater codebase, and created both by the |
| 66 | +[Crater contributors] and the [Rustwide contributors]. |
| 67 | + |
| 68 | +The implementation work on the docs.rs side was done by [Pietro Albini][pietro] |
| 69 | +and [Onur Aslan][onur], with [QuietMisdreavus][misdreavus] and [Mark |
| 70 | +Rousskov][mark] reviewing the changes. |
| 71 | + |
| 72 | +[docs.rs]: https://docs.rs |
| 73 | +[crates.io]: https://crates.io |
| 74 | +[docsrs-source]: https://github.com/rust-lang/docs.rs |
| 75 | +[rustdoc-team]: https://www.rust-lang.org/governance/teams/dev-tools#rustdoc |
| 76 | +[rustops/crates-build-env]: https://hub.docker.com/r/rustops/crates-build-env |
| 77 | +[Crater]: https://github.com/rust-lang/crater |
| 78 | +[rustup]: https://rustup.rs |
| 79 | +[crates-build-env-issue]: https://github.com/rust-lang/crates-build-env/issues |
| 80 | +[docsrs-issue]: https://github.com/rust-lang/crates-build-env/issues |
| 81 | +[rustwide]: https://github.com/rust-lang/rustwide |
| 82 | +[Crater contributors]: https://github.com/rust-lang/crater/graphs/contributors |
| 83 | +[Rustwide contributors]: https://github.com/rust-lang/rustwide/graphs/contributors |
| 84 | +[pietro]: https://github.com/pietroalbini |
| 85 | +[onur]: https://github.com/onur |
| 86 | +[mark]: https://github.com/Mark-Simulacrum |
| 87 | +[misdreavus]: https://github.com/QuietMisdreavus |
0 commit comments