Skip to content

Commit 6b0a155

Browse files
authored
Update for removal of RLS (#1450)
1 parent 04892c1 commit 6b0a155

9 files changed

+43
-98
lines changed

src/building/bootstrapping.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ This flag has the following effects:
365365

366366
Code which does not use `-Z force-unstable-if-unmarked` should include the
367367
`#![feature(rustc_private)]` crate attribute to access these force-unstable
368-
crates. This is needed for things that link `rustc`, such as `miri`, `rls`, or
368+
crates. This is needed for things that link `rustc`, such as `miri` or
369369
`clippy`.
370370

371371
You can find more discussion about sysroots in:

src/building/new-target.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,11 @@ unreleased version of `libc`, you can add it to the top-level
102102

103103
```diff
104104
diff --git a/Cargo.toml b/Cargo.toml
105-
index be15e50e2bc..4fb1248ba99 100644
105+
index 1e83f05e0ca..4d0172071c1 100644
106106
--- a/Cargo.toml
107107
+++ b/Cargo.toml
108-
@@ -66,10 +66,11 @@ cargo = { path = "src/tools/cargo" }
108+
@@ -113,6 +113,8 @@ cargo-util = { path = "src/tools/cargo/crates/cargo-util" }
109109
[patch.crates-io]
110-
# Similar to Cargo above we want the RLS to use a vendored version of `rustfmt`
111-
# that we're shipping as well (to ensure that the rustfmt in RLS and the
112-
# `rustfmt` executable are the same exact version).
113-
rustfmt-nightly = { path = "src/tools/rustfmt" }
114110
+libc = { git = "https://github.com/rust-lang/libc", rev = "0bf7ce340699dcbacabdf5f16a242d2219a49ee0" }
115111

116112
# See comments in `src/tools/rustc-workspace-hack/README.md` for what's going on

src/contributing.md

+31-79
Original file line numberDiff line numberDiff line change
@@ -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

274267
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
276277

277278
#### Breaking Tools Built With The Compiler
278279

279280
Rust's build system builds a number of tools that make use of the internals of
280281
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
283283
changes, you may run into a sort of "chicken and egg" problem. These tools rely
284284
on the latest compiler to be built so you can't update them (in their own
285285
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
299299
tools so they can be distributed again.
300300

301301
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.
303303

304304
Here 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).
314314
3. (optional) Make commits for your changes and send them to upstream repositories as a PR.
315315
4. (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
326326
to the other submodules as well. Please help by improving these instructions
327327
if 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).
331331
For example, to update to the latest commit on the remote master branch,
332332
you 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

src/diagnostics.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,8 @@ In addition to telling the user exactly _why_ their code is wrong, it's
388388
oftentimes furthermore possible to tell them how to fix it. To this end,
389389
`DiagnosticBuilder` offers a structured suggestions API, which formats code
390390
suggestions pleasingly in the terminal, or (when the `--error-format json` flag
391-
is passed) as JSON for consumption by tools, most notably the [Rust Language
392-
Server][rls] and [`rustfix`][rustfix].
391+
is passed) as JSON for consumption by tools like [`rustfix`][rustfix].
393392

394-
[rls]: https://github.com/rust-lang/rls
395393
[rustfix]: https://github.com/rust-lang/rustfix
396394

397395
Not all suggestions should be applied mechanically, they have a degree of
@@ -757,7 +755,7 @@ then dumped into the `Session::buffered_lints` used by the rest of the compiler.
757755

758756
The compiler accepts an `--error-format json` flag to output
759757
diagnostics as JSON objects (for the benefit of tools such as `cargo
760-
fix` or the RLS). It looks like this:
758+
fix`). It looks like this:
761759

762760
```console
763761
$ rustc json_error_demo.rs --error-format json
@@ -771,7 +769,7 @@ object, but the series of lines taken together is, unfortunately, not
771769
valid JSON, thwarting tools and tricks (such as [piping to `python3 -m
772770
json.tool`](https://docs.python.org/3/library/json.html#module-json.tool))
773771
that require such. (One speculates that this was intentional for LSP
774-
performance purposes, so that each line/object can be sent to RLS as
772+
performance purposes, so that each line/object can be sent as
775773
it is flushed?)
776774

777775
Also note the "rendered" field, which contains the "human" output as a

src/git.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Changes not staged for commit:
149149
(use "git add <file>..." to update what will be committed)
150150
(use "git restore <file>..." to discard changes in working directory)
151151
modified: src/tools/cargo (new commits)
152-
modified: src/tools/rls (new commits)
152+
modified: src/tools/miri (new commits)
153153
154154
no changes added to commit (use "git add" and/or "git commit -a")
155155
```
@@ -391,7 +391,7 @@ you might want to get used to the main concepts of Git before reading this secti
391391

392392
The `rust-lang/rust` repository uses [Git submodules] as a way to use other
393393
Rust projects from within the `rust` repo. Examples include Rust's fork of
394-
`llvm-project` and many devtools such as `cargo` and `rls`.
394+
`llvm-project` and many devtools such as `cargo` and `miri`.
395395

396396
Those projects are developed and maintained in an separate Git (and GitHub)
397397
repository, and they have their own Git history/commits, issue tracker and PRs.
@@ -434,6 +434,5 @@ exist and that they correspond to some sort of embedded subrepository dependency
434434
that Git can nicely and fairly conveniently handle for us.
435435

436436
[Git submodules]: https://git-scm.com/book/en/v2/Git-Tools-Submodules
437-
[`rust-toolstate`]: https://rust-lang-nursery.github.io/rust-toolstate/
438437
[`rust-lang/miri`]: https://github.com/rust-lang/miri
439438
[miri-update]: https://github.com/rust-lang/rust/pull/77500/files

src/name-resolution.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Still, it probably provides useful first guidepost to what happens in there.
174174
following stages of compilation?
175175
* Who calls it and how it is actually used.
176176
* Is it a pass and then the result is only used, or can it be computed
177-
incrementally (e.g. for RLS)?
177+
incrementally?
178178
* The overall strategy description is a bit vague.
179179
* Where does the name `Rib` come from?
180180
* Does this thing have its own tests, or is it tested only as part of some e2e

src/overview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ satisfy/optimize for. For example,
190190
the input programs says they do, and should continue to do so despite the
191191
tremendous amount of change constantly going on.
192192
- Integration: a number of other tools need to use the compiler in
193-
various ways (e.g. cargo, clippy, miri, RLS) that must be supported.
193+
various ways (e.g. cargo, clippy, miri) that must be supported.
194194
- Compiler stability: the compiler should not crash or fail ungracefully on the
195195
stable channel.
196196
- Rust stability: the compiler must respect Rust's stability guarantees by not

src/rustc-driver.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ using the interface defined in the [`rustc_interface`] crate.
77
The `rustc_interface` crate provides external users with an (unstable) API
88
for running code at particular times during the compilation process, allowing
99
third parties to effectively use `rustc`'s internals as a library for
10-
analyzing a crate or emulating the compiler in-process (e.g. the RLS or rustdoc).
10+
analyzing a crate or emulating the compiler in-process (e.g. rustdoc).
1111

1212
For those using `rustc` as a library, the [`rustc_interface::run_compiler()`][i_rc]
1313
function is the main entrypoint to the compiler. It takes a configuration for the compiler

src/tests/intro.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ will unpack, build, and run all tests.
115115
### Tool tests
116116

117117
Packages that are included with Rust have all of their tests run as well.
118-
This includes things such as cargo, clippy, rustfmt, rls, miri, bootstrap
118+
This includes things such as cargo, clippy, rustfmt, miri, bootstrap
119119
(testing the Rust build system itself), etc.
120120

121121
Most of the tools are located in the [`src/tools`] directory.

0 commit comments

Comments
 (0)