about summary refs log tree commit diff
path: root/src/bootstrap/config.rs
AgeCommit message (Collapse)AuthorLines
2021-03-12Make docs-minification default to trueMichael Howell-0/+1
2021-03-12Add a `disable-minification` option for rustdocMichael Howell-0/+3
This way, you can debug rustdoc's JavaScript and CSS file with normal F12 Dev Tools and you'll have useful line numbers to work with.
2021-02-25Created experimental build.print_step_rusage settingFelix S. Klock II-0/+3
Intended to piggy-back on output from existing build.print_step_timings setting.
2021-02-21Add new rustdoc-gui test suiteGuillaume Gomez-0/+3
2021-02-08Absolute bare minimum for downloading rustc from CIJoshua Nelson-0/+3
- Use the same compiler for stage0 and stage1. This should be fixed at some point (so bootstrap isn't constantly rebuilt). - Make sure `x.py build` and `x.py check` work. - Use `git merge-base` to determine the most recent commit to download. - Copy stage0 to the various sysroots in `Sysroot`, and delegate to Sysroot in Assemble. Leave all other code unchanged. - Rename date -> key This can also be a commit hash, so 'date' is no longer a good name. - Add the commented-out option to config.toml.example - Disable all steps by default when `download-rustc` is enabled Most steps don't make sense when downloading a compiler, because they'll be pre-built in the sysroot. Only enable the ones that might be useful, in particular Rustdoc and all `check` steps. At some point, this should probably enable other tools, but rustdoc is enough to test out `download-rustc`. - Don't print 'Skipping' twice in a row Bootstrap forcibly enables a dry run if it isn't already set, so previously it would print the message twice: ``` Skipping bootstrap::compile::Std because it is not enabled for `download-rustc` Skipping bootstrap::compile::Std because it is not enabled for `download-rustc` ``` Now it correctly only prints once. ## Future work - Add FIXME about supporting beta commits - Debug logging will never work. This should be fixed.
2021-01-17Rollup merge of #81064 - Mark-Simulacrum:support-stage1-check, r=jyn514Mara Bos-1/+2
Support non-stage0 check Seems to work locally - a full stage 1 check succeeds, building std (because we can't get away with checking it), and then checking the compiler and other tools. This ran into the problem that a unconditional x.py check in stage 1 *both* checks and builds stage 1 std, and then has to clean up because for some reason the rmeta and rlib artifacts conflict (though I'm not actually entirely sure why, but it doesn't seem worth digging in in too much detail). Ideally we wouldn't be building and checking like that but it's a minor worry as checking std is pretty fast and you can avoid it if you're aiming for speed by passing the compiler (e.g., compiler/rustc) explicitly. r? ```@jyn514```
2021-01-16Allow configuring the default stage for `x.py check`Joshua Nelson-1/+2
2021-01-15Allow downloading LLVM on WindowsJoshua Nelson-2/+4
- Don't ignore packaging `llvm/lib/` for `rust-dev` when LLVM is linked statically - Add `link-type.txt` so bootstrap knows whether llvm was linked statically or dynamically - Don't assume CI LLVM is linked dynamically in `bootstrap::config` - Fall back to dynamic linking if `link-type.txt` doesn't exist - Fix existing bug that split the output of `llvm-config` on lines, not spaces - Enable building LLVM tests This works around the following llvm bug: ``` llvm-config: error: component libraries and shared library llvm-config: error: missing: /home/joshua/rustc2/build/x86_64-unknown-linux-gnu/llvm/build/lib/libgtest.a llvm-config: error: missing: /home/joshua/rustc2/build/x86_64-unknown-linux-gnu/llvm/build/lib/libgtest_main.a llvm-config: error: missing: /home/joshua/rustc2/build/x86_64-unknown-linux-gnu/llvm/build/lib/libLLVMTestingSupport.a thread 'main' panicked at 'command did not execute successfully: "/home/joshua/rustc2/build/x86_64-unknown-linux-gnu/llvm/build/bin/llvm-config" "--libfiles" ``` I'm not sure why llvm-config thinks these are required, but to avoid the error, this builds them anyway. - Temporarily set windows as the try builder. This should be reverted before merging. - Bump version of `download-ci-llvm-stamp` `src/llvm-project` hasn't changed, but the generated tarball has. - Only special case MacOS when dynamic linking. Static linking works fine. - Store `link-type.txt` to the top-level of the tarball This allows writing the link type unconditionally. Previously, bootstrap had to keep track of whether the file IO *would* succeed (it would fail if `lib/` didn't exist), which was prone to bugs. - Make `link-type.txt` required Anyone downloading this from CI should be using a version of bootstrap that matches the version of the uploaded artifacts. So a missing link-type indicates a bug in x.py.
2020-12-31Rollup merge of #80532 - tmiasko:rm;, r=Mark-SimulacrumDylan DPC-1/+1
remove unnecessary trailing semicolon from bootstrap
2020-12-30remove unnecessary trailing semicolon from bootstrapTomasz Miąsko-1/+1
2020-12-29bootstrap: add the dist.compression-formats optionPietro Albini-0/+3
The option allows to add or remove compression formats used while producing dist tarballs.
2020-12-23Auto merge of #80262 - Mark-Simulacrum:pgo-rustc, r=pietroalbinibors-0/+9
Utilize PGO for rustc linux dist builds This implements support for applying PGO to the rustc compilation step (not standard library or any tooling, including rustdoc). Expanding PGO to more tools is not terribly difficult but will involve more work and greater CI time commitment. For the same reason of avoiding greater implementation time commitment, implementing for platforms outside of x86_64-unknown-linux-gnu is skipped. In practice it should be quite simple to extend over time to more platforms. The initial implementation is intentionally minimal here to avoid too much work investment before we start seeing wins for a subset of Rust users. The choice of workloads to profile here is somewhat arbitrary, but the general rationale was to aim for a small set that largely avoided time regressions on perf.rust-lang.org's full suite of crates. The set chosen is libcore, cargo (and its dependencies), and a few ad-hoc stress tests from perf.rlo. The stress tests are arguably the most controversial, but they benefit those cases (avoiding regressions) and do not really remove wins from other benchmarks. The primary next step after this PR lands is to implement support for PGO in LLVM. It is unclear whether we can afford a full LLVM rebuild in CI, though, so the approach taken there may need to be more staggered. rustc-only PGO seems well affordable on linux at least, giving us up to 20% wall time wins on some crates for 15 minutes of extra CI time (1 hour with this PR, up from 45 minutes). The PGO data is uploaded to allow others to reuse it if attempting to reproduce the CI build or potentially, in the future, on other platforms where an off-by-one strategy is used for dist builds at minimal performance cost. r? `@michaelwoerister` (but tell me if you don't want to / don't feel comfortable approving and we can find others)
2020-12-22Utilize PGO for rustc linux dist buildsMark Rousskov-0/+9
This implements support for applying PGO to the rustc compilation step (not standard library or any tooling, including rustdoc). Expanding PGO to more tools is not terribly difficult but will involve more work and greater CI time commitment. For the same reason of avoiding greater time commitment, this currently avoids implementing for platforms outside of x86_64-unknown-linux-gnu, though in practice it should be quite simple to extend over time to more platforms. The initial implementation is intentionally minimal here to avoid too much work investment before we start seeing wins for a subset of Rust users. The choice of workloads to profile here is somewhat arbitrary, but the general rationale was to aim for a small set that largely avoided time regressions on perf.rust-lang.org's full suite of crates. The set chosen is libcore, cargo (and its dependencies), and a few ad-hoc stress tests from perf.rlo. The stress tests are arguably the most controversial, but they benefit those cases (avoiding regressions) and do not really remove wins from other benchmarks. The primary next step after this PR lands is to implement support for PGO in LLVM. It is unclear whether we can afford a full LLVM rebuild in CI, though, so the approach taken there may need to be more staggered. rustc-only PGO seems well affordable on linux at least, giving us up to 20% wall time wins on some crates for 15 minutes of extra CI time (1 hour up from 45 minutes). The PGO data is uploaded to allow others to reuse it if attempting to reproduce the CI build or potentially, in the future, on other platforms where an off-by-one strategy is used for dist builds at minimal performance cost.
2020-12-20Skip `dsymutil` by default for compiler bootstrapJ. Ryan Stinnett-0/+3
`dsymutil` adds time to builds on Apple platforms for no clear benefit, and also makes it more difficult for debuggers to find debug info. The compiler currently defaults to running `dsymutil` to preserve its historical default, but when compiling the compiler itself, we skip it by default since we know it's safe to do so in that case.
2020-11-29Fix a bootstrap commentnooberfsh-1/+1
2020-11-21Auto merge of #79115 - cuviper:rust-description, r=Mark-Simulacrumbors-0/+3
x.py: allow a custom string appended to the version This adds `rust.description` to the config as a descriptive string to be appended to `rustc --version` output, which is also used in places like debuginfo `DW_AT_producer`. This may be useful for supplementary build information, like distro-specific package versions. For example, in Fedora 33, `gcc --version` outputs: gcc (GCC) 10.2.1 20201016 (Red Hat 10.2.1-6) With this change, we can add similar vendor info to `rustc --version`.
2020-11-18fix handling the default config for profiler and sanitizers12101111-8/+8
2020-11-16x.py: allow a custom string appended to the versionJosh Stone-0/+3
This adds `rust.description` to the config as a descriptive string to be appended to `rustc --version` output, which is also used in places like debuginfo `DW_AT_producer`. This may be useful for supplementary build information, like distro-specific package versions. For example, in Fedora 33, `gcc --version` outputs: gcc (GCC) 10.2.1 20201016 (Red Hat 10.2.1-6) With this change, we can add similar vendor info to `rustc --version`.
2020-11-12Add `--color` support to bootstrapJoshua Nelson-1/+3
This allows using bootstrap with https://github.com/Canop/bacon.
2020-11-11Rollup merge of #78354 - 12101111:rustbuild_profiler, r=Mark-SimulacrumJonas Schievink-0/+22
Support enable/disable sanitizers/profiler per target This PR add options under `[target.*]` of `config.toml` which can enable or disable sanitizers/profiler runtime for corresponding target. If these options are empty, the global options under `[build]` will take effect. Fix #78329
2020-11-09Rollup merge of #78566 - JRF63:polly, r=Mark-SimulacrumDylan DPC-0/+4
Enable LLVM Polly via llvm-args. I think doing it this way is better than in #51061. Polly has other useful options and we probably don't want to create a `-Z` flag for each one of them. ![results](https://user-images.githubusercontent.com/7283601/97695555-338f7180-1adf-11eb-82bd-5130e0e6fa89.png) [Benchmark](https://gist.github.com/JRF63/9a6268b91720958e90dbe7abffe20298) I noticed that `-lto` seems to interfere with polly in this specific microbenchmark, as enabling it causes the perf to drop to that of non-polly builds. Other related PRs: #75615
2020-11-07Honor the rustfmt setting in config.tomlJake Goulding-5/+12
Prior to this, setting the rustfmt configuration was ignored: ``` % mkdir example % cd example % ../configure --set build.rustfmt=/usr/bin/true % ../x.py fmt ./x.py fmt is not supported on this channel failed to run: /Users/shep/Projects/rust/example/build/bootstrap/debug/bootstrap fmt Build completed unsuccessfully in 0:00:01 ``` And after: ``` % ../x.py fmt Build completed successfully in 0:00:11 ```
2020-10-30Enable LLVM Polly via llvm-args.Joseph Rafael Ferrer-0/+4
2020-10-26Support enable/disable sanitizers/profiler per target12101111-0/+22
2020-10-21allow using the system-wide llvm-libunwind as the unwinderMarc-Antoine Perennou-3/+32
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2020-10-13Implement "if-available" option for download-ci-llvmAntoine Martin-2/+9
2020-10-12bootstrap: add --include-default-paths to ./x.pyPietro Albini-0/+2
2020-10-04Rename bootstrap/defaults/{config.toml.PROFILE => config.PROFILE.toml}Thom Chiovoloni-1/+1
2020-09-30Auto merge of #77298 - jyn514:bootstrap-config, r=Mark-Simulacrumbors-5/+7
Don't warn if the config file is somewhere other than `config.toml` Previously, `config.config` was always hardcoded as `"config.toml"`. I thought that it was being overridden with the actual value later, but it turns out `flags.config` was being completely discarded. This keeps `config.config` in sync with `flags.config`. Fixes https://github.com/rust-lang/rust/issues/77293 r? `@Mark-Simulacrum` cc `@davidtwco`
2020-09-28Remove skip_only_host_stepsTyler Mandry-4/+0
And make tests explicitly list their hosts and targets.
2020-09-28bootstrap: Always build for host, even when target is givenTyler Mandry-5/+2
This changes the behavior from *not* building for host whenever an explicit target is specified. I find this much less confusing. You can still disable host steps by passing an explicit empty list for host. Fixes #76990.
2020-09-28Don't warn if the config file is somewhere other than `config.toml`Joshua Nelson-5/+7
Previously, `config.config` was always hardcoded as `"config.toml"`. I thought that it was being overridden with the actual value later, but it turns out `flags.config` was being completely discarded. This keeps `config.config` in sync with `flags.config`.
2020-09-26Rollup merge of #76631 - jyn514:x.py-setup, r=Mark-SimulacrumRalf Jung-1/+6
Add `x.py setup` Closes #76503. - Suggest `x.py setup` if config.toml doesn't exist yet - Prompt for a profile if not given on the command line - Print the configuration that will be used - Print helpful starting commands after setup - Link to the dev-guide after finishing
2020-09-24Add `x.py setup`Joshua Nelson-1/+6
- Suggest `x.py setup` if config.toml doesn't exist yet (twice, once before and once after the build) - Prompt for a profile if not given on the command line - Print the configuration file that will be used - Print helpful starting commands after setup - Link to the dev-guide after finishing - Note that distro maintainers will see the changelog warning
2020-09-23Add `keep-stage-std` to `x.py`Dylan MacKenzie-0/+2
This keeps only the `std` artifacts compiled by the given stage, not the compiler. This is useful when working on the latter stages of the compiler in tandem with the standard library, since you don't have to rebuild the *entire* compiler when the standard library changes.
2020-09-21Add a changelog for x.pyJoshua Nelson-1/+8
- Add a changelog and instructions for updating it - Use `changelog-seen` in `config.toml` and `VERSION` in bootstrap to determine whether the changelog has been read - Nag people if they haven't read the x.py changelog + Print message twice to make sure it's seen - Give different error messages depending on whether the version needs to be updated or added
2020-09-21Rollup merge of #76628 - jyn514:default-config-files, r=Mark-SimulacrumRalf Jung-25/+51
Add sample defaults for config.toml - Allow including defaults in `src/bootstrap/defaults` using `profile = "..."`. - Add default config files, with a README noting they're experimental and asking you to open an issue if you run into trouble. The config files have comments explaining why the defaults are set. - Combine config files using the `merge` dependency. This introduces a new dependency on `merge` that hasn't yet been vetted. I want to improve the output when `include = "x"` isn't found: ``` thread 'main' panicked at 'fs::read_to_string(&file) failed with No such file or directory (os error 2) ("configuration file did not exist")', src/bootstrap/config.rs:522:28 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace failed to run: /home/joshua/rustc/build/bootstrap/debug/bootstrap test tidy Build completed unsuccessfully in 0:00:00 ``` However that seems like it could be fixed in a follow-up. Closes #76619
2020-09-20Add sample defaults for config.tomlJoshua Nelson-25/+51
- Allow including defaults in `src/bootstrap/defaults` using `profile = "..."` - Add default config files - Combine config files using the merge dependency. - Add comments to default config files - Add a README asking to open an issue if the defaults are bad - Give a loud error if trying to merge `.target`, since it's not currently supported - Use an exhaustive match - Use `<none>` in config.toml.example to avoid confusion - Fix bugs in `Merge` derives Previously, it would completely ignore the profile defaults if there were any settings in `config.toml`. I sent an email to the `merge` maintainer asking them to make the behavior in this commit the default. This introduces a new dependency on `merge` that hasn't yet been vetted. I want to improve the output when `include = "x"` isn't found: ``` thread 'main' panicked at 'fs::read_to_string(&file) failed with No such file or directory (os error 2) ("configuration file did not exist")', src/bootstrap/config.rs:522:28 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace failed to run: /home/joshua/rustc/build/bootstrap/debug/bootstrap test tidy Build completed unsuccessfully in 0:00:00 ``` However that seems like it could be fixed in a follow-up.
2020-09-20Discover Rust toolchain without PythonMark Rousskov-7/+12
2020-09-20Remove support for different src directoryMark Rousskov-1/+3
This requires that bootstrap is run from the same worktree as the sources it'll build, but this is basically required for the build to work anyway. You can still run it from a different directory, just that the files it builds must be beside it.
2020-09-20Set BUILD_TRIPLE via build scriptMark Rousskov-1/+1
This moves build triple discovery for rustbuild from bootstrap.py into a build script, meaning it will "just work" if building rustbuild via Cargo rather than Python.
2020-09-19Rollup merge of #76796 - jyn514:wrong-stage, r=shepmasterRalf Jung-1/+7
Give a better error message when x.py uses the wrong stage for CI r? @shepmaster
2020-09-16Give a better error message when x.py uses the wrong stage for CIJoshua Nelson-1/+7
2020-09-16Remove unnecessary `clone()`s in bootstrapJoshua Nelson-32/+33
The performance difference is negligible, but it makes me feel better. Note that this does not remove some clones in `config`, because it would require changing the logic around (and performance doesn't matter for bootstrap).
2020-09-16Auto merge of #76625 - jyn514:default-stages, r=Mark-Simulacrumbors-6/+53
Make the default stage for x.py configurable This also allows configuring each sub-command individually. Possibly #76617 should land before this? I don't feel strongly either way, I don't mind waiting. Closes https://github.com/rust-lang/rust/issues/76165. r? `@Mark-Simulacrum`
2020-09-15Make the default stage for x.py configurableJoshua Nelson-6/+53
This allows configuring the default stage for each sub-command individually. - Normalize the stage as early as possible, so there's no confusion about which to use. - Don't add an explicit `stage` option in config.toml This offers no more flexibility than `*_stage` and makes it confusing which takes precedence. - Always give `--stage N` precedence over config.toml - Fix bootstrap tests This changes the tests to go through `Config::parse` so that they test the actual defaults, not the dummy ones provided by `default_opts`. To make this workable (and independent of the environment), it does not read `config.toml` for tests.
2020-09-13Auto merge of #76588 - guswynn:debug_logging, r=jyn514,Mark-Simulacrumbors-0/+6
Add a dedicated debug-logging option to config.toml `@Mark-Simulacrum` and I were talking in zulip and we found that turning on debug/trace logging in rustc is fairly confusing, as it effectively depends on debug-assertions and is not documented as such. `@Mark-Simulacrum` mentioned that we should probably have a separate option for logging anyways. this diff adds that, having the option follow debug-assertions (so everyone's existing config.toml should be fine) and if the option is false to test I ran ./x.py test <something> twice, once with `debug-logging = false` and once with `debug-logging = true` and made sure i only saw trace's when it was true
2020-09-12Set link-shared if LLVM ThinLTO is enabled in config.rsMark Rousskov-0/+7
This avoids missing a shared build when uplifting LLVM artifacts into the sysroot. We were already producing a shared link anyway, though, so this is not a visible change from the end user's perspective.
2020-09-12Download LLVM from CI to bootstrapMark Rousskov-0/+57
2020-09-11Stop implicitly appending triples to config.toml hosts and targetsMark Rousskov-28/+24
Previously, the CLI --target/--host definitions and configured options differed in their effect: when setting these on the CLI, only the passed triples would be compiled for, while in config.toml we would also compile for the build triple and any host triples. This is needlessly confusing; users expect --target and --host to be identical to editing the configuration file. The new behavior is to respect --host and --target when passed as the *only* configured triples (no triples are implicitly added). The default for --host is the build triple, and the default for --target is the host triple(s), either configured or the default build triple.