summaryrefslogtreecommitdiffstats
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorSunjay Varma <sunjay@users.noreply.github.com>2017-10-17 22:51:10 -0400
committerSunjay Varma <varma.sunjay@gmail.com>2017-10-17 23:05:45 -0400
commit790604adad9fd02b92c59d1f937edb902a58b036 (patch)
tree5846bf4c37f6484e7d41077d3464d69a7a08f5a5 /CONTRIBUTING.md
parentAdded a section about updating submodules (diff)
downloadgrust-790604adad9fd02b92c59d1f937edb902a58b036.tar.gz
grust-790604adad9fd02b92c59d1f937edb902a58b036.tar.bz2
grust-790604adad9fd02b92c59d1f937edb902a58b036.tar.xz
Updating the instructions for when a tool breaks to use the new toolstate feature
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md70
1 files changed, 40 insertions, 30 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 34789f144f..0f6cba7a95 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -363,46 +363,56 @@ outside the submodule.
363It can also be more convenient during development to set `submodules = false` 363It can also be more convenient during development to set `submodules = false`
364in the `config.toml` to prevent `x.py` from resetting to the original branch. 364in the `config.toml` to prevent `x.py` from resetting to the original branch.
365 365
366#### Breaking rustfmt or rls 366#### Breaking Tools Built With The Compiler
367[breaking-rustfmt-or-rls]: #breaking-rustfmt-or-rls 367[breaking-tools-built-with-the-compiler]: #breaking-tools-built-with-the-compiler
368 368
369Rust's build system also builds the 369Rust's build system builds a number of tools that make use of the
370[RLS](https://github.com/rust-lang-nursery/rls) 370internals of the compiler. This includes clippy,
371and [rustfmt](https://github.com/rust-lang-nursery/rustfmt). If these tools 371[RLS](https://github.com/rust-lang-nursery/rls) and
372[rustfmt](https://github.com/rust-lang-nursery/rustfmt). If these tools
372break because of your changes, you may run into a sort of "chicken and egg" 373break because of your changes, you may run into a sort of "chicken and egg"
373problem. Both tools rely on the latest compiler to be built so you can't update 374problem. These tools rely on the latest compiler to be built so you can't update
374them until the changes you are making to the compiler land. In the meantime, you 375them to reflect your changes to the compiler until those changes are merged into
375can't land your changes to the compiler because the build won't pass until those 376the compiler. At the same time, you can't get your changes merged into the compiler
376tools are fixed. 377because the rust-lang/rust build won't pass until those tools build and pass their
378tests.
377 379
378That means that, in the default state, you can't update the compiler without 380That means that, in the default state, you can't update the compiler without first
379fixing rustfmt and rls first. 381fixing rustfmt, rls and the other tools that the compiler builds.
380 382
381When this happens, follow these steps: 383Luckily, a feature was [added to Rust's build](https://github.com/rust-lang/rust/pull/45243)
384to make all of this easy to handle. The idea is that you mark the tools as "broken",
385so that the rust-lang/rust build passes without trying to build them, then land the change
386in the compiler, wait for a nightly, and go update the tools that you broke. Once you're done
387and the tools are working again, you go back in the compiler and change the tools back
388from "broken".
382 389
3831. First, if it doesn't exist already, create a `config.toml` by copying 390This should avoid a bunch of synchronization dances and is also much easier on contributors as
391there's no need to block on rls/rustfmt/other tools changes going upstream.
392
393Here are those same steps in detail:
394
3951. (optional) First, if it doesn't exist already, create a `config.toml` by copying
384 `config.toml.example` in the root directory of the Rust repository. 396 `config.toml.example` in the root directory of the Rust repository.
385 Set `submodules = false` in the `[build]` section. This will prevent `x.py` 397 Set `submodules = false` in the `[build]` section. This will prevent `x.py`
386 from resetting to the original branch after you make your changes. If you 398 from resetting to the original branch after you make your changes. If you
387 need to [update any submodules to their latest versions][updating-submodules], 399 need to [update any submodules to their latest versions][updating-submodules],
388 see the section of this file about that for more information. 400 see the section of this file about that for more information.
3892. Run `./x.py test src/tools/rustfmt`. Fix any errors in the submodule itself 4012. (optional) Run `./x.py test src/tools/rustfmt` (substituting the submodule
390 (the `src/tools/rustfmt` directory) until it works. 402 that broke for `rustfmt`). Fix any errors in the submodule (and possibly others).
3913. Run `./x.py test src/tools/rls`. Fix any errors in the submodule itself 4033. (optional) Make commits for your changes and send them to upstream repositories as a PR.
392 (the `src/tools/rls` directory) until it works. 4044. (optional) Maintainers of these submodules will **not** merge the PR. The PR can't be
3934. Make a commit for `rustfmt`, if necessary, and send a PR to the master 405 merged because CI will be broken. You'll want to write a message on the PR referencing
394 branch of rust-lang-nursery/rustfmt 406 your change, and how the PR should be merged once your change makes it into a nightly.
3955. Do the same, if necessary for the RLS 4075. Update `src/tools/toolstate.toml` to indicate that the tool in question is "broken",
3966. A maintainer of rls/rustfmt will **not** merge the PR. The PR can't be 408 that will disable building it on CI. See the documentation in that file for the exact
397 merged because CI will be broken. Instead a new branch will be created, 409 configuration values you can use.
398 and the PR will be pushed to the branch (the PR is left open) 4106. Commit the changes to `src/tools/toolstate.toml`, **do not update submodules in your commit**,
3997. On your branch, update the rls/rustfmt submodules to these branches 411 and then update the PR you have for rust-lang/rust.
4008. Commit the changes, update your PR to rust-lang/rust 4127. Wait for your PR to merge.
4019. Wait for the branch to merge 4138. Wait for a nightly
40210. Wait for a nightly 4149. (optional) Help land your PR on the upstream repository now that your changes are in nightly.
40311. A maintainer of rls/rustfmt will merge the original PRs to rls/rustfmt 41510. (optional) Send a PR to rust-lang/rust updating the submodule, reverting `src/tools/toolstate.toml` back to a "building" or "testing" state.
40412. Eventually the rls/rustfmt submodules will get re-updated back to the
405 master branch
406 416
407#### Updating submodules 417#### Updating submodules
408[updating-submodules]: #updating-submodules 418[updating-submodules]: #updating-submodules