about summary refs log tree commit diff
path: root/src/bootstrap/config.rs
AgeCommit message (Collapse)AuthorLines
2023-04-01bootstrap replace atty with is-terminal, dedupe few depsklensy-2/+4
2023-03-24Rename 'src/bootstrap/native.rs' to llvm.rsRobin Hafid-3/+3
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-21Auto merge of #108659 - ferrocene:pa-test-metrics, r=Mark-Simulacrumbors-0/+6
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-21Rollup merge of #109124 - ferrocene:pa-compression-mode, r=Mark-Simulacrumnils-0/+4
Add `dist.compression-profile` option to control compression speed PR #108534 reduced the size of compressed archives, but (as expected) it also resulted in way longer compression times and memory usage during compression. It's desirable to keep status quo (smaller archives but more CI usage), but it should also be configurable so that downstream users don't have to waste that much time on CI. As a data point, this resulted in doubling the time of Ferrocene's dist jobs, and required us to increase the RAM allocation for one of such jobs. This PR adds a new `config.toml` setting, `dist.compression-profile`. The values can be: * `fast`: equivalent to the gzip and xz preset of "1" * `balanced`: equivalent to the gzip and xz preset of "6" (the CLI defaults as far as I'm aware) * `best`: equivalent to the gzip present of "9", and our custom xz profile The default has also been moved back to `balanced`, to try and avoid the compression time regression for downstream users. I don't feel too strongly on the default, and I'm open to changing it. Also, for the `best` profile the XZ settings do not match the "9" preset used by the CLI, and it might be confusing. Should we create a `custom-rustc-ci`/`ultra` profile for that? r? ``@Mark-Simulacrum``
2023-03-21change default to fast for everyone but the user profilePietro Albini-1/+1
2023-03-17Initialize rust_info before is_ci_llvm_available()Nikita Popov-4/+5
2023-03-15add `enable-warnings` flag for llvmozkanonur-0/+3
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-03-14add dist.compression-profile option to control compression speedPietro Albini-0/+4
2023-03-11Rename `config.toml.example` to `config.example.toml`Thom Chiovoloni-2/+2
2023-03-07Rollup merge of #108581 - jfgoog:include-mingw-linker, r=petrochenkovMatthias Krüger-0/+4
Add a new config flag, dist.include-mingw-linker. The flag controls whether to copy the linker, DLLs, and various libraries from MinGW into the rustc toolchain. It applies only when the host or target is pc-windows-gnu. The flag is true by default to preserve existing behavior.
2023-03-07Rollup merge of #108619 - jyn514:llvm-version-check, r=cuviperYuki Okushi-4/+0
Remove the option to disable `llvm-version-check` We don't support old versions of LLVM; there's no reason to have an easy way to force bootstrap to use them anyway. If someone really needs to use an unsupported version, they can modify bootstrap to change the version range. r? ``@cuviper`` on whether we want to do this or not, since you maintain rust on Fedora and touched this config last.
2023-03-05Remove the option to disable `llvm-version-check`Joshua Nelson-4/+0
We don't support old versions of LLVM; there's no reason to have an easy way to force bootstrap to use them anyway. If someone really needs to use an unsupported version, they can modify bootstrap to change the version range.
2023-03-05Rollup merge of #108613 - jyn514:rm-skip-rebuild, r=Mark-SimulacrumMatthias Krüger-9/+0
Remove `llvm.skip-rebuild` option This was added to in 2019 to speed up rebuild times when LLVM was modified. Now that download-ci-llvm exists, I don't think it makes sense to support an unsound option like this that can lead to miscompiles; and the code cleanup is nice too. r? `@Mark-Simulacrum` cc `@varkor` #65612
2023-03-02add a splash of colorPietro Albini-0/+6
2023-03-01Remove `llvm.skip-rebuild` optionJoshua Nelson-9/+0
This was added to in 2019 to speed up rebuild times when LLVM was modified. Now that download-ci-llvm exists, I don't think it makes sense to support an unsound option like this that can lead to miscompiles; and the code cleanup is nice too.
2023-02-28Add a new config flag, dist.include-mingw-linker.James Farrell-0/+4
The flag controls whether to copy the linker, DLLs, and various libraries from MinGW into the rustc toolchain. It applies only when the host or target is pc-windows-gnu. The flag is true by default to preserve existing behavior.
2023-02-27Rollup merge of #108308 - bjorn3:faster_bootstrap_build, r=albertlarsan68Matthias Krüger-0/+1
Allow building serde and serde_derive in parallel This reduces build time of bootstrap by ~6s
2023-02-27Allow building serde and serde_derive in parallelbjorn3-0/+1
This reduces build time of bootstrap by ~6s
2023-02-24Test that the compiler/library builds with -Zmir-opt-level=3 -Zvalidate-miryukang-0/+3
2023-02-19Download rustfmt regardless of rustc being set in config.tomlKittyBorgX-9/+0
2023-02-10Pass arguments to `x` subcommands with `--`clubby789-0/+5
2023-02-03Auto merge of #107241 - clubby789:bootstrap-lto-off, r=simulacrumbors-1/+3
Add `rust.lto=off` to bootstrap and set as compiler/library default Closes #107202 The issue mentions `embed-bitcode=on`, but here https://github.com/rust-lang/rust/blob/c8e6a9e8b6251bbc8276cb78cabe1998deecbed7/src/bootstrap/compile.rs#L379-L381 it appears that this is always set for std stage 1+, so I'm unsure if changes are needed here. `@rustbot` label +A-bootstrap
2023-01-30Rollup merge of #107264 - ferrocene:pa-private-items, r=Mark-SimulacrumDylan DPC-0/+3
Add option to include private items in library docs I need to perform some one-off analysis on libcore, and I wanted to use the unstable JSON rustdoc output to easily do it. Unfortunately, there is currently no way to include unstable items in the library docs. This PR adds support for that, with the off-by-default `build.library-docs-private-items` setting.
2023-01-27Revisit fix_is_ci_llvm_available logic; read build triple from tomlSergey Prytkov-0/+3
2023-01-26Add `rust.lto=off` to bootstrapclubby789-1/+3
2023-01-24add option to include private items in library docsPietro Albini-0/+3
2022-12-24Rollup merge of #105465 - jyn514:docs, r=Mark-SimulacrumMatthias Krüger-4/+1
Improve top-level docs See a detailed explanation in the commit messages. This is a companion PR to https://github.com/rust-lang/rustc-dev-guide/pull/1528. * Link to other resources instead of inlining their information * Remove ancient and outdated reference to `config.mk` * Suggest `profile = "user"` in the README * Add detail about dependencies from the dev-guide * Link to CONTRIBUTING.md instead of rustc-dev-guide in the main readme * Link to `std-dev-guide` in CONTRIBUTING.md
2022-12-23Remove ancient and outdated references to `config.mk`Joshua Nelson-4/+1
2022-12-23Rollup merge of #106051 - jyn514:cranelift-std, r=bjorn3Matthias Krüger-0/+4
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-22Allow building std with craneliftJoshua Nelson-0/+4
- Don't pass llvm-specific args when using cranelift - Don't use `asm` in compiler_builtins when using cranelift
2022-12-17Make `RUN_CHECK_WITH_PARALLEL_QUERIES` the last thing to runJoshua Nelson-0/+1
This takes a long time and rarely fails. It also interferes with `retry make prepare`, the retry is unhelpful since `make prepare` turns into a no-op
2022-12-10Rollup merge of #104512 - jyn514:download-ci-llvm-default, r=Mark-SimulacrumMatthias Krüger-94/+108
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-06Rollup merge of #104439 - ferrocene:pa-generate-copyright, r=pnkfelixMatthias Krüger-0/+3
Add prototype to generate `COPYRIGHT` from REUSE metadata This PR adds a prototype to generate the `COPYRIGHT` file from the metadata gathered with REUSE. There are two new tools: * `src/tools/collect-license-metadata` invokes REUSE, parses its output and stores a concise JSON representation of the metadata in `src/etc/license-metadata.json`. * `src/tools/generate-copyright` parses the metadata generated above, (in the future will) gather crate dependencies metadata, and renders the `COPYRIGHT.md` file. Note that since the contents of those files are currently incorrect, rather than outputting in the paths above, the files will be stored in `build/` and not committed. This will be changed once we're confident about the metadata. Eventually, `src/etc/license-metadata.json` will be committed into the repository and verified to be up to date by CI (similar to our GitHub Actions configuration), to avoid having people install REUSE on their local machine in most cases. You can see the (incorrect) generated files in https://gist.github.com/pietroalbini/3f3f22b6f9cc8533abf7494b6a50cf97. r? `@pnkfelix`
2022-11-19Set `download-ci-llvm = "if-available"` by default when `channel = "dev"`Joshua Nelson-94/+108
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.
2022-11-19Rollup merge of #103969 - ferrocene:pa-download-rustc-ui-tests, r=jyn514Matthias Krüger-9/+15
Partial support for running UI tests with `download-rustc` Right now trying to run UI tests with `download-rustc` results in a bunch of test failures, requiring someone who wants to only work on tests to also build the full compiler. This PR **partially** addresses the problem by solving a lot of the errors (but not all). * This installs the `rust-src` component on CI toolchains, since the test output depends on whether the standard library source code is installed; We can't just symlink the current source because the `rustc-dev` component already includes the compiler sources, but not the library sources, and mixing things is worse IMO. * This ensures the `$SRC_DIR` normalization done by compiletest correctly handles the source code added above. * This unconditionally sets `remap-prefix` to the prefix used in the downloaded toolchain, to ensure compiletest normalizes it.
2022-11-17fmtPietro Albini-1/+1
2022-11-17set correct default value for cc and cxx on androidPietro Albini-2/+7
2022-11-16normalize download-rustc's prefix when running compiletestsPietro Albini-9/+15
2022-11-15add the build.reuse config option to choose the reuse binaryPietro Albini-0/+3
2022-11-13Make all download functions need only Config, not BuilderJoshua Nelson-226/+88
This also adds a new `mod download` instead of scattering the download code across `config.rs` and `native.rs`.
2022-11-12Distinguish `--dry-run` from the automatic dry run checkJoshua Nelson-6/+24
2022-11-10Avoid runtime dependency on static libstdc++kubycsolutions-1/+1
Usually, we do want to use the static C++ library when building rustc_llvm, but do not want to have that dependency at compiler runtime. Change the defaults to Make It So.
2022-11-07Only set config.config to None when using default pathTanner Davies-1/+2
2022-11-05Place config.toml in current working directory if config not foundTanner Davies-2/+2
2022-11-03Fix artifact version/channel detection for stableMark Rousskov-15/+40
On stable, our artifacts are uploaded with the raw version number (e.g., 1.65.0), not the channel. This adjusts our detection logic to use the version number from src/version when we detect the stable channel.
2022-10-29Revert "Make the `c` feature for `compiler-builtins` opt-in instead of inferred"Mark Rousskov-4/+0
This reverts commit 3acb505ee560770c62bad5362f6caf7567d467b9 (PR #101833). The changes in this commit caused several bugs or at least incompatibilies. For now we're reverting this commit and will re-land it alongside fixes for those bugs.
2022-10-23Introduce dedicated `-Zdylib-lto` flag for enabling LTO on `dylib`sJakub Beránek-4/+3
2022-10-23Add `rust.lto` config optionJakub Beránek-0/+31
2022-10-10Auto merge of #94381 - Kobzol:llvm-bolt, r=Mark-Simulacrumbors-0/+11
Use BOLT in CI to optimize LLVM This PR adds an optimization step in the Linux `dist` CI pipeline that uses [BOLT](https://github.com/llvm/llvm-project/tree/main/bolt) to optimize the `libLLVM.so` library built by boostrap. Steps: - [x] Use LLVM 15 as a bootstrap compiler and use it to build BOLT - [x] Compile LLVM with support for relocations (`-DCMAKE_SHARED_LINKER_FLAGS="-Wl,-q"`) - [x] Gather profile data using instrumented LLVM - [x] Apply profile to LLVM that has already been PGOfied - [x] Run with BOLT profiling on more benchmarks - [x] Decide on the order of optimization (PGO -> BOLT?) - [x] Decide how we should get `bolt` (currently we use the host `bolt`) - [x] Clean up The latest perf results can be found [here](https://github.com/rust-lang/rust/pull/94381#issuecomment-1258269440). The current CI build time with BOLT applied is around 1h 55 minutes.
2022-10-09Use BOLT in x64 dist CI to optimize LLVMJakub Beránek-0/+11