diff --git a/src/backend/updating-llvm.md b/src/backend/updating-llvm.md index 1a6fa033a..0de0767b6 100644 --- a/src/backend/updating-llvm.md +++ b/src/backend/updating-llvm.md @@ -102,7 +102,7 @@ through each in detail. 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.py setup` download LLVM from CI instead of building it from source. You should disable this temporarily to make sure your changes are being used, by setting ```toml diff --git a/src/building/bootstrapping.md b/src/building/bootstrapping.md index e4dcc5ab2..fc1ad6c00 100644 --- a/src/building/bootstrapping.md +++ b/src/building/bootstrapping.md @@ -55,7 +55,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/std`. +which you can build with `./x.py build library/std`. See [Building the Compiler](/building/how-to-build-and-run.html#building-the-compiler). ### Stage 3 @@ -157,26 +157,26 @@ 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 +- `./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 artifacts'). If you're working on the standard library, this is normally the test command you want. -- `x.py test src/test/ui` means to build the stage 1 compiler and run +- `./x.py test src/test/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 src/test/ui` is not meaningful: it runs tests on the +- `./x.py test --stage 0 src/test/ui` is not meaningful: it runs tests on the _beta_ compiler and doesn't build `rustc` from source. Use `test src/test/ui` instead, which builds stage 1 from source. -- `x.py test --stage 0 compiler/rustc` builds the compiler but runs no tests: +- `./x.py 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 +- `./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/std` instead, which allows compiling programs without needing to define lang items. @@ -348,7 +348,7 @@ You can find more discussion about sysroots in: [rustdoc PR]: https://github.com/rust-lang/rust/pull/76728 -### Directories and artifacts generated by x.py +### Directories and artifacts generated by `x.py` The following tables indicate the outputs of various stage actions: diff --git a/src/building/build-install-distribution-artifacts.md b/src/building/build-install-distribution-artifacts.md index 7430ffb9b..4ec3f958a 100644 --- a/src/building/build-install-distribution-artifacts.md +++ b/src/building/build-install-distribution-artifacts.md @@ -18,7 +18,7 @@ test that it works on your target system. You’ll want to run this command: 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.py install` for testing. Rather, you should create a toolchain as discussed in [here][create-rustup-toolchain]. diff --git a/src/building/compiler-documenting.md b/src/building/compiler-documenting.md index af3cd7ce2..0efe2fce6 100644 --- a/src/building/compiler-documenting.md +++ b/src/building/compiler-documenting.md @@ -4,7 +4,7 @@ You might want to build documentation of the various components available like the standard library. There’s two ways to go about this. You can run rustdoc directly on the file to make sure the HTML is correct, which is fast. Alternatively, you can build the documentation -as part of the build process through x.py. Both are viable methods +as part of the build process through `x.py`. Both are viable methods since documentation is more about the content. ## Document everything diff --git a/src/building/how-to-build-and-run.md b/src/building/how-to-build-and-run.md index 49c2e8b66..981bb6e50 100644 --- a/src/building/how-to-build-and-run.md +++ b/src/building/how-to-build-and-run.md @@ -20,7 +20,7 @@ cd rust ## Create a `config.toml` -To start, run `x.py setup`. This will create a `config.toml` with reasonable defaults. +To start, run `./x.py setup`. This will create a `config.toml` with reasonable defaults. You may also want to change some of the following settings (and possibly others, such as `llvm.ccache`): diff --git a/src/building/new-target.md b/src/building/new-target.md index 968754138..b5fc2cb0a 100644 --- a/src/building/new-target.md +++ b/src/building/new-target.md @@ -8,7 +8,7 @@ relevant to your desired goal. For very new targets, you may need to use a different fork of LLVM than what is currently shipped with Rust. In that case, navigate to -the `src/llvm-project` git submodule (you might need to run `x.py +the `src/llvm-project` git submodule (you might need to run `./x.py check` at least once so the submodule is updated), check out the appropriate commit for your fork, then commit that new submodule reference in the main Rust repository. diff --git a/src/building/suggested.md b/src/building/suggested.md index 284317af7..bae98aa04 100644 --- a/src/building/suggested.md +++ b/src/building/suggested.md @@ -8,13 +8,13 @@ to make your life easier. CI will automatically fail your build if it doesn't pass `tidy`, our internal tool for ensuring code quality. If you'd like, you can install a [Git hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) -that will automatically run `x.py test tidy --bless` on each commit, to ensure +that will automatically run `./x.py test tidy --bless` on each commit, to ensure your code is up to par. If you decide later that this behavior is undesirable, you can delete the `pre-commit` file in `.git/hooks`. A prebuilt git hook lives at [`src/etc/pre-commit.sh`](https://github.com/rust-lang/rust/blob/master/src/etc/pre-commit.sh) which can be copied into your `.git/hooks` folder as `pre-commit` (without the `.sh` extension!). -You can also install the hook as a step of running `x.py setup`! +You can also install the hook as a step of running `./x.py setup`! ## Configuring `rust-analyzer` for `rustc` @@ -43,7 +43,7 @@ you can write: July 2021) a [bug][#77620] if you use -worktrees, submodules, and x.py in a commit hook. If you run into an error +worktrees, submodules, and `x.py` in a commit hook. If you run into an error like: ``` diff --git a/src/profiling.md b/src/profiling.md index 4851e3ee9..fd7014224 100644 --- a/src/profiling.md +++ b/src/profiling.md @@ -44,7 +44,7 @@ extension in LLVM bitcode format. Example usage: ``` cargo install cargo-llvm-lines -# On a normal crate you could now run `cargo llvm-lines`, but x.py isn't normal :P +# On a normal crate you could now run `cargo llvm-lines`, but `x.py` isn't normal :P # Do a clean before every run, to not mix in the results from previous runs. ./x.py clean @@ -88,7 +88,7 @@ Example output for the compiler: 326903 (0.7%) 642 (0.0%) rustc_query_system::query::plumbing::try_execute_query ``` -Since this doesn't seem to work with incremental compilation or `x.py check`, +Since this doesn't seem to work with incremental compilation or `./x.py check`, you will be compiling rustc _a lot_. I recommend changing a few settings in `config.toml` to make it bearable: ``` diff --git a/src/tests/intro.md b/src/tests/intro.md index 3f8ec97ee..25c1d059c 100644 --- a/src/tests/intro.md +++ b/src/tests/intro.md @@ -3,7 +3,7 @@ The Rust project runs a wide variety of different tests, orchestrated by -the build system (`x.py test`). The main test harness for testing the +the build system (`./x.py test`). The main test harness for testing the compiler itself is a tool called compiletest (located in the [`src/tools/compiletest`] directory). This section gives a brief overview of how the testing framework is setup, and then gets into some diff --git a/src/tests/running.md b/src/tests/running.md index 19925fe27..2e1ce0a91 100644 --- a/src/tests/running.md +++ b/src/tests/running.md @@ -49,7 +49,7 @@ with the debuginfo test suite: ``` If you only need to test a specific subdirectory of tests for any -given test suite, you can pass that directory to `x.py test`: +given test suite, you can pass that directory to `./x.py test`: ```bash ./x.py test src/test/ui/const-generics