about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2022-03-31Rollup merge of #95445 - jyn514:rustc-unit-tests, r=Dylan-DPCDylan DPC-1/+0
Don't build the full compiler before running unit tests This has been present since `builder.ensure` was first added in https://github.com/rust-lang/rust/pull/43059. It's unclear to me why it was added then - I tested these changes locally with `x test compiler/rustc_data_structures --stage 0` and they worked fine. Fixes https://github.com/rust-lang/rust/issues/51748.
2022-03-31Rollup merge of #94806 - jyn514:cargo-run-tidy, r=Mark-SimulacrumDylan DPC-1/+7
Fix `cargo run tidy` When I implemented rust-only bootstrapping in https://github.com/rust-lang/rust/pull/92260, I neglected to test stage0 tools - it turns out they were broken because they couldn't find the sysroot of the initial bootstrap compiler. This fixes stage0 tools by using `rustc --print sysroot` instead of assuming rustc is already in a sysroot and hard-coding the relative directory. Fixes https://github.com/rust-lang/rust/issues/94797 (properly, without having to change rustup).
2022-03-30Auto merge of #95466 - Dylan-DPC:rollup-g7ddr8y, r=Dylan-DPCbors-3/+3
Rollup of 5 pull requests Successful merges: - #95294 (Document Linux kernel handoff in std::io::copy and std::fs::copy) - #95443 (Clarify how `src/tools/x` searches for python) - #95452 (fix since field version for termination stabilization) - #95460 (Spellchecking compiler code) - #95461 (Spellchecking some comments) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-30Rollup merge of #95461 - nyurik:spelling, r=lcnrDylan DPC-3/+3
Spellchecking some comments This PR attempts to clean up some minor spelling mistakes in comments
2022-03-30Spellchecking some commentsYuri Astrakhan-3/+3
This PR attempts to clean up some minor spelling mistakes in comments
2022-03-30Auto merge of #94081 - oli-obk:lazy_tait_take_two, r=nikomatsakisbors-0/+6
Lazy type-alias-impl-trait take two ### user visible change 1: RPIT inference from recursive call sites Lazy TAIT has an insta-stable change. The following snippet now compiles, because opaque types can now have their hidden type set from wherever the opaque type is mentioned. ```rust fn bar(b: bool) -> impl std::fmt::Debug { if b { return 42 } let x: u32 = bar(false); // this errors on stable 99 } ``` The return type of `bar` stays opaque, you can't do `bar(false) + 42`, you need to actually mention the hidden type. ### user visible change 2: divergence between RPIT and TAIT in return statements Note that `return` statements and the trailing return expression are special with RPIT (but not TAIT). So ```rust #![feature(type_alias_impl_trait)] type Foo = impl std::fmt::Debug; fn foo(b: bool) -> Foo { if b { return vec![42]; } std::iter::empty().collect() //~ ERROR `Foo` cannot be built from an iterator } fn bar(b: bool) -> impl std::fmt::Debug { if b { return vec![42] } std::iter::empty().collect() // Works, magic (accidentally stabilized, not intended) } ``` But when we are working with the return value of a recursive call, the behavior of RPIT and TAIT is the same: ```rust type Foo = impl std::fmt::Debug; fn foo(b: bool) -> Foo { if b { return vec![]; } let mut x = foo(false); x = std::iter::empty().collect(); //~ ERROR `Foo` cannot be built from an iterator vec![] } fn bar(b: bool) -> impl std::fmt::Debug { if b { return vec![]; } let mut x = bar(false); x = std::iter::empty().collect(); //~ ERROR `impl Debug` cannot be built from an iterator vec![] } ``` ### user visible change 3: TAIT does not merge types across branches In contrast to RPIT, TAIT does not merge types across branches, so the following does not compile. ```rust type Foo = impl std::fmt::Debug; fn foo(b: bool) -> Foo { if b { vec![42_i32] } else { std::iter::empty().collect() //~^ ERROR `Foo` cannot be built from an iterator over elements of type `_` } } ``` It is easy to support, but we should make an explicit decision to include the additional complexity in the implementation (it's not much, see a721052457cf513487fb4266e3ade65c29b272d2 which needs to be reverted to enable this). ### PR formalities previous attempt: #92007 This PR also includes #92306 and #93783, as they were reverted along with #92007 in #93893 fixes #93411 fixes #88236 fixes #89312 fixes #87340 fixes #86800 fixes #86719 fixes #84073 fixes #83919 fixes #82139 fixes #77987 fixes #74282 fixes #67830 fixes #62742 fixes #54895
2022-03-29Don't build the full compiler before running unit testsJoshua Nelson-1/+0
This has been present since `builder.ensure` was first added in https://github.com/rust-lang/rust/pull/43059. It's unclear to me why it was added then - I tested these changes locally with `x test compiler/rustc_data_structures --stage 0` and they worked fine. Fixes https://github.com/rust-lang/rust/issues/51748.
2022-03-29Auto merge of #95417 - ehuss:doc-no_std-error, r=Dylan-DPCbors-0/+6
bootstrap: better error message for no_std docs Currently if one tries to build std documentation for a no_std target, you get a confusing error message: `error: The argument '--package [<SPEC>...]' was provided more than once, but cannot be used multiple times` This is because [`std_cargo`](https://github.com/rust-lang/rust/blob/600ec284838c52d1f6657c2cf0097b58970b133b/src/bootstrap/compile.rs#L299-L305) has a built-in `-p alloc` argument that conflicts with the `cargo rustdoc` command used in the Std doc step. This just adds a better error message in this scenario. It may be possible to fix this correctly, but that would likely be a bit more of an invasive change that I don't have time for right now.
2022-03-28bootstrap: better error message for no_std docsEric Huss-0/+6
2022-03-28Rollup merge of #93787 - klensy:really-not-a-features, r=wesleywiserDylan DPC-5/+11
parallel_compiler: hide dependencies behind feature Separate dependencies for `parallel_compiler` feature, so they will not be compiled if feature not selected, reducing number of compiled crates from 238 to 224.
2022-03-28Revert "Auto merge of #93893 - oli-obk:sad_revert, r=oli-obk"Oli Scherer-0/+6
This reverts commit 6499c5e7fc173a3f55b7a3bd1e6a50e9edef782d, reversing changes made to 78450d2d602b06d9b94349aaf8cece1a4acaf3a8.
2022-03-28Rollup merge of #95370 - jyn514:less-verbose-skips, r=Dylan-DPCDylan DPC-2/+2
[bootstrap] Don't print `Suite not skipped` unless `--verbose` is set This was so verbose before that it made it hard to see what effect the flag actually had. Before: ``` Set({test::src/tools/tidy}) not skipped for "bootstrap::test::Tidy" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Skipping Suite(test::src/test/ui) because it is excluded Suite(test::src/test/run-pass-valgrind) not skipped for "bootstrap::test::RunPassValgrind" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Skipping Suite(test::src/test/mir-opt) because it is excluded Suite(test::src/test/codegen) not skipped for "bootstrap::test::Codegen" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Suite(test::src/test/codegen-units) not skipped for "bootstrap::test::CodegenUnits" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Suite(test::src/test/assembly) not skipped for "bootstrap::test::Assembly" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Suite(test::src/test/incremental) not skipped for "bootstrap::test::Incremental" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Skipping Suite(test::src/test/debuginfo) because it is excluded Skipping Suite(test::src/test/ui-fulldeps) because it is excluded ... about 100 more lines ... ``` After: ``` Skipping Suite(test::src/test/ui) because it is excluded Skipping Suite(test::src/test/mir-opt) because it is excluded Skipping Suite(test::src/test/debuginfo) because it is excluded Skipping Suite(test::src/test/ui-fulldeps) because it is excluded ```
2022-03-28Propagate `parallel_compiler` feature through rustc crates. Turned off ↵klensy-5/+11
feature gives change of builded crates: 238 -> 224.
2022-03-27[bootstrap] Don't print `Suite not skipped` unless `--verbose` is setJoshua Nelson-2/+2
This was so verbose before that it made it hard to see what effect the flag actually had. Before: ``` Set({test::src/tools/tidy}) not skipped for "bootstrap::test::Tidy" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Skipping Suite(test::src/test/ui) because it is excluded Suite(test::src/test/run-pass-valgrind) not skipped for "bootstrap::test::RunPassValgrind" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Skipping Suite(test::src/test/mir-opt) because it is excluded Suite(test::src/test/codegen) not skipped for "bootstrap::test::Codegen" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Suite(test::src/test/codegen-units) not skipped for "bootstrap::test::CodegenUnits" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Suite(test::src/test/assembly) not skipped for "bootstrap::test::Assembly" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Suite(test::src/test/incremental) not skipped for "bootstrap::test::Incremental" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Skipping Suite(test::src/test/debuginfo) because it is excluded Skipping Suite(test::src/test/ui-fulldeps) because it is excluded ... about 100 more lines ... ``` After: ``` Skipping Suite(test::src/test/ui) because it is excluded Skipping Suite(test::src/test/mir-opt) because it is excluded Skipping Suite(test::src/test/debuginfo) because it is excluded Skipping Suite(test::src/test/ui-fulldeps) because it is excluded ```
2022-03-25resolve: Stop passing unused spans and node ids to path resolution functionsVadim Petrochenkov-1/+1
2022-03-18Compare installed browser-ui-test version to the one used in CIGuillaume Gomez-17/+41
2022-03-16resolve the conflict in compiler/rustc_session/src/parse.rscodehorseman-3/+3
Signed-off-by: codehorseman <cricis@yeah.net>
2022-03-15fix typosDylan DPC-1/+1
2022-03-13Auto merge of #94832 - jonhoo:default-static, r=Mark-Simulacrumbors-1/+2
bootstrap: untangle static-libstdcpp & llvm-tools Previously, the static-libstdcpp setting was tied to llvm-tools such that enabling the latter always enabled the latter. This seems unfortunate, since it is entirely reasonable for someone to want to _not_ statically link stdc++, but _also_ want to build the llvm-tools. This patch therefore separates the two settings such that neither implies the other. On its own, that would change the default behavior in a way that's likely to surprise users. Specifically, users who build llvm-tools _likely_ want those tools to be statically compiled against libstdc++, since otherwise users with older GLIBCXX will be unable to run the vended tools. So, we also flip the default for the `static-libstdcpp` setting such that builds always link statically against libstdc++ by default, but it's _possible_ to opt out. See also #94719.
2022-03-13Auto merge of #94916 - matthiaskrgr:rollup-s6zedfl, r=matthiaskrgrbors-164/+227
Rollup of 5 pull requests Successful merges: - #93292 (Implement `BITS` constant for non-zero integers) - #94777 (Update armv7-unknown-linux-uclibceabi platform support page.) - #94816 (Add `Atomic*::get_mut_slice`) - #94844 (Reduce rustbuild bloat caused by serde_derive) - #94907 (Omit stdarch test crates from the rust-src component) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-13Rollup merge of #94907 - bjorn3:smaller_rust_src_component, r=Mark-SimulacrumMatthias Krüger-0/+5
Omit stdarch test crates from the rust-src component These crates aren't necessary for building the standard library. This saves 30MB of disk space. Fixes #94906
2022-03-13Auto merge of #94738 - Urgau:rustbuild-check-cfg-values, r=Mark-Simulacrumbors-1/+15
Enable conditional checking of values in the Rust codebase This pull-request enable conditional checking of (well known) values in the Rust codebase. Well known values were added in https://github.com/rust-lang/rust/pull/94362. All the `target_*` values are taken from all the built-in targets which is why some extra values were needed do be added as they are not (yet ?) defined in any built-in targets. r? `@Mark-Simulacrum`
2022-03-13Omit stdarch test crates from the rust-src componentbjorn3-0/+5
These crates aren't necessary for building the standard library. This saves 30MB of disk space. Fixes #94906
2022-03-13Remove FieldName enumbjorn3-34/+6
2022-03-13Prevent duplicate monomorphization of deserialization implsbjorn3-1/+5
This reduces binary size from 9.7MiB (5.8MiB for just rustbuild code) to 9.3MiB (5.3MiB for just rustbuild code). This doesn't reduce compile time in a statistically significant way.
2022-03-13Use trimmed down deserialization impl for configbjorn3-146/+237
This reduces binary size from 10.1MiB (6.2MiB for just rustbuild code) to 9.7MiB (5.8MiB for just rustbuild code). This also reduces compile time from ~6.1s for incr recompilation to ~5.6s. There is still a lot of unnecessary code due to the toml crate monomorphizing every deserialization impl 5 times.
2022-03-13Rename derive_merge macro to define_config and move Deserialize impl into itbjorn3-19/+10
2022-03-13Auto merge of #94862 - pierwill:bootstrap-useless, r=Dylan-DPCbors-9/+5
Remove unneeded conversions in bootstrapping code Fixes warnings from `clippy::useless_conversion` in `src/bootstrap`.
2022-03-11Remove redundant slicing of whole ranges in `bootstrap`pierwill-5/+5
2022-03-11Remove unneeded conversions in bootstrapping codepierwill-9/+5
Fixes warnings from `clippy::useless_conversion` in `src/bootstrap`.
2022-03-11Rollup merge of #94592 - jyn514:consistent-config-loading, r=Mark-SimulacrumDylan DPC-11/+24
Fallback to top-level config.toml if not present in current directory, and remove fallback for env vars and CLI flags This preserves the behavior where x.py will only give a hard error on a missing config file if it was configured through `--config` or RUST_BOOTSTRAP_CONFIG. It also removes the top-level fallback for everything except the default path; presumably if you're passing the path explicitly, you expect it to be exactly there and don't want to look in the root directory. Fixes https://github.com/rust-lang/rust/issues/94589.
2022-03-11Rollup merge of #94819 - jonhoo:configure-empty-list, r=Mark-SimulacrumDylan DPC-0/+4
configure: don't serialize empty array elements Before this change: $ ./configure --codegen-backends= [..] $ grep -P '^codegen-backends' config.toml codegen-backends = [''] After this change: $ ./configure --codegen-backends= [..] $ grep -P '^codegen-backends' config.toml codegen-backends = []
2022-03-10bootstrap: untangle static-libstdcpp & llvm-toolsJon Gjengset-1/+2
Previously, the static-libstdcpp setting was tied to llvm-tools such that enabling the latter always enabled the latter. This seems unfortunate, since it is entirely reasonable for someone to want to _not_ statically link stdc++, but _also_ want to build the llvm-tools. This patch therefore separates the two settings such that neither implies the other. On its own, that would change the default behavior in a way that's likely to surprise users. Specifically, users who build llvm-tools _likely_ want those tools to be statically compiled against libstdc++, since otherwise users with older GLIBCXX will be unable to run the vended tools. So, we also flip the default for the `static-libstdcpp` setting such that builds always link statically against libstdc++ by default, but it's _possible_ to opt out. See also #94719.
2022-03-10Fix `cargo run tidy`Joshua Nelson-1/+7
When I implemented rust-only bootstrapping in https://github.com/rust-lang/rust/pull/92260, I neglected to test stage0 tools - it turns out they were broken because they couldn't find the sysroot of the initial bootstrap compiler. This fixes stage0 tools by using `rustc --print sysroot` instead of assuming rustc is already in a sysroot and hard-coding the relative directory.
2022-03-10Rollup merge of #94719 - jonhoo:enable-static-lld, r=Mark-SimulacrumDylan DPC-12/+12
Statically compile libstdc++ everywhere if asked PR #93918 made it so that `-static-libstdc++` was only set in one place, and was only set during linking, but accidentally also made it so that it is no longer passed when building LLD, only when building LLVM itself. This moves the logic for setting `-static-libstdc++` in the linker flags to `configure_cmake` so that it takes effect for all CMake invocations in `native.rs`. As a side-effect, this also causes libstdc++ to be statically compiled into sanitizers, whereas previously the `llvm-static-stdcpp` flag had no effect on sanitizers. It also makes it so that LLD will be compiled statically if `llvm-tools-enabled` is set, even though previously it was only linked statically if `llvm-static-stdcpp` was set explicitly. Both of these seem like they match expected behavior than what was there prior to #93918.
2022-03-10configure: don't serialize empty array elementsJon Gjengset-0/+4
Before this change: $ ./configure --codegen-backends= [..] $ grep -P '^codegen-backends' config.toml codegen-backends = [''] After this change: $ ./configure --codegen-backends= [..] $ grep -P '^codegen-backends' config.toml codegen-backends = []
2022-03-09Fallback to top-level config.toml if not present in current directoryJoshua Nelson-11/+24
This also preserves the behavior where x.py will only give a hard error on a missing config file if it was configured through `--config` or RUST_BOOTSTRAP_CONFIG. It also removes the top-level fallback for everything except the default path.
2022-03-09Rollup merge of #94772 - Urgau:check-cfg-miri, r=petrochenkovMatthias Krüger-1/+0
Add miri to the well known conditional compilation names and values This pull request adds `miri` to the list of well known names and values of the conditional compilation checking (`--check-cfg`). This was brought up in [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/RFC.203013.3A.20Checking.20conditional.20compilation.20at.20compile.20time/near/274513827) when discussing about the future of `--check-cfg`. r? ``@petrochenkov``
2022-03-09Add miri to the well known conditional compilation names and valuesLoïc BRANSTETT-1/+0
2022-03-09Enable conditional checking of values in the Rust codebaseLoïc BRANSTETT-1/+15
2022-03-07Statically compile libstdc++ everywhere if askedJon Gjengset-12/+12
PR #93918 made it so that `-static-libstdc++` was only set in one place, and was only set during linking, but accidentally also made it so that it is no longer passed when building LLD or sanitizers, only when building LLVM itself. This moves the logic for setting `-static-libstdc++` in the linker flags back to `configure_cmake` so that it takes effect for all CMake invocations in `native.rs`. As a side-effect, this also causes libstdc++ to be statically compiled into sanitizers and LLD if `llvm-tools-enabled` is set but `llvm-static-stdcpp` is not, even though previously it was only linked statically if `llvm-static-stdcpp` was set explicitly. But that seems more like the expected behavior anyway.
2022-03-07copy over `std::path::absolute` instead of adding `canonicalize` hacksJoshua Nelson-26/+138
this also fixes a bug where bootstrap would try to use the fake `rustc` binary built by bootstrap - cargo puts it in a different directory when using `cargo run` instead of x.py
2022-03-07fix weird bug when `out` would get overridden by unit testsJoshua Nelson-10/+27
2022-03-07Don't depend on python for RUST_BOOTSTRAP_CONFIGJoshua Nelson-21/+21
2022-03-07Move some more bootstrap logic from python to rustJoshua Nelson-23/+16
Same rationale as https://github.com/rust-lang/rust/pull/76544; it would be nice to make python entirely optional at some point. This also removes $ROOT as an option for the build directory; I haven't been using it, and like Alex said in https://github.com/rust-lang/rust/pull/76544#discussion_r488248930 it seems like a misfeature. This allows running `cargo run` from src/bootstrap, although that still gives lots of compile errors if you don't use the beta toolchain.
2022-03-06Rollup merge of #94621 - ridwanabdillahi:lld-rel-dbg, r=Mark-Simulacrumfee1-dead-1/+9
rustbuild: support RelWithDebInfo for lld r? ``@alexcrichton`` LLVM has flags that control the level of debuginfo generated when building via rustbuild. Since LLD is built separately, it currently has no way of generating any debuginfo. This change re-uses the same flags as LLVM for LLD to ensure it has the same level of debuginfo generated as LLVM.
2022-03-05Merge build_helper into utilbjorn3-182/+166
2022-03-05Remove build_helperbjorn3-50/+172
The majority of the code is only used by either rustbuild or rustc_llvm's build script. Rust_build is compiled once for rustbuild and once for every stage. This means that the majority of the code in this crate is needlessly compiled multiple times. By moving only the code actually used by the respective crates to rustbuild and rustc_llvm's build script, this needless duplicate compilation is avoided.
2022-03-04Auto merge of #94298 - Urgau:rustbuild-check-cfg, r=Mark-Simulacrumbors-0/+56
Enable conditional compilation checking on the Rust codebase This pull-request enable conditional compilation checking on every rust project build by the `bootstrap` tool. To be more specific, this PR only enable well known names checking + extra names (bootstrap, parallel_compiler, ...). r? `@Mark-Simulacrum`
2022-03-04Support RelWithDebInfo for lld.ridwanabdillahi-1/+9