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

Issue1707 doc simply use x #1710

Merged
merged 4 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ git submodule update --remote src/doc/rustc-dev-guide
git add -u
git commit -m "Update rustc-dev-guide"
# Note that you can use -i, which is short for --incremental, in the following command
./x.py test --incremental src/doc/rustc-dev-guide # This is optional and should succeed anyway
./x test --incremental src/doc/rustc-dev-guide # This is optional and should succeed anyway
# Open a PR in rust-lang/rust
```

Expand Down
8 changes: 4 additions & 4 deletions src/backend/updating-llvm.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ so let's go through each in detail.
`src/llvm-project` to ensure submodule updates aren't reverted.
Some commands you should execute are:

* `./x.py build src/llvm` - test that LLVM still builds
* `./x.py build src/tools/lld` - same for LLD
* `./x.py build` - build the rest of rustc
* `./x build src/llvm` - test that LLVM still builds
* `./x build src/tools/lld` - same for LLD
* `./x build` - build the rest of rustc

You'll likely need to update [`llvm-wrapper/*.cpp`][`llvm-wrapper`]
to compile with updated LLVM bindings.
Note that you should use `#ifdef` and such to ensure
that the bindings still compile on older LLVM versions.

Note that `profile = "compiler"` and other defaults set by `./x.py setup`
Note that `profile = "compiler"` and other defaults set by `./x setup`
download LLVM from CI instead of building it from source.
You should disable this temporarily to make sure your changes are being used.
This is done by having the following setting in `config.toml`:
Expand Down
2 changes: 1 addition & 1 deletion src/bug-fix-procedure.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ general, if the test used to have `#[deny(overlapping_inherent_impls)]`, that
can just be removed.

```
./x.py test
./x test
```

#### All done!
Expand Down
36 changes: 18 additions & 18 deletions src/building/bootstrapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ However, it takes a very long time to build
because one must first build the new compiler with an older compiler
and then use that to build the new compiler with itself.
For development, you usually only want the `stage1` compiler,
which you can build with `./x.py build library`.
which you can build with `./x build library`.
See [Building the compiler](./how-to-build-and-run.html#building-the-compiler).

### Stage 3: the same-result test
Expand All @@ -107,7 +107,7 @@ to be identical to before, unless something has broken.

### Building the stages

`x.py` tries to be helpful and pick the stage you most likely meant for each subcommand.
`x` tries to be helpful and pick the stage you most likely meant for each subcommand.
These defaults are as follows:

- `check`: `--stage 0`
Expand Down Expand Up @@ -152,7 +152,7 @@ bootstrapping the compiler.

This is a detailed look into the separate bootstrap stages.

The convention `x.py` uses is that:
The convention `x` uses is that:

- A `--stage N` flag means to run the stage N compiler (`stageN/rustc`).
- A "stage N artifact" is a build artifact that is _produced_ by the stage N compiler.
Expand All @@ -161,7 +161,7 @@ The convention `x.py` uses is that:

#### Build artifacts

Anything you can build with `x.py` is a _build artifact_.
Anything you can build with `x` is a _build artifact_.
Build artifacts include, but are not limited to:

- binaries, like `stage0-rustc/rustc-main`
Expand All @@ -173,27 +173,27 @@ Build artifacts include, but are not limited to:

#### Examples

- `./x.py build --stage 0` means to build with the beta `rustc`.
- `./x.py doc --stage 0` means to document using the beta `rustdoc`.
- `./x.py test --stage 0 library/std` means to run tests on the standard library
without building `rustc` from source ('build with stage 0, then test the
- `./x build --stage 0` means to build with the beta `rustc`.
- `./x doc --stage 0` means to document using the beta `rustdoc`.
- `./x test --stage 0 library/std` means to run tests on the standard library
without building `rustc` from source ('build with stage 0, then test the
artifacts'). If you're working on the standard library, this is normally the
test command you want.
- `./x.py test tests/ui` means to build the stage 1 compiler and run
- `./x test tests/ui` means to build the stage 1 compiler and run
`compiletest` on it. If you're working on the compiler, this is normally the
test command you want.

#### Examples of what *not* to do

- `./x.py test --stage 0 tests/ui` is not useful: it runs tests on the
- `./x test --stage 0 tests/ui` is not useful: it runs tests on the
_beta_ compiler and doesn't build `rustc` from source. Use `test tests/ui`
instead, which builds stage 1 from source.
- `./x.py test --stage 0 compiler/rustc` builds the compiler but runs no tests:
- `./x test --stage 0 compiler/rustc` builds the compiler but runs no tests:
it's running `cargo test -p rustc`, but cargo doesn't understand Rust's
tests. You shouldn't need to use this, use `test` instead (without arguments).
- `./x.py build --stage 0 compiler/rustc` builds the compiler, but does not build
libstd or even libcore. Most of the time, you'll want `./x.py build
library` instead, which allows compiling programs without needing to define
- `./x build --stage 0 compiler/rustc` builds the compiler, but does not build
libstd or even libcore. Most of the time, you'll want `./x build
library` instead, which allows compiling programs without needing to define
lang items.

### Building vs. running
Expand Down Expand Up @@ -243,7 +243,7 @@ artifacts into the appropriate place, skipping the cargo invocation.
For instance, you might want to build an ARM version of rustc using an x86 machine.
Building stage2 `std` is different when you are cross-compiling.

This is because `x.py` uses a trick: if `HOST` and `TARGET` are the same,
This is because `x` uses a trick: if `HOST` and `TARGET` are the same,
it will reuse stage1 `std` for stage2! This is sound because stage1 `std`
was compiled with the stage1 compiler, i.e. a compiler using the source code
you currently have checked out. So it should be identical (and therefore ABI-compatible)
Expand Down Expand Up @@ -362,7 +362,7 @@ You can find more discussion about sysroots in:

## Passing flags to commands invoked by `bootstrap`

`x.py` allows you to pass stage-specific flags to `rustc` and `cargo` when bootstrapping.
`x` allows you to pass stage-specific flags to `rustc` and `cargo` when bootstrapping.
The `RUSTFLAGS_BOOTSTRAP` environment variable is passed as `RUSTFLAGS` to the bootstrap stage
(stage0), and `RUSTFLAGS_NOT_BOOTSTRAP` is passed when building artifacts for later stages.
`RUSTFLAGS` will work, but also affects the build of `bootstrap` itself, so it will be rare to want
Expand Down Expand Up @@ -395,7 +395,7 @@ If `./stageN/bin/rustc` gives an error about environment variables, that
usually means something is quite wrong -- or you're trying to compile e.g.
`rustc` or `std` or something that depends on environment variables. In
the unlikely case that you actually need to invoke rustc in such a situation,
you can tell the bootstrap shim to print all env variables by adding `-vvv` to your `x.py` command.
you can tell the bootstrap shim to print all env variables by adding `-vvv` to your `x` command.

Finally, bootstrap makes use of the [cc-rs crate] which has [its own
method][env-vars] of configuring C compilers and C flags via environment
Expand All @@ -408,7 +408,7 @@ variables.

In this part, we will investigate the build command's stdout in an action
(similar, but more detailed and complete documentation compare to topic above).
When you execute `x.py build --dry-run` command, the build output will be something
When you execute `x build --dry-run` command, the build output will be something
like the following:

```text
Expand Down
14 changes: 7 additions & 7 deletions src/building/build-install-distribution-artifacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
You might want to build and package up the compiler for distribution.
You’ll want to run this command to do it:

```bash
./x.py dist
```
```bash
./x dist
```

# Install distribution artifacts

If you’ve built a distribution artifact you might want to install it and
test that it works on your target system. You’ll want to run this command:

```bash
./x.py install
```
```bash
./x install
```

Note: If you are testing out a modification to a compiler, you
might want to use it to compile some project.
Usually, you do not want to use `./x.py install` for testing.
Usually, you do not want to use `./x install` for testing.
Rather, you should create a toolchain as discussed in
[here][create-rustup-toolchain].

Expand Down
12 changes: 6 additions & 6 deletions src/building/compiler-documenting.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ like the standard library (std) or the compiler (rustc).
as rustdoc is under active development:

```bash
./x.py doc
./x doc
```

If you want to be sure the documentation looks the same as on CI:

```bash
./x.py doc --stage 1
./x doc --stage 1
```

This ensures that (current) rustdoc gets built,
Expand All @@ -26,17 +26,17 @@ like the standard library (std) or the compiler (rustc).
you can build just the documentation you want:

```bash
./x.py doc src/doc/book
./x.py doc src/doc/nomicon
./x.py doc compiler library
./x doc src/doc/book
./x doc src/doc/nomicon
./x doc compiler library
```

See [the nightly docs index page](https://doc.rust-lang.org/nightly/) for a full list of books.

- Document internal rustc items

Compiler documentation is not built by default.
To create it by default with `x.py doc`, modify `config.toml`:
To create it by default with `x doc`, modify `config.toml`:

```toml
[build]
Expand Down
Loading