about summary refs log tree commit diff
path: root/src/bootstrap/lib.rs
AgeCommit message (Collapse)AuthorLines
2023-04-02Replace any existing `build/host` symlinkJynn Nelson-11/+12
This has two advantages: 1. If `build.build` changes between runs, the symlink is no longer silently wrong. 2. If the entire build directory is moved, the symlink is no longer broken because it points to the wrong absolute path.
2023-03-29Auto merge of #108792 - Amanieu:ohos, r=petrochenkovbors-0/+2
Add OpenHarmony targets - `aarch64-unknown-linux-ohos` - `armv7-unknown-linux-ohos` Compiler team MCP: https://github.com/rust-lang/compiler-team/issues/568
2023-03-28Add OpenHarmony targetsAmanieu d'Antras-0/+2
- `aarch64-unknown-linux-ohos` - `armv7-unknown-linux-ohos`
2023-03-28Rollup merge of #91793 - devnexen:anc_data_fbsd, r=ChrisDentonnils-0/+1
socket ancillary data implementation for FreeBSD (from 13 and above). introducing new build config as well.
2023-03-27socket ancillary data implementation for FreeBSD (from 13 and above).David CARLIER-0/+1
introducing new build config as well.
2023-03-24Rename 'src/bootstrap/native.rs' to llvm.rsRobin Hafid-1/+1
Renamed 'native.rs' to 'llvm.rs', also moved `TestHelpers` to `test.rs`.Replaced all the `native.rs` ocurrences at `src/bootstrap` files to `llvm.rs`
2023-03-23Rollup merge of #109295 - ozkanonur:issue-109286, r=ozkanonurDylan DPC-6/+7
refactor `fn bootstrap::builder::Builder::compiler_for` logic - check compiler stage before forcing for stage2. - check if download_rustc is not set before forcing for stage1. resolves #109286
2023-03-21Auto merge of #108659 - ferrocene:pa-test-metrics, r=Mark-Simulacrumbors-0/+27
Include executed tests in the build metrics (and use a custom test display impl) The main goal of this PR is to include all tests executed in CI inside the build metrics JSON files. I need this for Ferrocene, and `@Mark-Simulacrum` expressed desire to have this as well to ensure all tests are executed at least once somewhere in CI. Unfortunately implementing this required rewriting inside of bootstrap all of the code to render the test output to console. libtest supports outputting JSON instead of raw text, which we can indeed use to populate the build metrics. Doing that suppresses the console output though, and compared to rustc and Cargo the console output is not included as a JSON field. Because of that, this PR had to reimplement both the "pretty" format (one test per line, with `rust.verbose-tests = true`), and the "terse" format (the wall of dots, with `rust.verbose-tests = false`). The current implementation should have the exact same output as libtest, except for the benchmark output. libtest's benchmark output is broken in the "terse" format, so since that's our default I slightly improved how it's rendered. Also, to bring parity with libtest I had to introduce support for coloring output from bootstrap, using the same dependencies `annotate-snippets` uses. It's now possible to use `builder.color_for_stdout(Color::Red, "text")` and `builder.color_for_stderr(Color::Green, "text")` across all of bootstrap, automatically respecting the `--color` flag and whether the stream is a terminal or not. I recommend reviewing the PR commit-by-commit. r? `@Mark-Simulacrum`
2023-03-20migrate compiler, bootstrap, and compiletest to windows-rsAndy Russell-0/+3
2023-03-18refactor `fn bootstrap::builder::Builder::compiler_for`ozkanonur-6/+7
- check compiler stage before forcing for stage2. - check if download_rustc is not set before forcing for stage1. Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-03-14Create dir for build_tripleMu001999-0/+1
2023-03-08Auto merge of #108534 - Mark-Simulacrum:compression, r=pietroalbinibors-6/+1
Import rust-installer & adjust compression settings This brings in rust-lang/rust-installer#123, which enables a larger compression window (8 -> 64MB) amongst other changes to the xz compression settings. The net effect should be smaller compressed tarballs which will decrease bandwidth usage for static.rust-lang.org, download times, and decompression time. This comes at the cost of higher baseline requirements for running rustup to use these files, which we believe should be largely acceptable (running rustc is likely to use at least this much memory) but if we get specific reports we may explore options to decrease impact (e.g., using the gzip tarballs automatically in rustup). To simplify iteration on compression settings this also imports the rust-lang/rust-installer submodule, it is now hosted fully inside rust-lang/rust. Once we land this I'll file a followup to add a note to that repo and we can subsequently archive it. -- CI times for dist-x86_64-linux builds: * threads=6, master - 2h 50m * threads=1, new - 3h 40m * threads=6, new - 2h 50m
2023-03-08Add force to use the stage 2 compiler in compiler_for when ↵morine0122-0/+9
config.download_rustc is set
2023-03-07Add bootstrap support for rust-installerMark Rousskov-6/+1
2023-03-07switch to termcolorPietro Albini-11/+19
2023-03-02add a splash of colorPietro Albini-0/+18
2023-03-02render compiletest output with render_testsPietro Albini-0/+1
2023-02-21Revert "port over symlink_file function from Build to Config and create ↵Jakub Beránek-1/+10
symlink for legacy rustfmt path" This reverts commit 41c6c5d4996728b5a635319ef9b077a3d0ccc480.
2023-02-09port over symlink_file function from Build to Config and create symlink for ↵Zephaniah Ong-10/+1
legacy rustfmt path
2023-02-04Rollup merge of #107116 - ozkanonur:consolidate-bootstrap-docs, r=jyn514Matthias Krüger-87/+0
consolidate bootstrap docs With this diff, I tried to consolidate bootstrap documentations and remove the duplicated informations. Coupled with https://github.com/rust-lang/rustc-dev-guide/pull/1563 Resolves #90686 Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-02-04consolidate bootstrap docsozkanonur-87/+0
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-01-30Auto merge of #107080 - Urgau:cleanup-bootstrap-extra-check-cfgs, ↵bors-14/+8
r=Mark-Simulacrum bootstrap: cleanup the list of extra check cfgs This PR performs some cleanups on the `EXTRA_CHECK_CFGS` list in bootstrap. - `target_os=watchos`: no longer relevant because there are now proper targets `*-apple-watchos` - `target_arch=nvptx64`: target `nvptx64-nvidia-cuda` makes it useless - `target_arch=le32`: target was removed (https://github.com/rust-lang/rust/pull/45041) - `release`: was removed from rustfmt (https://github.com/rust-lang/rustfmt/pull/5375 and https://github.com/rust-lang/rustfmt/pull/5449) - `dont_compile_me`: was removed from stdarch (https://github.com/rust-lang/stdarch/pull/1308) Also made some external cfg exception mode clear and only activated for rustc and rustc tools (as to not have the Standard Library unintentionally depend on them).
2023-01-30Rollup merge of #106106 - jyn514:remote-tracking-branch, r=Mark-SimulacrumDylan DPC-3/+23
Pass `branch.{branch}.remote=origin` to `git submodule update` This works around a bug in git itself. Fixes https://github.com/rust-lang/rust/issues/101144.
2023-01-29When stamp doesn't exist, should say Error, and print path to stamp fileteapot4195-1/+2
2023-01-28Gracefully exit when --keep-stage used on clean source treeteapot4195-0/+7
2023-01-25Cleanup extra check configs in bootstrapUrgau-14/+8
- `target_os=watchos`: no longer relevant because there are now proper targets `*-apple-watchos` - `target_arch=nvptx64`: `nvptx64-nvidia-cuda` - `target_arch=le32`: target was removed (https://github.com/rust-lang/rust/pull/45041) - `release`: was removed from rustfmt (https://github.com/rust-lang/rustfmt/pull/5375 and https://github.com/rust-lang/rustfmt/pull/5449) - `dont_compile_me`: was removed from stdarch (https://github.com/rust-lang/stdarch/pull/1308) Also made some external cfg exception mode clear and only activated for rustc and rustc tools (as to not have the Standard Library unintentionally depend on them).
2023-01-03Add `build_helper` crate to share code between tidy and bootstrapNilstrieb-1/+2
2022-12-31Revert "Auto merge of #105058 - ↵Joshua Nelson-2/+1
Nilstrieb:no-merge-commits-for-you-only-bors-is-allowed-to-do-that, r=jyn514" This reverts commit 4839886f0abe208ab8f2bb73a3076a59fe2ab60c, reversing changes made to ce85c98575e3016cf2007d90a85be321e592aa96.
2022-12-30Add `build_helper` crate to share code between tidy and bootstrapNilstrieb-1/+2
2022-12-27Auto merge of #106168 - jyn514:clean-crates, r=Mark-Simulacrumbors-4/+0
Allow cleaning individual crates As a bonus, this stops special casing `clean` in `Builder`. ## Motivation Cleaning artifacts isn't strictly necessary to get cargo to rebuild; `touch compiler/rustc_driver/src/lib.rs` (for example) will also work. There's two reasons I thought making this part of bootstrap proper was a better approach: 1. `touch` does not *remove* artifacts, it just causes a rebuild. This is unhelpful for when you want to measure how long the compiler itself takes to build (e.g. for https://github.com/rust-lang/rust/issues/65031). 2. It seems a little more discoverable; and I want to extend it in the future to things like `x clean --stage 1 rustc`, which makes it easier to work around https://github.com/rust-lang/rust/issues/76720 without having to completely wipe all the stage 0 artifacts, or having to be intimately familiar with which directories to remove.
2022-12-26Allow cleaning individual cratesJoshua Nelson-4/+0
As a bonus, this stops special casing `clean` in `Builder`.
2022-12-26Fix panic on `x build --help --verbose`Joshua Nelson-1/+4
This also makes the panic message a little more informative in case it happens again.
2022-12-23Pass `branch.{branch}.remote=origin` to `git submodule update`Joshua Nelson-3/+23
This works around a bug in git itself; see https://github.com/rust-lang/rust/issues/101144.
2022-12-23Auto merge of #106070 - matthiaskrgr:rollup-jv9ctkl, r=matthiaskrgrbors-1/+1
Rollup of 6 pull requests Successful merges: - #105978 (Mark `proc_macro_decls_static` as always used) - #106051 (Allow building std with cranelift) - #106056 (Make `sess.bug` much less noisy) - #106057 (Give a more helpful error for "trimmed_def_paths constructed") - #106058 (Fix the issue number in comment for as_local_call_operand) - #106059 (Avoid running the `Profile` step twice on `x setup`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-23Rollup merge of #106051 - jyn514:cranelift-std, r=bjorn3Matthias Krüger-1/+1
Allow building std with cranelift - Don't pass llvm-specific args when using cranelift - Don't use `asm` in compiler_builtins when using cranelift r? `@bjorn3` cc `@Mark-Simulacrum`
2022-12-22Support documenting CargoJoshua Nelson-0/+1
The primary motivation is to have the cargo docs show up on https://doc.rust-lang.org/nightly/nightly-rustc/cargo, but as a nice side effect this makes `x doc cargo` work locally.
2022-12-22Allow building std with craneliftJoshua Nelson-1/+1
- Don't pass llvm-specific args when using cranelift - Don't use `asm` in compiler_builtins when using cranelift
2022-12-18Rollup merge of #96584 - bentongxyz:x-setup-h-v-should-work, r=jyn514Matthias Krüger-4/+0
Fix `x setup -h -v` should work r? `@jyn514` I have to convert profile to path and back in order to remove special-casing in bootstrap. I also check for `dry_run` so that `config.toml` and/ or `.git/hooks/pre-push` will not be created if `--dry-run` is specified. Please help me see if this is ok, thanks alot!
2022-12-17Remove special cases for setup subcommandBenjamin Tong-4/+0
- Remove setup special-casing in Flags::parse
2022-12-17Symlink `build/host` -> `build/x86_64-unknown-linux-gnu` (as appropriate per ↵Joshua Nelson-1/+18
target) This allows us to use a consistent path in the documentation, without having to worry about which platform people are using.
2022-12-10Rollup merge of #104512 - jyn514:download-ci-llvm-default, r=Mark-SimulacrumMatthias Krüger-2/+2
Set `download-ci-llvm = "if-available"` by default when `channel = dev` See https://github.com/rust-lang/compiler-team/issues/566. The motivation for changing the default is to avoid downloading and building LLVM when someone runs `x build` before running `x setup`. The motivation for only doing it on `channel = "dev"` is to avoid breaking distros or users installing from source. It works because `dev` is also the default channel. The diff looks larger than it is; most of it is moving the `llvm` branch below the `rust` so `config.channel` is set. r? `@Mark-Simulacrum` cc `@oli-obk` `@bjorn3` `@cuviper`
2022-12-05Rollup merge of #104953 - jyn514:fewer-submodule-updates, r=Mark-SimulacrumMatthias Krüger-3/+3
Ensure required submodules at the same time as updating existing submodules In practice, this would always happen at the same time, but putting them next to each other makes that more obvious and ensures it doesn't change in the future. It also avoids the difference affecting `cargo metadata` somehow. This is based on https://github.com/rust-lang/rust/pull/104952 for convenience to avoid merge conflicts, but doesn't depend on that PR.
2022-12-05Rollup merge of #104952 - jyn514:setup, r=Mark-SimulacrumMatthias Krüger-19/+25
Streamline the user experience for `x.py setup` ## Don't update submodules for x setup Before, the submodule handling was very jank and would update *between two interactive prompts*: ``` ; x setup Building rustbuild Finished dev [unoptimized] target(s) in 0.05s Welcome to the Rust project! What do you want to do with x.py? a) library: Contribute to the standard library Please choose one (a/b/c/d/e): a Updating submodule library/backtrace Submodule 'library/backtrace' (https://github.com/rust-lang/backtrace-rs.git) registered for path 'library/backtrace' error: you asked `x.py` to setup a new config file, but one already exists at `config.toml` Build completed unsuccessfully in 0:00:02 ``` That's not a great user experience because you need to wait a long time between prompts. It would be possible to move the submodule handling either before or after the prompt, but it seems better to just not require submodules to be checked out at all, to minimize the time spend waiting just to create a new configuration. ## Revamp the order setup executes - Create `config.toml` last. It's the most likely to error, and used to stop later steps from executing - Don't print an error message + exit if the git hook already exists; that's expected
2022-12-03Don't exit with an error if there are no changes to submodulesJoshua Nelson-2/+15
2022-11-27suggested changesPratush Rai-1/+0
2022-11-27suggested changesPratush Rai-2/+2
2022-11-26Ensure required submodules at the same time as updating existing submodulesJoshua Nelson-3/+3
In practice, this would always happen at the same time, but putting them next to each other makes that more obvious and ensures it doesn't change in the future. It also avoids the difference avoiding `cargo metadata` somehow.
2022-11-26Don't update submodules for `x setup`Joshua Nelson-19/+25
Before, the submodule handling was very jank and would update *between two interactive prompts*: ``` ; x setup Building rustbuild Finished dev [unoptimized] target(s) in 0.05s Welcome to the Rust project! What do you want to do with x.py? a) library: Contribute to the standard library Please choose one (a/b/c/d/e): a Updating submodule library/backtrace Submodule 'library/backtrace' (https://github.com/rust-lang/backtrace-rs.git) registered for path 'library/backtrace' error: you asked `x.py` to setup a new config file, but one already exists at `config.toml` Build completed unsuccessfully in 0:00:02 ``` That's not a great user experience because you need to wait a long time between prompts. It would be possible to move the submodule handling either before or after the prompt, but it seems better to just not require submodules to be checked out at all, to minimize the time spend waiting just to create a new configuration.
2022-11-25bootstrapPratush Rai-2/+4
2022-11-19Set `download-ci-llvm = "if-available"` by default when `channel = "dev"`Joshua Nelson-2/+2
See https://github.com/rust-lang/compiler-team/issues/566. The motivation for changing the default is to avoid downloading and building LLVM when someone runs `x build` before running `x setup`. The motivation for only doing it on `channel = "dev"` is to avoid breaking distros or users installing from source. It works because `dev` is also the default channel. The diff looks larger than it is; most of it is moving the `llvm` branch below the `rust` so `config.channel` is set.