rust/src
bors 185de5f41a Auto merge of #79540 - jyn514:no-xpy, r=Mark-Simulacrum
Allow building rustdoc without first building rustc (MVP)

 ## Motivation

The compile times for rustc are extremely long and a major issue for
recruiting new contributors to rustdoc. People interested in joining
often give up after running into issues with submodules or python
versions. stage1 rustdoc fundamentally doesn't care about bootstrapping
or stages, it just needs `rustc_private` available.

## Summary of Changes

- Add an opt-in `[rust] download_rustc` option
- Determine the version of the compiler to download using `log --author=bors`
- Do no work for any component other than `Rustdoc` for any stage. Instead, copy the CI artifacts from the downloaded sysroot stage0/ to stage0-sysroot/ or stage1/ in `Sysroot`. This is done with an `ENABLE_DOWNLOAD_STAGE1` constant which is off by default.
- Don't download different versions of rustfmt or cargo - those should still use the beta version (rustfmt especially).

The vast majority of work is done in bootstrap.py, which downloads the artifacts and extracts them to stage0/ in place of the beta compiler. Rustbuild just takes care of copying the artifacts to stage1 if necessary.

## Future work

- I turned off verification for the commit tarballs because the .sha256 URLs gave a 404. This seems not ideal, it would be nice to start signing them.
- This will break if you rebase an old enough branch (I think commits are kept at most 160 days?). This doesn't need to be supported, but it would be nice to give a reasonable error. https://github.com/rust-lang/rust/pull/79540#issuecomment-751481291
- Right now, every time you rebase, stage0 tools (bootstrap, tidy, ...) will have to be recompiled. Additionally running `x.py setup tools` will compile rustbuild twice. Instead, this should download a separate beta compiler for stage0 and only use CI artifacts for stage1 onward. https://github.com/rust-lang/rust/pull/79540#issuecomment-757047321
- Add `x.py setup tools` to enable this conveniently (it doesn't make sense to use this for compiler developers). cb5d8c8522
- Compile a new version of tracing so that rustdoc still gets debug logging (since CI artifacts always disable `debug` and `trace` logging). https://github.com/rust-lang/rust/pull/79540#issuecomment-742756411, 6a5d512420
- Right now only rustdoc is ever rebuilt. This is not ideal and should probably at least compile compiler tools (rustfmt, clippy, miri). https://github.com/rust-lang/rust/pull/79540#issuecomment-775634693
- Using `git log --author=bors` sometimes breaks. This should use `git merge-base` instead. https://github.com/rust-lang/rust/pull/79540#discussion_r572572280
- It would be nice to support cross-compiling the standard library. Right now this gives an assertion failure I think.

Some of this work has already been done in (the history for) 673476c785.
2021-02-09 15:28:28 +00:00
..
bootstrap Auto merge of #79540 - jyn514:no-xpy, r=Mark-Simulacrum 2021-02-09 15:28:28 +00:00
build_helper
ci Auto merge of #81821 - nikic:update-wasm32, r=sanxiyn 2021-02-07 02:36:08 +00:00
doc Add `--extern-loc` to augment unused crate dependency diagnostics 2021-02-07 14:54:20 -08:00
etc Resolve typedef in HashMap lldb pretty-printer only if possible 2021-02-06 20:24:07 +03:00
librustdoc Auto merge of #81313 - LeSeulArtichaut:revert-32558, r=jyn514 2021-02-08 10:46:10 +00:00
llvm-project@70d09f218d Bump LLVM submodule 2021-01-27 23:08:54 +00:00
rustdoc-json-types expand/resolve: Turn `#[derive]` into a regular macro attribute 2021-02-07 20:08:45 +03:00
test Auto merge of #81384 - tmiasko:partial-ord, r=petrochenkov 2021-02-09 08:47:38 +00:00
tools update Miri 2021-02-09 11:05:51 +01:00
README.md
stage0.txt Bump rustfmt version 2021-02-02 09:09:52 -05:00
version bump nightly version to 1.52.0 2021-02-05 16:25:08 +01:00

README.md

This directory contains the source code of the rust project, including:

  • The test suite
  • The bootstrapping build system
  • Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.