about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide
AgeCommit message (Collapse)AuthorLines
2025-03-10Handle backticks in try job patternsJakub Beránek-11/+16
2025-03-10Modify try-job documentationJakub Beránek-5/+8
2025-03-07Document that `rmake.rs`/`run-make-support` may not use unstable features许杰友 Jieyou Xu (Joe)-0/+4
2025-03-05Rollup merge of #136581 - jieyouxu:makefile-be-gone, r=Kobzol许杰友 Jieyou Xu (Joe)-60/+2
Retire the legacy `Makefile`-based `run-make` test infra The final piece of [porting run-make tests to use Rust #121876](https://github.com/rust-lang/rust/issues/121876). Closes #121876. Closes #40713. Closes #81791 (no longer using `wc`). Closes #56475 (no longer a problem in current form of that test; we don't ignore the test on `aarch64-unknown-linux-gnu`). ### Summary This PR removes the legacy `Makefile`-based `run-make` test infra which has served us well over the years. The legacy infra is no longer needed since we ported all of `Makefile`-based `run-make` tests to the new `rmake.rs` infra. Additionally, this PR: - Removes `tests/run-make/tools.mk` since no more `Makefile`-based tests remain. - Updates `tests/run-make/README.md` and rustc-dev-guide docs to remove mention about `Makefile`-based `run-make` tests - Update test suite requirements in rustc-dev-guide on Windows to no longer need MSYS2 (they should also now run successfully on native Windows MSVC). - Update `triagebot.toml` to stop backlinking to #121876. **Thanks to everyone who helped in this effort to modernize the `run-make` test infra and test suite!** r? bootstrap
2025-03-04Auto merge of #135695 - Noratrieb:elf-raw-dylib, r=bjorn3bors-0/+1
Support raw-dylib link kind on ELF raw-dylib is a link kind that allows rustc to link against a library without having any library files present. This currently only exists on Windows. rustc will take all the symbols from raw-dylib link blocks and put them in an import library, where they can then be resolved by the linker. While import libraries don't exist on ELF, it would still be convenient to have this same functionality. Not having the libraries present at build-time can be convenient for several reasons, especially cross-compilation. With raw-dylib, code linking against a library can be cross-compiled without needing to have these libraries available on the build machine. If the libc crate makes use of this, it would allow cross-compilation without having any libc available on the build machine. This is not yet possible with this implementation, at least against libc's like glibc that use symbol versioning. The raw-dylib kind could be extended with support for symbol versioning in the future. This implementation is very experimental and I have not tested it very well. I have tested it for a toy example and the lz4-sys crate, where it was able to successfully link a binary despite not having a corresponding library at build-time. I was inspired by Björn's comments in https://internals.rust-lang.org/t/bundle-zig-cc-in-rustup-by-default/22096/27 Tracking issue: #135694 r? bjorn3 try-job: aarch64-apple try-job: x86_64-msvc-1 try-job: x86_64-msvc-2 try-job: test-various
2025-03-03Remove some unnecessary aliases from `rustc_data_structures::sync`Zalathar-2/+0
With the removal of `cfg(parallel_compiler)`, these are always shared references and `std::sync::OnceLock`.
2025-03-02Auto merge of #136864 - Kobzol:citool, r=marcoienibors-4/+13
Rewrite the `ci.py` script in Rust It would seem that I would learn by now that any script written in Python will become unmaintainable sooner or later, but alas.. r? `@marcoieni` try-job: aarch64-gnu try-job: dist-x86_64-linux-alt try-job: x86_64-msvc-ext2 Fixes: https://github.com/rust-lang/rust/issues/137013
2025-03-02rustc-dev-guide: remove mentions of legacy `Makefile` run-make infra许杰友 Jieyou Xu (Joe)-60/+2
And remove outdated requirements to run `run-make` tests on Windows.
2025-02-26Support raw-dylib link kind on ELFNoratrieb-0/+1
raw-dylib is a link kind that allows rustc to link against a library without having any library files present. This currently only exists on Windows. rustc will take all the symbols from raw-dylib link blocks and put them in an import library, where they can then be resolved by the linker. While import libraries don't exist on ELF, it would still be convenient to have this same functionality. Not having the libraries present at build-time can be convenient for several reasons, especially cross-compilation. With raw-dylib, code linking against a library can be cross-compiled without needing to have these libraries available on the build machine. If the libc crate makes use of this, it would allow cross-compilation without having any libc available on the build machine. This is not yet possible with this implementation, at least against libc's like glibc that use symbol versioning. The raw-dylib kind could be extended with support for symbol versioning in the future. This implementation is very experimental and I have not tested it very well. I have tested it for a toy example and the lz4-sys crate, where it was able to successfully link a binary despite not having a corresponding library at build-time.
2025-02-25Merge from rustcBoxy-12/+63
2025-02-25Preparing for merge from rustcBoxy-1/+1
2025-02-25Fix posting message to ZulipJakub Beránek-1/+1
2025-02-24use lua localsjyn-5/+5
Co-authored-by: DianQK <dianqk@dianqk.net>
2025-02-23document how to setup RA for nvim automaticallyjyn-4/+29
2025-02-23Auto merge of #137215 - onur-ozkan:rustc-tool-build-stages, r=jieyouxu,Kobzolbors-0/+24
stabilize stage management for rustc tools https://github.com/rust-lang/rust/pull/135990 got out of control due to excessive complexity. This PR aims to achieve the same goal with a simpler approach, likely through multiple smaller PRs. I will keep the other one read-only and open as a reference for future work. This work stabilizes the staging logic for `ToolRustc` programs, so you no longer need to handle build and target compilers separately in steps. Previously, most tools didn't do this correctly, which was causing the compiler to be built twice (e.g., `x test cargo --stage 1` would compile the stage 2 compiler before, but now it only compiles the stage 1 compiler). I also tried to document how we should write `ToolRustc` steps as they are quite different and require more attention than other tools. Next goal is to stabilize how stages are handled for the rustc itself. Currently, `x build --stage 1` builds the stage 1 compiler which is fine, but `x build compiler --stage 1` builds stage 2 compiler. ~~for now, r? ghost~~
2025-02-20Merge pull request #2256 from torfsen/fix-examples-for-nightly-2025-02-13许杰友 Jieyou Xu (Joe)-14/+37
2025-02-19Rollup merge of #137227 - epage:features_untracked, r=compiler-errorsMatthias Krüger-3/+1
docs(dev): Update the feature-gate instructions `features_untracked` was removed in #114723 features are now functions as of #132027
2025-02-19Rollup merge of #127793 - ChaiTRex:zed_support, r=KobzolMatthias Krüger-0/+11
Added project-specific Zed IDE settings This repository currently has project-specific VS Code IDE settings in `.vscode` and `compiler/rustc_codegen_cranelift/.vscode`. Now there are equivalent project-specific Zed IDE settings alongside those. This fixes `rust-analyzer` not being able to properly handle this project. Note that: 1. The contents of `src/tools/rust-analyzer/.vscode` could not be translated to Zed, as they aren't basic IDE settings. 2. One of the VS Code settings in `.vscode` has no corresponding setting in Zed, and so this has been noted like this: ```json "_settings_only_in_vs_code_not_yet_in_zed": { "git.detectSubmodulesLimit": 20 }, ```
2025-02-19add rustc-dev doc about bootstrap toolsonur-ozkan-0/+24
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-02-18docs(dev): Access features as functions, not membersEd Page-1/+1
This was changed in #132027
2025-02-18docs(dev): Remove reference to features_untrackedEd Page-3/+1
This was removed in #114723
2025-02-17Add Zed to dev guide suggested workflows pageChai T. Rex-0/+11
2025-02-17Update documentationJakub Beránek-4/+13
2025-02-17Rollup merge of #137080 - jieyouxu:more-tracing, r=onur-ozkanMatthias Krüger-0/+8
bootstrap: add more tracing to compiler/std/llvm flows - Add more tracing to compiler/std/llvm flows. - Two drive-by nits: 1. Take `TargetSelection` by-value for `builder.is_builder_target()`. Noticed while adding tracing; follow-up to #136767. 2. Coalesce enzyme build logic into one branch. - Document `COMPILER{,_FOR}` tracing targets for #96176. - No functional changes. ### Testing You can play with the tracing locally with: ``` $ BOOTSTRAP_TRACING=bootstrap=debug ./x build library $ BOOTSTRAP_TRACING=bootstrap=trace ./x build library $ BOOTSTRAP_TRACING=bootstrap=trace,COMPILER=trace,COMPILER_FOR=trace ./x build library ``` ### Previews ``` $ BOOTSTRAP_TRACING=bootstrap=debug ./x build library ``` ![Screenshot 2025-02-15 230824](https://github.com/user-attachments/assets/c3b02b62-d52e-4c03-a00a-da0d95618989) ``` $ BOOTSTRAP_TRACING=bootstrap=trace,COMPILER=trace,COMPILER_FOR=trace ./x build library ``` ![Screenshot 2025-02-15 233859](https://github.com/user-attachments/assets/842e4ece-4c26-4191-acbb-5f93e42de4dc) r? ``@onur-ozkan`` (or reroll)
2025-02-17Move some `Map` methods onto `TyCtxt`.Nicholas Nethercote-1/+1
The end goal is to eliminate `Map` altogether. I added a `hir_` prefix to all of them, that seemed simplest. The exceptions are `module_items` which became `hir_module_free_items` because there was already a `hir_module_items`, and `items` which became `hir_free_items` for consistency with `hir_module_free_items`.
2025-02-16Bump mdbook-linkcheck2 dependency versionMartin Liska-1/+1
2025-02-16rustc-dev-guide: document `COMPILER` and `COMPILER_FOR` tracing targets许杰友 Jieyou Xu (Joe)-0/+8
2025-02-15Merge pull request #2246 from marxin/CI-more-ofterNoah Lev-2/+2
Run CI multiple times a day
2025-02-15Merge pull request #2254 from marxin/start-using-latest-linkcheck2Noah Lev-1/+1
Start using latest release where -f checks all local links
2025-02-15Fix CI scheduleMartin Liska-1/+1
2025-02-15Fix examples to work with nightly-2025-02-13Florian Brucker-14/+37
While there were comments indicating which nightly versions the examples were tested with, those versions did not work for me: neither did the examples compile, nor did they produce the expected output. This commit fixes the compilation issues, using nightly-2025-02-13 for all examples (previously the version differed between the examples) and, in the case of the `rustc_driver` examples, also fixes the argument passing: rustc ignores the first argument, so we need to pass the filename as the second (otherwise we only get the help text printed). Note that the `rustc-interface-getting-diagnostics.rs` example still does not produce any output, which I assume is not how it is intended. However, I don't know enough to fix it. To avoid inconsistencies between the documented version and the actually required version I've moved the version comment from the Markdown into the Rust code where it hopefully won't be forgotten as easily. Finally I've clarified in the examples' README that you also need to use the proper nightly version when compiling the examples, not just when running them.
2025-02-15rustc-dev-guide: document `{ignore,only}-rustc_abi-x86-sse2`许杰友 Jieyou Xu (Joe)-0/+1
2025-02-14Merge pull request #2252 from chenyukang/fix-perf许杰友 Jieyou Xu (Joe)-0/+7
Add note for perf issue
2025-02-14Start using latest release where -f checks all local linksMartin Liska-1/+1
2025-02-14Fix borked linkMartin Liska-1/+1
2025-02-14add notes for perf issueyukang-0/+7
2025-02-13Rollup merge of #136924 - Kobzol:bootstrap-tracing, r=jieyouxuJubilee-0/+8
Add profiling of bootstrap commands using Chrome events Since we now have support for tracing in bootstrap, and the execution of most commands is centralized within a few functions, it's quite trivial to also trace command execution, and visualize it using the Chrome profiler. This can be helpful both to profile what takes time in bootstrap and also to get a visual idea of what happens in a given bootstrap invocation (since the execution of external commands is usually the most interesting thing). This is how it looks: ![image](https://github.com/user-attachments/assets/3351489e-3a0f-4729-9082-5bf40c586d4b) I first tried to use [tracing-flame](https://github.com/tokio-rs/tracing/tree/master/tracing-flame), but the output wasn't very useful, because the event/stackframe names were bootstrap code locations, instead of the command contents. r? ``@jieyouxu``
2025-02-13Auto merge of #136593 - lukas-code:ty-value-perf, r=oli-obkbors-2/+2
valtree performance tuning Summary: This PR makes type checking of code with many type-level constants faster. After https://github.com/rust-lang/rust/pull/136180 was merged, we observed a small perf regression (https://github.com/rust-lang/rust/pull/136318#issuecomment-2635562821). This happened because that PR introduced additional copies in the fast reject code path for consts, which is very hot for certain crates: https://github.com/rust-lang/rust/blob/6c1d960d88dd3755548b3818630acb63fa98187e/compiler/rustc_type_ir/src/fast_reject.rs#L486-L487 This PR improves the performance again by properly interning the valtrees so that copying and comparing them becomes faster. This will become especially useful with `feature(adt_const_params)`, so the fast reject code doesn't have to do a deep compare of the valtrees. Note that we can't just compare the interned consts themselves in the fast reject, because sometimes `'static` lifetimes in the type are be replaced with inference variables (due to canonicalization) on one side but not the other. A less invasive alternative that I considered is simply avoiding copies introduced by https://github.com/rust-lang/rust/pull/136180 and comparing the valtrees it in-place (see commit: https://github.com/rust-lang/rust/commit/9e91e50ac5920f0b9b4a3b1e0880c85336ba5c64 / perf results: https://github.com/rust-lang/rust/pull/136593#issuecomment-2642303245), however that was still measurably slower than interning. There are some minor regressions in secondary benchmarks: These happen due to changes in memory allocations and seem acceptable to me. The crates that make heavy use of valtrees show no significant changes in memory usage.
2025-02-13Document bootstrap profilingJakub Beránek-0/+8
2025-02-13Rollup merge of #136858 - safinaskar:parallel-cleanup-2025-02-11-07-54, ↵Jacob Pratt-5/+0
r=SparrowLii Parallel-compiler-related cleanup Parallel-compiler-related cleanup I carefully split changes into commits. Commit messages are self-explanatory. Squashing is not recommended. cc "Parallel Rustc Front-end" https://github.com/rust-lang/rust/issues/113349 r? SparrowLii ``@rustbot`` label: +WG-compiler-parallel
2025-02-12document bootstrap loggingjyn-2/+41
2025-02-13intern valtreesLukas Markeffsky-2/+2
2025-02-12Rollup merge of #136871 - madsmtm:link-to-lang-procedures, r=scottmcmGuillaume Gomez-0/+4
dev-guide: Link to `t-lang` procedures for new features I was confused in https://github.com/rust-lang/rust/pull/136867, because while I did remember that such a procedure existed, but I couldn't seem to find it in the dev guide.
2025-02-12Auto merge of #135336 - tshepang:patch-5, r=jieyouxubors-0/+2
clarify and document needs-dynamic-linking try-job: test-various
2025-02-12Run CI multiple times a dayMartin Liska-2/+2
2025-02-11document the directiveTshepang Mbambo-0/+2
2025-02-11dev-guide: Link to t-lang procedures for new featuresMads Marquart-0/+4
2025-02-11src/doc/rustc-dev-guide/src/parallel-rustc.md: remove Arc and Rc (it seems ↵Askar Safin-2/+0
they are left-over after my PR)
2025-02-11compiler/rustc_data_structures/src/sync.rs: remove atomics, but not AtomicU64!Askar Safin-1/+0
2025-02-11compiler/rustc_data_structures/src/sync.rs: delete WeakAskar Safin-1/+0