about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
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-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
2022-03-04Rollup merge of #94568 - bjorn3:rustbuild_remove_dead_code, r=Mark-SimulacrumMatthias Krüger-17/+8
Remove some dead code from rustbuild This should reduce build time a tiny bit.
2022-03-04Rollup merge of #94524 - bjorn3:remove_num_cpus, r=Mark-SimulacrumMatthias Krüger-4/+5
Remove num_cpus dependency from bootstrap, build-manifest and rustc_s… …ession `std::threads::available_parallelism` was stabilized in rust 1.59. r? ```````````````````````````@Mark-Simulacrum```````````````````````````
2022-03-04Enable conditional compilation checking on the Rust codebaseLoïc BRANSTETT-0/+56
2022-03-04Rollup merge of #94582 - nnethercote:fix-x-fmt-bug, r=Mark-SimulacrumDylan DPC-1/+6
Fix a bug in `x.py fmt` that prevents some files being formatted. If you have a file in the repository root with the same name as a file somewhere within a directory, the latter currently won't get formatted. I have experienced this multiple times and not understood what was happening; I finally figured out the problem today. This commit fixes the problem. r? ```@Mark-Simulacrum```
2022-03-04Fix a bug in `x.py fmt` that prevents some files being formatted.Nicholas Nethercote-1/+6
If you have a file in the repository root with the same name as a file somewhere within a directory, the latter currently won't get formatted. I have experienced this multiple times and not understood what was happening; I finally figured out the problem today. This commit fixes the problem.
2022-03-03Remove unused Default and Clone derives in config.rsbjorn3-6/+6
2022-03-03Remove some dead code from toolstate.rsbjorn3-11/+2
2022-03-03bootstrap: correct reading of flags for llvmJon Gjengset-27/+57
First, this reverts the `CFLAGS`/`CXXFLAGS` of #93918. Those flags are already read by `cc` and populated into `Build` earlier on in the process. We shouldn't be overriding that based on `CFLAGS`, since `cc` also respects overrides like `CFLAGS_{TARGET}` and `HOST_CFLAGS`, which we want to take into account. Second, this adds the same capability to specify target-specific versions of `LDFLAGS` as we have through `cc` for the `C*` flags: https://github.com/alexcrichton/cc-rs#external-configuration-via-environment-variables Note that this also necessitated an update to compiletest to treat CXXFLAGS separately from CFLAGS.
2022-03-02Remove num_cpus dependency from bootstrap, build-manifest and rustc_sessionbjorn3-4/+5
2022-02-27Rollup merge of #94415 - bjorn3:cfg_default_backend, r=Mark-SimulacrumMatthias Krüger-0/+4
Use the first codegen backend in the config.toml as default It is currently hard coded to llvm if enabled and cranelift otherwise. This made some sense when cranelift was the only alternative codegen backend. Since the introduction of the gcc backend this doesn't make much sense anymore. Before this PR bootstrapping rustc using a backend other than llvm or cranelift required changing the source of rustc_interface. With this PR it becomes a matter of putting the right backend as first enabled backend in config.toml. cc ```@antoyo```
2022-02-27Use the first codegen backend in the config.toml as defaultbjorn3-0/+4
It is currently hard coded to llvm if enabled and cranelift otherwise. This made some sense when cranelift was the only alternative codegen backend. Since the introduction of the gcc backend this doesn't make much sense anymore. Before this PR bootstrapping rustc using a backend other than llvm or cranelift required changing the source of rustc_interface. With this PR it becomes a matter of putting the right backend as first enabled backend in config.toml.
2022-02-26avoid rebuilding bootstrap when PATH changesRalf Jung-1/+1
2022-02-25Rollup merge of #93273 - bjorn3:rustbuild_improvements, r=Mark-SimulacrumMatthias Krüger-3/+4
Always check cg_llvm with ./x.py check Previously it would be skipped if codegen-backends doesn't contain llvm.
2022-02-23Always check cg_llvm with ./x.py checkbjorn3-3/+4
Previously it would be skipped if codegen-backends doesn't contain llvm.
2022-02-23Rollup merge of #94259 - krasimirgg:bump-llvm-ci, r=Mark-SimulacrumMatthias Krüger-1/+1
Bump download-ci-llvm-stamp for llvm-nm inclusion We started using it in https://github.com/rust-lang/rust/pull/94023.