Skip to content
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

Rollup of 10 pull requests #45368

Merged
merged 27 commits into from
Oct 18, 2017
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
818d224
Fix out of date unstable book entries for `alloc_*` features.
SimonSapin Oct 11, 2017
45bb03f
Save selected search tab
GuillaumeGomez Oct 14, 2017
47ea51e
Improve E0382 extended help message
jacwah Oct 14, 2017
68311bd
Bump the minimum LLVM to 3.9
cuviper Oct 16, 2017
7538a9b
Update the codegen/mainsubprogram tests to min-llvm 4.0
cuviper Oct 16, 2017
6f33108
bootstrap: update and enable the LLVM version-check
cuviper Oct 16, 2017
a50fe31
Docs: a LocalKey might start in the Valid state
Oct 17, 2017
1287300
List of all lang items in unstable book.
Havvy Oct 10, 2017
4adf6ae
Deprecate several flags in rustdoc
steveklabnik Aug 28, 2017
aad8787
Create a new flag, --document-private-items
steveklabnik Sep 21, 2017
b8f981a
Generate FirstStatementIndex using newtype_index macro
spastorino Oct 16, 2017
045ce18
modify tests to use new flag
steveklabnik Oct 17, 2017
bd4907d
Documenting the process for when rustfmt/rls breakk because of your c…
sunjay Oct 8, 2017
3f90c3a
Added a section about updating submodules
sunjay Oct 10, 2017
790604a
Updating the instructions for when a tool breaks to use the new tools…
sunjay Oct 18, 2017
9fda05c
rustdoc: add a primitive page for "unit"
cuviper Oct 18, 2017
6309a47
Remove two obsolete min-llvm-version tests
cuviper Oct 18, 2017
ebdfe33
Rollup merge of #44138 - steveklabnik:rustdoc-deprecations, r=QuietMi…
kennytm Oct 18, 2017
9dfb210
Rollup merge of #45082 - jacwah:explain-E0382, r=steveklabnik
kennytm Oct 18, 2017
578016b
Rollup merge of #45098 - sunjay:breakingrustfmtrls, r=alexcrichton
kennytm Oct 18, 2017
61c58c1
Rollup merge of #45181 - Havvy:doc-unstable-lang-items, r=frewsxcv
kennytm Oct 18, 2017
0350c2f
Rollup merge of #45217 - SimonSapin:alloc-doc, r=steveklabnik
kennytm Oct 18, 2017
4913b92
Rollup merge of #45281 - GuillaumeGomez:tab-selection, r=QuietMisdreavus
kennytm Oct 18, 2017
0d4dbba
Rollup merge of #45325 - spastorino:first_statement_index_with_macro,…
kennytm Oct 18, 2017
c77068a
Rollup merge of #45326 - cuviper:min-llvm-3.9, r=alexcrichton
kennytm Oct 18, 2017
c6892f4
Rollup merge of #45340 - stjepang:localkey-state-doc-skip-uninitializ…
kennytm Oct 18, 2017
6b505d6
Rollup merge of #45354 - cuviper:unit_doc, r=QuietMisdreavus
kennytm Oct 18, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added a section about updating submodules
The process for updating rustfmt is quite involved because of the way everything is configured. This section covers the steps for updating rustfmt and rationale behind them.
  • Loading branch information
sunjay committed Oct 18, 2017
commit 3f90c3a2cfb458c94d514345e701696d74d988c8
64 changes: 63 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ It can also be more convenient during development to set `submodules = false`
in the `config.toml` to prevent `x.py` from resetting to the original branch.

#### Breaking rustfmt or rls
[breaking-rustfmt-or-rls]: #breaking-rustfmt-or-rls

Rust's build system also builds the
[RLS](https://github.com/rust-lang-nursery/rls)
Expand All @@ -382,7 +383,9 @@ When this happens, follow these steps:
1. First, if it doesn't exist already, create a `config.toml` by copying
`config.toml.example` in the root directory of the Rust repository.
Set `submodules = false` in the `[build]` section. This will prevent `x.py`
from resetting to the original branch after you make your changes.
from resetting to the original branch after you make your changes. If you
need to [update any submodules to their latest versions][updating-submodules],
see the section of this file about that for more information.
2. Run `./x.py test src/tools/rustfmt`. Fix any errors in the submodule itself
(the `src/tools/rustfmt` directory) until it works.
3. Run `./x.py test src/tools/rls`. Fix any errors in the submodule itself
Expand All @@ -401,6 +404,65 @@ When this happens, follow these steps:
12. Eventually the rls/rustfmt submodules will get re-updated back to the
master branch

#### Updating submodules
[updating-submodules]: #updating-submodules

These instructions are specific to updating `rustfmt`, however they may apply
to the other submodules as well. Please help by improving these instructions
if you find any discrepencies or special cases that need to be addressed.

To update the `rustfmt` submodule, start by running the appropriate
[`git submodule` command](https://git-scm.com/book/en/v2/Git-Tools-Submodules).
For example, to update to the latest commit on the remote master branch,
you may want to run:
```
git submodule update --remote src/tools/rustfmt
```
If you run `./x.py build` now, and you are lucky, it may just work. If you see
an error message about patches that did not resolve to any crates, you will need
to complete a few more steps which are outlined with their rationale below.

*(This error may change in the future to include more information.)*
```
error: failed to resolve patches for `https://github.com/rust-lang-nursery/rustfmt`

Caused by:
patch for `rustfmt-nightly` in `https://github.com/rust-lang-nursery/rustfmt` did not resolve to any crates
failed to run: ~/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path ~/rust/src/bootstrap/Cargo.toml
```

If you haven't used the `[patch]`
section of `Cargo.toml` before, there is [some relevant documentation about it
in the cargo docs](http://doc.crates.io/manifest.html#the-patch-section). In
addition to that, you should read the
[Overriding dependencies](http://doc.crates.io/specifying-dependencies.html#overriding-dependencies)
section of the documentation as well.

Specifically, the following [section in Overriding dependencies](http://doc.crates.io/specifying-dependencies.html#testing-a-bugfix) reveals what the problem is:

> Next up we need to ensure that our lock file is updated to use this new version of uuid so our project uses the locally checked out copy instead of one from crates.io. The way [patch] works is that it'll load the dependency at ../path/to/uuid and then whenever crates.io is queried for versions of uuid it'll also return the local version.
>
> This means that the version number of the local checkout is significant and will affect whether the patch is used. Our manifest declared uuid = "1.0" which means we'll only resolve to >= 1.0.0, < 2.0.0, and Cargo's greedy resolution algorithm also means that we'll resolve to the maximum version within that range. Typically this doesn't matter as the version of the git repository will already be greater or match the maximum version published on crates.io, but it's important to keep this in mind!

This says that when we updated the submodule, the version number in our
`src/tools/rustfmt/Cargo.toml` changed. The new version is different from
the version in `Cargo.lock`, so the build can no longer continue.

To resolve this, we need to update `Cargo.lock`. Luckily, cargo provides a
command to do this easily.

First, go into the `src/` directory since that is where `Cargo.toml` is in
the rust repository. Then run, `cargo update -p rustfmt-nightly` to solve
the problem.

```
$ cd src
$ cargo update -p rustfmt-nightly
```

This should change the version listed in `src/Cargo.lock` to the new version you updated
the submodule to. Running `./x.py build` should work now.

## Writing Documentation
[writing-documentation]: #writing-documentation

Expand Down