@@ -249,37 +249,37 @@ subtrees) actually needs to use `git subtree`.
249
249
250
250
### External Dependencies (submodules)
251
251
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] ).
253
256
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 ) .
256
259
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] .
273
266
274
267
Breakage 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
276
277
277
278
#### Breaking Tools Built With The Compiler
278
279
279
280
Rust's build system builds a number of tools that make use of the internals of
280
281
the 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
283
283
changes, you may run into a sort of "chicken and egg" problem. These tools rely
284
284
on the latest compiler to be built so you can't update them (in their own
285
285
repositories) 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
299
299
tools so they can be distributed again.
300
300
301
301
This 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.
303
303
304
304
Here are those same steps in detail:
305
305
@@ -309,8 +309,8 @@ Here are those same steps in detail:
309
309
from resetting to the original branch after you make your changes. If you
310
310
need to [ update any submodules to their latest versions] ( #updating-submodules ) ,
311
311
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).
314
314
3 . (optional) Make commits for your changes and send them to upstream repositories as a PR.
315
315
4 . (optional) Maintainers of these submodules will ** not** merge the PR. The PR can't be
316
316
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:
322
322
323
323
#### Updating submodules
324
324
325
- These instructions are specific to updating ` rls ` , however they may apply
325
+ These instructions are specific to updating ` miri ` , however they may apply
326
326
to the other submodules as well. Please help by improving these instructions
327
327
if you find any discrepancies or special cases that need to be addressed.
328
328
329
- To update the ` rls ` submodule, start by running the appropriate
329
+ To update the ` miri ` submodule, start by running the appropriate
330
330
[ ` git submodule ` command] ( https://git-scm.com/book/en/v2/Git-Tools-Submodules ) .
331
331
For example, to update to the latest commit on the remote master branch,
332
332
you may want to run:
333
333
```
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
384
335
```
336
+ If you run ` ./x.py build ` now, and you are lucky, it may just work.
385
337
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 .
388
340
389
341
## Writing Documentation
390
342
0 commit comments