about summary refs log tree commit diff
path: root/src/bootstrap/config.rs
AgeCommit message (Collapse)AuthorLines
2023-10-17move bootstrap core implementation to bootstrap/src/core moduleonur-ozkan-2120/+0
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-09Add `--enable-bolt-settings` bootstrap flagJakub Beránek-0/+2
2023-10-02Auto merge of #115898 - onur-ozkan:config-change-tracking, r=Mark-Simulacrumbors-3/+17
bootstrap major change detection implementation The use of `changelog-seen` and `bootstrap/CHANGELOG.md` has not been functional in any way for many years. We often do major/breaking changes but never update the changelog file or the `changelog-seen`. This is an alternative method for tracking major or breaking changes and informing developers when such changes occur. Example output when bootstrap detects a major change: ![image](https://github.com/rust-lang/rust/assets/39852038/ee802dfa-a02b-488b-a433-f853ce079b8a)
2023-10-01implement major change tracking for the bootstrap configurationonur-ozkan-3/+17
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-09-22Add Minimal Std implementation for UEFIAyush Singh-5/+1
Implemented modules: 1. alloc 2. os_str 3. env 4. math Tracking Issue: https://github.com/rust-lang/rust/issues/100499 API Change Proposal: https://github.com/rust-lang/libs-team/issues/87 This was originally part of https://github.com/rust-lang/rust/pull/100316. Since that PR was becoming too unwieldy and cluttered, and with suggestion from @dvdhrm, I have extracted a minimal std implementation to this PR. Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2023-09-17micro-level optimizations for bootstraponur-ozkan-22/+7
Overall optimizations for bootstrap on conditions, assertions, trait implementations, etc. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-08-24Rollup merge of #115117 - pnkfelix:detect-and-report-nix-shell, r=albertlarsan68Weihang Lo-2/+2
Detect and report nix shell Better diagnostics for people using nix subshell on non-NixOS. 1. Turned patch-binaries-for-nix from a boolean into a ternary flag: true, false, and unset. 2. When patch-binaries-for-nix is unset, we continue with the existing NixOS detection heuristic (look for nixos in /etc/os-release, if present), but if we are not atop NixOS, then issue a note if we see the IN_NIX_SHELL environment variable telling the user to consider setting patch-binaries-for-nix explicitly. Fix #115073
2023-08-22Better diagnostics for people using nix subshell on non-NixOS.Felix S. Klock II-2/+2
1. Turned patch-binaries-for-nix from a boolean into a ternary flag: true, false, and unset. 2. When patch-binaries-for-nix is unset, we continue with the existing NixOS detection heuristic (look for nixos in /etc/os-release, if present), but if we are not atop NixOS, then issue a note if we see the IN_NIX_SHELL environment variable telling the user to consider setting patch-binaries-for-nix explicitly.
2023-08-22Disable bootstrap rustc version checkDavid Koloski-1/+2
Mitigates #115065
2023-08-13Rollup merge of #114069 - cuviper:profiler-path, r=Mark-SimulacrumGuillaume Gomez-6/+24
Allow using external builds of the compiler-rt profile lib This changes the bootstrap config `target.*.profiler` from a plain bool to also allow a string, which will be used as a path to the pre-built profiling runtime for that target. Then `profiler_builtins/build.rs` reads that in a `LLVM_PROFILER_RT_LIB` environment variable.
2023-08-10Rollup merge of #114278 - ozkanonur:validate-codegen-backend-config, r=clubby789Matthias Krüger-2/+16
better error handling for `rust.codegen-backends` on deserialization Fixes #109315
2023-08-06fix(bootstrap): rename exclude flag to skip 🐛Meysam Azad-2/+2
2023-08-04Rollup merge of #114440 - kaniini:fix/bootstrap-version-compare, r=ozkanonurMatthias Krüger-1/+2
bootstrap: config: fix version comparison bug Rust requires a previous version of Rust to build, such as the current version, or the previous version. However, the version comparison logic did not take patch releases into consideration when doing the version comparison for the current branch, e.g. Rust 1.71.1 could not be built by Rust 1.71.0 because it is neither an exact version match, or the previous version. Adjust the version comparison logic to tolerate mismatches in the patch version.
2023-08-04Auto merge of #114305 - lqd:bootstrap-strip, r=ozkanonurbors-1/+1
Strip unexpected debuginfo from `libLLVM.so` and `librustc_driver.so` when not requesting any debuginfo As seen in #114175 and in [this zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/Artifact.20sizes/near/379302655), there's still some small amount of debuginfo in LLVM's shared library on linux, even when not requesting it (nightly CI), coming from `libstdc++`. ``` $ readelf --debug-dump=info ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM-16-rust-1.73.0-nightly.so | grep DW_TAG_compile_unit -A5 | grep DW_AT_comp_dir | cut -d ":" -f 2- | counts 101 counts ( 1) 39 (38.6%, 38.6%): (indirect string, offset: 0x7): /tmp/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++ ( 2) 38 (37.6%, 76.2%): (indirect string, offset: 0x43fb2): /tmp/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src/c++11 ( 3) 23 (22.8%, 99.0%): (indirect string, offset: 0x18ed8): /tmp/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src/c++98 ( 4) 1 ( 1.0%,100.0%): (indirect string, offset: 0x53f04): /tmp/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src ``` Similarly, here's `librustc_driver.so` when not requesting debuginfo from either rustc or the tools (nightly CI), coming e.g. from our LLVM wrapper: ``` $ readelf --debug-dump=info ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-e534b3a316089f5f.so | grep DW_TAG_compile_unit -A5 | grep DW_AT_comp_dir | cut -d ":" -f 2- | counts 116 counts ( 1) 34 (29.3%, 29.3%): (indirect string, offset: 0x3c11): /tmp/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++ ( 2) 32 (27.6%, 56.9%): (indirect string, offset: 0x9753c): /tmp/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src/c++11 ( 3) 25 (21.6%, 78.4%): (indirect string, offset: 0x393bd): /tmp/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src/c++98 ( 4) 23 (19.8%, 98.3%): (indirect string, offset: 0x33ed3): /cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.98 ( 5) 1 ( 0.9%, 99.1%): (indirect string, offset: 0xaffff): /rustc/0d95f9132909ae7c5f2456748d0ffd1c3ba4a8e8 ( 6) 1 ( 0.9%,100.0%): (indirect string, offset: 0xb604a): /tmp/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src ``` To reduce the size of distributed artifacts, this PR strips debuginfo from the LLVM and `rustc_driver` shared libraries, when: - no debuginfo is requested when building LLVM: `link-shared` is true, `optimize` is true and `release-debuginfo` is false - no debuginfo is requested when building the rustc driver: - `debuginfo-level-rustc` and `debuginfo-level-tools` are off. - when building with a stage != 0 compiler: since this is about the distributed artifacts, there's no need to do this at other stages. - for both: on a x64 linux host and target where `strip -g` is available and fixes the issue (I don't know how to strip debuginfo from a `.dylib` on mac). The LLVM BOLTed .so, and `librustc_driver.so` are big there, and this will help a little. Other targets/hosts can be added in the future if we want to. #114175 did the same thing unconditionally in `opt-dist`, prior to BOLTing LLVM. But this should only be used in conjunction with the other config options mentioned above, and which `opt-dist` doesn't know about. Therefore, it makes more sense as in bootstrap when building LLVM and rustc when applicable and no debuginfo is requested. This shouldn't interact badly with CI caching builds and artifacts, right? --- From the other PR, `libLLVM-16-rust-1.73.0-nightly.so` prior to #114141: - master: 173.13 MiB - stripped debuginfo: 165.12 MiB (-8 MiB, -4.6%) `libLLVM-16-rust-1.73.0-nightly.so` after #114141: - master: 121.13 MiB - stripped debuginfo: 113.12 MiB (still -8 MiB, -6.6%) `librustc_driver.so`: - master: 118.58 MiB - stripped debuginfo: 106.46 MiB (-12 MiB, -10.2%) (Results are also available in this most recent [perf run's artifact sizes](https://perf.rust-lang.org/compare.html?start=b321edd1b2d4bd00c7b4611e8f20a03ee7b77023&end=810ab570d5d27facb91806e5d9847815d9dac22a&stat=instructions%3Au&tab=artifact-size))
2023-08-03bootstrap: config: fix version comparison bugAriadne Conill-1/+2
Rust requires a previous version of Rust to build, such as the current version, or the previous version. However, the version comparison logic did not take patch releases into consideration when doing the version comparison for the current branch, e.g. Rust 1.71.1 could not be built by Rust 1.71.0 because it is neither an exact version match, or the previous version. Adjust the version comparison logic to tolerate mismatches in the patch version. Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
2023-07-31better error handling for `rust.codegen-backends` on deserializationozkanonur-2/+16
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-07-31allow `DebuginfoLevel` to be comparedRémy Rakic-1/+1
2023-07-31Pass BOLT profile to bootstrap to be included in the reproducible artifacts ↵Jakub Beránek-2/+4
archive
2023-07-31Remove BOLT from bootstrapJakub Beránek-9/+0
2023-07-30bootstrap: inline format!() argsMatthias Krüger-17/+15
2023-07-25Allow using external builds of the compiler-rt profile libJosh Stone-6/+24
This changes the bootstrap config `target.*.profiler` from a plain bool to also allow a string, which will be used as a path to the pre-built profiling runtime for that target. Then `profiler_builtins/build.rs` reads that in a `LLVM_PROFILER_RT_LIB` environment variable.
2023-07-15Rollup merge of #113643 - jyn514:try-run, r=ozkanonurjyn-0/+12
bootstrap: Clean up try_run r? `@ozkanonur` since you reviewed `@GuillaumeGomez's` PR i recommend reviewing commit-by-commit
2023-07-15Deduplicate `Builder::try_run` and mark `Config::try_run` as deprecatedjyn-0/+12
This does three things: 1. Remove `forward!(Build, fn try_run())`. Having `try_run` behave differently as a free function than an associated function is confusing, and `Builder::try_run` is a very desirable name. 2. Move `test::try_run` and `run::try_run` to `Builder::try_run`. These functions are different than `Config::try_run` - they delay the failure and print it out at the end of the build. 3. Mark `Config::try_run` as deprecated to encourage people to use `Builder::try_run` instead.
2023-07-13Rename `detail_exit_macro` to `exit`jyn-8/+8
`detail` and `macro` weren't adding any info.
2023-07-11Rollup merge of #113373 - jyn514:download-rustc-fixes, r=albertlarsan68Jubilee-5/+33
various download-rustc fixes separated out from https://github.com/rust-lang/rust/pull/112143 because it keeps getting stuck in limbo. best reviewed commit-by-commit
2023-07-11Move `ci_rustc_dir` to Config and use it consistentlyjyn-0/+6
2023-07-09Use String or Int to set the opt levelhi-rustin-13/+60
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-07-05allow mixing `llvm.assertions` and `download-rustc`jyn-14/+0
by using `rustc-builds-alt` if download-rustc is set this also changes the download code to use a separate build/cache/ directory and .rustc-stamp stamp file depending on whether assertions are enabled.
2023-07-05check ci-rustc optionsjyn-3/+39
2023-07-05Make `--dry-run` more useful when download-rustc is enabledjyn-2/+2
Previously, it would always treat download-rustc as set to false, which made bootstrap issues with download-rustc hard to debug.
2023-07-01Add tests for RustOptimizehi-rustin-1/+1
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-07-01Use RustOptimize to set optimizehi-rustin-5/+43
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-06-26bootstrap: rename 'user' profile to 'dist'clubby789-0/+8
2023-06-12add support for blessing panic=abort mir-opt testsPietro Albini-1/+15
2023-06-11Don't override `debuginfo-level = 1` to mean `line-tables-only`jyn-14/+72
This has real differences in the effective debuginfo: in particular, it omits the module-level information and breaks perf. Allow passing `line-tables-only` directly in config.toml instead.
2023-06-10Rollup merge of #112297 - jyn514:remove-exclude-kind, r=Mark-SimulacrumMatthias Krüger-3/+2
bootstrap: Disallow `--exclude test::std` Use the top-level Kind to determine whether Steps are excluded. Previously, this would use the `Kind` passed to `--exclude` (and not do any filtering at all if no kind was passed). That meant that `x test linkchecker --exclude std` would fail - you had to explicitly say `--exclude test::std`. Change bootstrap to use the top-level Kind instead, which does the right thing automatically. Note that this breaks things like `x test --exclude doc::std`, but I'm not sure why you'd ever want to do that. There's a lot of churn here, but the 1-line change in the first commit is the actual behavior change, the rest is just cleanup. Fixes https://github.com/rust-lang/rust/issues/103201. Note that this effectively reverts most of https://github.com/rust-lang/rust/pull/91965. cc `@pietroalbini`
2023-06-05bootstrap: remove dep `is-terminal`kadiwa-2/+1
2023-06-04cleanup now that Kind is no longer used for excludesjyn-3/+2
2023-06-03only check when we specify rustc in config.tomlyukang-2/+43
2023-05-30create `build_helper/src/util` modozkanonur-6/+7
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-05-27Revert "Rollup merge of #111538 - ↵Mark Rousskov-38/+0
chenyukang:yukang-fix-110067-version-issue, r=jyn514" This reverts commit 9267843e72c8692f934c2ef5505c8a7496c0f06e, reversing changes made to e52fbff5e8c2de7ba085ef84d7d50500b695d521. This breaks our ability to bump the src/version where we're bootstrapping with an older compiler than usual (according to version number). It's not clear whether the intended use case has a clean solution given this constraint, so reverting for now - we can reland with a fix of some kind implemented.
2023-05-24Auto merge of #111566 - clubby789:bootstrap-override-config, r=ozkanonurbors-26/+124
Override config.toml options from command line https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Running.20tests.20on.20precompiled.20rustc/near/357763280 cc `@jyn514`
2023-05-19Override config.toml options from command lineclubby789-26/+124
2023-05-14comment feedbackyukang-1/+2
2023-05-14fixyukang-2/+1
2023-05-14skip rustc version check in dry_runyukang-0/+4
2023-05-14Make sure the build.rustc version is either the same or 1 apartyukang-0/+34
2023-05-09Rollup merge of #111242 - wangkirin:support_rpath_independent_config, ↵Matthias Krüger-0/+7
r=albertlarsan68 support set `rpath` option for each target independently Currently the `rpath` option is a global config and it's effect on all targets. But sometimes when developers edit the rustc code and try to release rust toolchains themselves, they may not want to add `rpath` in all targets to avoid dynamically linked shared object library privilege escalation attack. This PR supports set `rpath` option for each target independently . Common developers are not aware of the existence of this configuration option and do not affect the existing development process. This configuration option takes effect only after developers explicitly sets . r? ``@albertlarsan68``
2023-05-07Auto merge of #110693 - clubby789:x-clap-take-2, r=Mark-Simulacrumbors-11/+28
Migrate bootstrap to Clap-based argument parsing Supercedes #108083 I chose to re-do the work rather than rebase the onto the large changes since the original PR. If it's preferred I can instead force-push the original PR to this version. cc `@jyn514` `@albertlarsan68`
2023-05-06Migrate bootstrap to Clap-based argumentsclubby789-11/+28