Skip to content

Commit d2acb42

Browse files
committed
Auto merge of #147392 - tshepang:rdg-sync, r=tshepang
rustc-dev-guide subtree update Subtree update of `rustc-dev-guide` to rust-lang/rustc-dev-guide@5270b84. Created using https://github.com/rust-lang/josh-sync. r? `@ghost`
2 parents 1a3cdd3 + ce3928b commit d2acb42

File tree

12 files changed

+46
-33
lines changed

12 files changed

+46
-33
lines changed

src/doc/rustc-dev-guide/.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
pull_request:
88
schedule:
99
# Run multiple times a day as the successfull cached links are not checked every time.

src/doc/rustc-dev-guide/.github/workflows/rustc-pull.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
github-app-id: ${{ vars.APP_CLIENT_ID }}
1515
zulip-stream-id: 196385
1616
zulip-bot-email: "rustc-dev-guide-gha-notif-bot@rust-lang.zulipchat.com"
17-
pr-base-branch: master
17+
pr-base-branch: main
1818
branch-name: rustc-pull
1919
secrets:
2020
zulip-api-token: ${{ secrets.ZULIP_API_TOKEN }}

src/doc/rustc-dev-guide/book.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ command = "mdbook-mermaid"
1111

1212
[output.html]
1313
git-repository-url = "https://github.com/rust-lang/rustc-dev-guide"
14-
edit-url-template = "https://github.com/rust-lang/rustc-dev-guide/edit/master/{path}"
14+
edit-url-template = "https://github.com/rust-lang/rustc-dev-guide/edit/main/{path}"
1515
additional-js = [
1616
"mermaid.min.js",
1717
"mermaid-init.js",

src/doc/rustc-dev-guide/ci/linkcheck.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ elif [ "$GITHUB_EVENT_NAME" = "pull_request" ] ; then # running in PR CI build
3232

3333
echo "Checking files changed since $BASE_SHA: $CHANGED_FILES"
3434
else # running locally
35-
COMMIT_RANGE=master...
35+
COMMIT_RANGE=main...
3636
CHANGED_FILES=$(git diff --name-only $COMMIT_RANGE | sed 's#^src/##' | tr '\n' ' ')
3737
FLAGS="-f $CHANGED_FILES"
3838

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9f32ccf35fb877270bc44a86a126440f04d676d0
1+
4fa824bb78318a3cba8c7339d5754b4909922547

src/doc/rustc-dev-guide/src/autodiff/debugging.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Before generating the llvm-ir, keep in mind two techniques that can help ensure
1616
## 1) Generate an llvm-ir reproducer
1717

1818
```sh
19-
rustflags="-z autodiff=enable,printmodbefore" cargo +enzyme build --release &> out.ll
19+
RUSTFLAGS="-Z autodiff=Enable,PrintModbefore" cargo +enzyme build --release &> out.ll
2020
```
2121

2222
This also captures a few warnings and info messages above and below your module. open out.ll and remove every line above `; moduleid = <somehash>`. Now look at the end of the file and remove everything that's not part of llvm-ir, i.e. remove errors and warnings. The last line of your llvm-ir should now start with `!<somenumber> = `, i.e. `!40831 = !{i32 0, i32 1037508, i32 1037538, i32 1037559}` or `!43760 = !dilocation(line: 297, column: 5, scope: !43746)`.
@@ -25,11 +25,12 @@ The actual numbers will depend on your code.
2525

2626
## 2) Check your llvm-ir reproducer
2727

28-
To confirm that your previous step worked, we will use llvm's `opt` tool. find your path to the opt binary, with a path similar to `<some_dir>/rust/build/<x86/arm/...-target-tripple>/build/bin/opt`. also find `llvmenzyme-19.<so/dll/dylib>` path, similar to `/rust/build/target-tripple/enzyme/build/enzyme/llvmenzyme-19`. Please keep in mind that llvm frequently updates it's llvm backend, so the version number might be higher (20, 21, ...). Once you have both, run the following command:
28+
To confirm that your previous step worked, we will use llvm's `opt` tool. find your path to the opt binary, with a path similar to `<some_dir>/rust/build/<x86/arm/...-target-triple>/build/bin/opt`. also find `llvmenzyme-19.<so/dll/dylib>` path, similar to `/rust/build/target-triple/enzyme/build/enzyme/llvmenzyme-19`. Please keep in mind that llvm frequently updates it's llvm backend, so the version number might be higher (20, 21, ...). Once you have both, run the following command:
2929

3030
```sh
31-
<path/to/opt> out.ll -load-pass-plugin=/path/to/llvmenzyme-19.so -passes="enzyme" -s
31+
<path/to/opt> out.ll -load-pass-plugin=/path/to/build/<target-triple>/stage1/lib/libEnzyme-21.so -passes="enzyme" -enzyme-strict-aliasing=0 -s
3232
```
33+
This command might fail for future versions or on your system, in which case you should replace libEnzyme-21.so with LLVMEnzyme-21.so. Look at the Enzyme docs for instructions on how to build it. You might need to also adjust how to build your LLVM version.
3334

3435
If the previous step succeeded, you are going to see the same error that you saw when compiling your rust code with cargo.
3536

src/doc/rustc-dev-guide/src/building/how-to-build-and-run.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ Alternatively, you can write `bootstrap.toml` by hand. See `bootstrap.example.to
187187
settings and explanations of them. See `src/bootstrap/defaults` for common settings to change.
188188

189189
If you have already built `rustc` and you change settings related to LLVM, then you may have to
190-
execute `rm -rf build` for subsequent configuration changes to take effect. Note that `./x
190+
execute `./x clean --all` for subsequent configuration changes to take effect. Note that `./x
191191
clean` will not cause a rebuild of LLVM.
192192

193193
## Common `x` commands
@@ -226,16 +226,17 @@ Once you've created a `bootstrap.toml`, you are now ready to run
226226
`x`. There are a lot of options here, but let's start with what is
227227
probably the best "go to" command for building a local compiler:
228228

229-
```bash
230-
./x build library
229+
```console
230+
./x build rustc
231231
```
232232

233-
This may *look* like it only builds the standard library, but that is not the case.
234-
What this command does is the following:
233+
What this command does is build `rustc` using the stage0 compiler and stage0 `std`.
234+
235+
To build `rustc` with the in-tree `std`, use this command instead:
235236

236-
- Build `rustc` using the stage0 compiler
237-
- This produces the stage1 compiler
238-
- Build `std` using the stage1 compiler
237+
```console
238+
./x build rustc --stage 2
239+
```
239240

240241
This final product (stage1 compiler + libs built using that compiler)
241242
is what you need to build other Rust programs (unless you use `#![no_std]` or
@@ -253,7 +254,7 @@ signature of some function, you can use `./x check` instead for a much faster bu
253254

254255
Note that this whole command just gives you a subset of the full `rustc`
255256
build. The **full** `rustc` build (what you get with `./x build
256-
--stage 2 compiler/rustc`) has quite a few more steps:
257+
--stage 2 rustc`) has quite a few more steps:
257258

258259
- Build `rustc` with the stage1 compiler.
259260
- The resulting compiler here is called the "stage2" compiler, which uses stage1 std from the previous command.

src/doc/rustc-dev-guide/src/compiler-team.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,3 @@ Getting on the reviewer rotation is much appreciated as it lowers the
134134
review burden for all of us! However, if you don't have time to give
135135
people timely feedback on their PRs, it may be better that you don't
136136
get on the list.
137-
138-
### Full team membership
139-
140-
Full team membership is typically extended once someone made many
141-
contributions to the Rust compiler over time, ideally (but not
142-
necessarily) to multiple areas. Sometimes this might be implementing a
143-
new feature, but it is also important — perhaps more important! — to
144-
have time and willingness to help out with general upkeep such as
145-
bugfixes, tracking regressions, and other less glamorous work.

src/doc/rustc-dev-guide/src/rustc-driver/intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ specifically [`rustc_driver_impl::run_compiler`][rdi_rc]
3434
[`rustc_driver`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/
3535
[`rustc_interface`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/index.html
3636
[`Callbacks`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/trait.Callbacks.html
37-
[example]: https://github.com/rust-lang/rustc-dev-guide/blob/master/examples/rustc-interface-example.rs
37+
[example]: https://github.com/rust-lang/rustc-dev-guide/blob/main/examples/rustc-interface-example.rs
3838
[i_rc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/interface/fn.run_compiler.html
3939
[rd_rc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/fn.run_compiler.html
4040
[rdi_rc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver_impl/fn.run_compiler.html

src/doc/rustc-dev-guide/src/rustdoc.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ does is call the `main()` that's in this crate's `lib.rs`, though.)
6060
* Use `./x test tests/rustdoc*` to run the tests using a stage1
6161
rustdoc.
6262
* See [Rustdoc internals] for more information about tests.
63+
* Use `./x.py test tidy --extra-checks=js` to run rustdoc’s JavaScript checks (`eslint`, `es-check`, and `tsc`).
64+
> **Note:** `./x.py test tidy` already runs these checks automatically when JS/TS sources changed; `--extra-checks=js` forces them explicitly.
65+
66+
### JavaScript CI checks
67+
68+
Rustdoc’s JavaScript and TypeScript are checked during CI by `eslint`, `es-check`, and `tsc` (not by compiletest). These run as part of the `tidy` job.
69+
70+
```bash
71+
./x.py test tidy --extra-checks=js
72+
```
73+
74+
The `--extra-checks=js` flag enables the frontend linting that runs in CI.
6375

6476
[`bootstrap.toml`]: ./building/how-to-build-and-run.md
6577

0 commit comments

Comments
 (0)