@@ -249,37 +249,37 @@ subtrees) actually needs to use `git subtree`.
249249
250250### External Dependencies (submodules)
251251
252- Currently building Rust will also build the following external projects:
252+ Building Rust will also use external git repositories tracked using [ git
253+ submodules] . The complete list may be found in the [ ` .gitmodules ` ] file. Some
254+ of these projects are required (like ` stdarch ` for the standard library) and
255+ some of them are optional (like [ Miri] ).
253256
254- * [ miri ] ( https://github.com/rust-lang/miri )
255- * [ rls ] ( https://github.com/rust-lang/rls/ )
257+ Usage of submodules is discussed more in the [ Using Git
258+ chapter ] ( git.md#git-submodules ) .
256259
257- We allow breakage of these tools in the nightly channel. Maintainers of these
258- projects will be notified of the breakages and should fix them as soon as
259- possible.
260-
261- After the external is fixed, one could add the changes with
262-
263- ``` sh
264- git add path/to/submodule
265- ```
266-
267- outside the submodule.
268-
269- In order to prepare your tool-fixing PR, you can run the build locally by doing
270- ` ./x.py build src/tools/TOOL ` . If you will be editing the sources
271- there, you may wish to set ` submodules = false ` in the ` config.toml `
272- to prevent ` x.py ` from resetting to the original branch.
260+ Some of the submodules are allowed to be in a "broken" state where they either
261+ don't build or their tests don't pass. These include [ Miri] and the
262+ documentation books like [ The Rust Reference] . Maintainers of these projects
263+ will be notified when the project is in a broken state, and they should fix
264+ them as soon as possible. The current status is tracked on the [ toolstate
265+ website] . More information may be found on the Forge [ Toolstate chapter] .
273266
274267Breakage is not allowed in the beta and stable channels, and must be addressed
275- before the PR is merged.
268+ before the PR is merged. They are also not allowed to be broken on master in
269+ the week leading up to the beta cut.
270+
271+ [ git submodules ] : https://git-scm.com/book/en/v2/Git-Tools-Submodules
272+ [ `.gitmodules` ] : https://github.com/rust-lang/rust/blob/master/.gitmodules
273+ [ Miri ] : https://github.com/rust-lang/miri
274+ [ The Rust Reference ] : https://github.com/rust-lang/reference/
275+ [ toolstate website ] : https://rust-lang-nursery.github.io/rust-toolstate/
276+ [ Toolstate chapter ] : https://forge.rust-lang.org/infra/toolstate.html
276277
277278#### Breaking Tools Built With The Compiler
278279
279280Rust's build system builds a number of tools that make use of the internals of
280281the compiler and that are hosted in a separate repository, and included in Rust
281- via git submodules. This includes [ RLS] ( https://github.com/rust-lang/rls ) and
282- [ Miri] ( https://github.com/rust-lang/Miri ) . If these tools break because of your
282+ via git submodules (such as [ Miri] ). If these tools break because of your
283283changes, you may run into a sort of "chicken and egg" problem. These tools rely
284284on the latest compiler to be built so you can't update them (in their own
285285repositories) to reflect your changes to the compiler until those changes are
@@ -299,7 +299,7 @@ done and the tools are working again, you go back in the compiler and update the
299299tools so they can be distributed again.
300300
301301This should avoid a bunch of synchronization dances and is also much easier on contributors as
302- there's no need to block on rls/miri/other tools changes going upstream.
302+ there's no need to block on tools changes going upstream.
303303
304304Here are those same steps in detail:
305305
@@ -309,8 +309,8 @@ Here are those same steps in detail:
309309 from resetting to the original branch after you make your changes. If you
310310 need to [ update any submodules to their latest versions] ( #updating-submodules ) ,
311311 see the section of this file about that for more information.
312- 2 . (optional) Run ` ./x.py test src/tools/rls ` (substituting the submodule
313- that broke for ` rls ` ). Fix any errors in the submodule (and possibly others).
312+ 2 . (optional) Run ` ./x.py test src/tools/miri ` (substituting the submodule
313+ that broke for ` miri ` ). Fix any errors in the submodule (and possibly others).
3143143 . (optional) Make commits for your changes and send them to upstream repositories as a PR.
3153154 . (optional) Maintainers of these submodules will ** not** merge the PR. The PR can't be
316316 merged because CI will be broken. You'll want to write a message on the PR referencing
@@ -322,69 +322,21 @@ Here are those same steps in detail:
322322
323323#### Updating submodules
324324
325- These instructions are specific to updating ` rls ` , however they may apply
325+ These instructions are specific to updating ` miri ` , however they may apply
326326to the other submodules as well. Please help by improving these instructions
327327if you find any discrepancies or special cases that need to be addressed.
328328
329- To update the ` rls ` submodule, start by running the appropriate
329+ To update the ` miri ` submodule, start by running the appropriate
330330[ ` git submodule ` command] ( https://git-scm.com/book/en/v2/Git-Tools-Submodules ) .
331331For example, to update to the latest commit on the remote master branch,
332332you may want to run:
333333```
334- git submodule update --remote src/tools/rls
335- ```
336- If you run ` ./x.py build ` now, and you are lucky, it may just work. If you see
337- an error message about patches that did not resolve to any crates, you will need
338- to complete a few more steps which are outlined with their rationale below.
339-
340- * (This error may change in the future to include more information.)*
341- ```
342- error: failed to resolve patches for `https://github.com/rust-lang/rls`
343-
344- Caused by:
345- patch for `rls` in `https://github.com/rust-lang/rls` did not resolve to any crates
346- failed to run: ~/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path ~/rust/src/bootstrap/Cargo.toml
347- ```
348-
349- The [ ` [patch] ` ] [ patchsec ] section of ` Cargo.toml ` can be very useful for
350- testing. In addition to that, you should read the [ Overriding
351- dependencies] [ overriding ] section of the documentation.
352-
353- [ patchsec ] : http://doc.crates.io/manifest.html#the-patch-section
354- [ overriding ] : http://doc.crates.io/specifying-dependencies.html#overriding-dependencies
355-
356- Specifically, the following [ section in Overriding dependencies] [ testingbugfix ]
357- reveals what the problem is:
358-
359- [ testingbugfix ] : http://doc.crates.io/specifying-dependencies.html#testing-a-bugfix
360-
361- > Next up we need to ensure that our lock file is updated to use this new
362- > version of uuid so our project uses the locally checked out copy instead of
363- > one from crates.io. The way ` [patch] ` works is that it'll load the dependency
364- > at ../path/to/uuid and then whenever crates.io is queried for versions of
365- > uuid it'll also return the local version.
366- >
367- > This means that the version number of the local checkout is significant and
368- > will affect whether the patch is used. Our manifest declared uuid = "1.0"
369- > which means we'll only resolve to >= 1.0.0, < 2.0.0, and Cargo's greedy
370- > resolution algorithm also means that we'll resolve to the maximum version
371- > within that range. Typically this doesn't matter as the version of the git
372- > repository will already be greater or match the maximum version published on
373- > crates.io, but it's important to keep this in mind!
374-
375- This says that when we updated the submodule, the version number in our
376- ` src/tools/rls/Cargo.toml ` changed. The new version is different from
377- the version in ` Cargo.lock ` , so the build can no longer continue.
378-
379- To resolve this, we need to update ` Cargo.lock ` . Luckily, cargo provides a
380- command to do this easily.
381-
382- ```
383- $ cargo update -p rls
334+ git submodule update --remote src/tools/miri
384335```
336+ If you run ` ./x.py build ` now, and you are lucky, it may just work.
385337
386- This should change the version listed in ` Cargo.lock ` to the new version you updated
387- the submodule to. Running ` ./x.py build ` should work now .
338+ To add these changes to a commit, use ` git add src/tools/miri ` and commit the
339+ change. You can the push and open a PR .
388340
389341## Writing Documentation
390342
0 commit comments