about summary refs log tree commit diff
path: root/src/bootstrap/builder.rs
AgeCommit message (Collapse)AuthorLines
2020-05-03Auto merge of #71815 - Mark-Simulacrum:no-llvm-rebuild, r=jonas-schievinkbors-2/+10
Don't bust caches on x.py check/build switches Fixes #71152
2020-05-02Don't skip building LLVM if already builtMark Rousskov-2/+10
2020-05-02Auto merge of #70655 - oli-obk:subrepo_funness, r=Mark-Simulacrumbors-1/+1
Make clippy a git subtree instead of a git submodule r? @eddyb cc #70651 documentation at https://github.com/rust-lang/rust/pull/70654
2020-05-02Also build clippy with `./x.py check`Oliver Scherer-1/+1
2020-05-01bootstrap: also apply unused-attributes hack without deny_warningsRalf Jung-6/+6
2020-04-24Only set *FLAGS env vars if they are not emptyDylan MacKenzie-2/+10
2020-04-23Set RUSTDOCFLAGS in `cargo` invocationDylan MacKenzie-2/+9
2020-04-12rustbuild: Remove LLD flavor workaround for MSVCVadim Petrochenkov-16/+0
2020-04-07bootstrap: work around "unused attribute" errors in incremental stdlib rebuilds.Eduard-Mihai Burtescu-0/+7
2020-04-02Translate the virtual `/rustc/$hash` prefix back to a real directory.Eduard-Mihai Burtescu-1/+6
2020-03-24ci: add github actions configurationPietro Albini-0/+5
2020-03-19Avoid llvm-config in more situations, like bootstrap test runsJosh Stone-8/+19
2020-03-18Ensure LLVM is in the link path for rustc toolsJosh Stone-2/+16
2020-03-18Rename add_lib_path to add_dylib_pathJosh Stone-2/+2
2020-03-15Bump the bootstrap compilerJonas Schievink-8/+2
2020-02-11Rollup merge of #68824 - ajpaverd:cfguard-rustbuild, r=Mark-SimulacrumDylan DPC-0/+14
Enable Control Flow Guard in rustbuild Now that Rust supports Control Flow Guard (#68180), add a config.toml option to build the standard library with CFG enabled. r? @nagisa
2020-02-10Enable Control Flow Guard in rustbuildAndrew Paverd-0/+14
2020-02-09Auto merge of #68623 - Zoxc:lld, r=Mark-Simulacrumbors-3/+24
Add an option to use LLD to link the compiler on Windows platforms Based on https://github.com/rust-lang/rust/pull/68609. Using LLD is good way to improve compile times on Windows since `link.exe` is quite slow. The time for `x.py build --stage 1 src/libtest` goes from 0:12:00 to 0:08:29. Compile time for `rustc_driver` goes from 226.34s to 18.5s. `rustc_macros` goes from 28.69s to 7.7s. The size of `rustc_driver` is also reduced from 83.3 MB to 78.7 MB. r? @Mark-Simulacrum
2020-02-06rustc: rename -Zexternal-macro-backtrace to -Zmacro-backtrace.Eduard-Mihai Burtescu-1/+7
2020-02-03bootstrap: fix clippy warningsMatthias Krüger-16/+8
2020-01-29Link a linking issueJohn Kåre Alsaker-1/+2
2020-01-29Add an option to use LLD to link the compiler on Windows platformsJohn Kåre Alsaker-3/+23
2020-01-23Clear out std, not std toolsMark Rousskov-1/+1
This was a typo that slipped in, and meant that we were still not properly clearing out std.
2020-01-09Add bootstrap step for building sanitizer runtimesTomasz Miąsko-0/+1
2020-01-08Auto merge of #67760 - Mark-Simulacrum:rustc-dirty, r=alexcrichtonbors-1/+13
Clear out target directory if compiler has changed Previously, we relied fully on Cargo to detect that the compiler had changed and it needed to rebuild the standard library (or later "components"). This used to not quite be the case prior to moving to LLVM be a separate cargo invocation; subsequent compiles would recompile std and friends if LLVM had changed (#67077 is the PR that changes things here). This PR moves us to clearing out libstd when it is being compiled if the rustc we're using has changed. We fairly harshly limit the cases in which we do this (e.g., ignoring dry run mode, and so forth, as well as rustdoc invocations). This is primarily because when we're not using the compiler directly, so clearing out in other cases is likely to lead to bugs, particularly as our deletion scheme is pretty blunt today (basically removing more than is needed, i.e., not just the rustc artifacts). In practice, this targeted fix does fix the known bug, though it may not fully resolve the problem here. It's also not clear that there is a full fix hiding here that doesn't involve a more major change (like -Zbinary-dep-depinfo was). As a drive-by fix, don't delete the compiler before calling Build::copy, as that also deletes the compiler.
2020-01-02bootstrap: Allow for setting the ThinLTO import limit used for compiler the ↵Michael Woerister-0/+15
compiler.
2020-01-01Clear out target directory if compiler has changedMark Rousskov-1/+13
Previously, we relied fully on Cargo to detect that the compiler had changed and it needed to rebuild the standard library (or later "components"). This used to not quite be the case prior to moving to LLVM be a separate cargo invocation; subsequent compiles would recompile std and friends if LLVM had changed (#67077 is the PR that changes things here). This PR moves us to clearing out libstd when it is being compiled if the rustc we're using has changed. We fairly harshly limit the cases in which we do this (e.g., ignoring dry run mode, and so forth, as well as rustdoc invocations). This is primarily because when we're not using the compiler directly, so clearing out in other cases is likely to lead to bugs, particularly as our deletion scheme is pretty blunt today (basically removing more than is needed, i.e., not just the rustc artifacts). In practice, this targeted fix does fix the known bug, though it may not fully resolve the problem here. It's also not clear that there is a full fix hiding here that doesn't involve a more major change (like -Zbinary-dep-depinfo was). As a drive-by fix, don't delete the compiler before calling Build::copy, as that also deletes the compiler.
2019-12-22Format the worldMark Rousskov-85/+43
2019-12-21Implement `./x.py fmt [--check]`.Adam Perry-2/+3
2019-12-21Drop petgraph dependency from bootstrapMark Rousskov-46/+1
It was essentially unused, likely leftover from a previous refactoring iteration.
2019-12-13Auto merge of #67077 - Aaron1011:build-llvm-in-binary, r=alexcrichtonbors-22/+0
rustc: Link LLVM directly into rustc again (take two) This is a continuation of PR https://github.com/rust-lang/rust/pull/65703
2019-12-12Auto merge of #67172 - jethrogb:jb/bootstrap-linker, r=alexcrichtonbors-5/+2
Bootstrap: change logic for choosing linker and rpath This is a follow-up from #66957 and #67023. Apparently there was one more location with a hard-coded list of targets to influence linking. I've filed #67171 to track this madness. r? @alexcrichton
2019-12-11rustc: Link LLVM directly into rustc againAlex Crichton-22/+0
This commit builds on #65501 continue to simplify the build system and compiler now that we no longer have multiple LLVM backends to ship by default. Here this switches the compiler back to what it once was long long ago, which is linking LLVM directly to the compiler rather than dynamically loading it at runtime. The `codegen-backends` directory of the sysroot no longer exists and all relevant support in the build system is removed. Note that `rustc` still supports a dynamically loaded codegen backend as it did previously, it just no longer supports dynamically loaded codegen backends in its own sysroot. Additionally as part of this the `librustc_codegen_llvm` crate now once again explicitly depends on all of its crates instead of implicitly loading them through the sysroot. This involved filling out its `Cargo.toml` and deleting all the now-unnecessary `extern crate` annotations in the header of the crate. (this in turn required adding a number of imports for names of macros too). The end results of this change are: * Rustbuild's build process for the compiler as all the "oh don't forget the codegen backend" checks can be easily removed. * Building `rustc_codegen_llvm` is much simpler since it's simply another compiler crate. * Managing the dependencies of `rustc_codegen_llvm` is much simpler since it's "just another `Cargo.toml` to edit" * The build process should be a smidge faster because there's more parallelism in the main rustc build step rather than splitting `librustc_codegen_llvm` out to its own step. * The compiler is expected to be slightly faster by default because the codegen backend does not need to be dynamically loaded. * Disabling LLVM as part of rustbuild is still supported, supporting multiple codegen backends is still supported, and dynamic loading of a codegen backend is still supported.
2019-12-10Add toolstate checking into bootstrapMark Rousskov-0/+1
This is not yet actually used by CI, but implements the logic for checking that tools are properly building on beta/stable and during beta cutoff week. This attempts to mirror the checking functionality in src/ci/docker/x86_64-gnu-tools/checktools.sh, and called scripts. It does not attempt to run the relevant steps (that functionality was originally desired to be moved into bootstrap as well, but doing so proved more difficult than expected). This is intended as a way to centralize and make clearer the logic involved in toolstate checking. In particular, the previous logic was spread across numerous python and shell scripts in such a way that made interpretation quite difficult.
2019-12-09Bootstrap: change logic for choosing linker and rpathJethro Beekman-5/+2
2019-11-13Rollup merge of #66317 - cuviper:bindir_relative, r=Mark-SimulacrumYuki Okushi-1/+2
Use a relative bindir for rustdoc to find rustc In bootstrap, we set `RUSTC_INSTALL_BINDIR` to `config.bindir`, so rustdoc can find rustc relative to the toolchain sysroot. However, if a distro script like Fedora's `%configure` sets an absolute path, then rustdoc's `sysroot.join(bin_path)` ignores that sysroot altogether. That would be OK once the toolchain is actually installed, but it breaks the in-tree doc tests during the build, since `/usr/bin/rustc` is still the old version. So now we try to make `RUSTC_INSTALL_BINDIR` relative to the sysroot prefix in the first place. r? @Mark-Simulacrum
2019-11-12Hopefully fix rustdoc buildMark Rousskov-1/+12
It's super unclear why this broke when we switched to beta but not previously -- but at least it's hopefully fixed now.
2019-11-12Fallback to the unmodified path in bindir_relativeJosh Stone-2/+1
2019-11-11Use a relative bindir for rustdoc to find rustcJosh Stone-1/+3
In bootstrap, we set `RUSTC_INSTALL_BINDIR` to `config.bindir`, so rustdoc can find rustc relative to the toolchain sysroot. However, if a distro script like Fedora's `%configure` sets an absolute path, then rustdoc's `sysroot.join(bin_path)` ignores that sysroot altogether. That would be OK once the toolchain is actually installed, but it breaks the in-tree doc tests during the build, since `/usr/bin/rustc` is still the old version. So now we try to make `RUSTC_INSTALL_BINDIR` relative to the sysroot prefix in the first place.
2019-10-24Auto merge of #65474 - Mark-Simulacrum:rustc-dev-split, r=pietroalbinibors-0/+1
Split the rustc target libraries into separate rustc-dev component This is re-applies a squashed version of #64823 as well as including #65337 to fix bugs noted after merging the first PR. The second PR is confirmed as fixing windows-gnu, and presumably also fixes other platforms, such as musl (i.e. #65335 should be fixed); `RUSTUP_DIST_SERVER=https://dev-static.rust-lang.org rustup toolchain install nightly-2019-10-16` can be installed to confirm that this is indeed the case.
2019-10-16Upgrade Emscripten targets to use upstream LLVM backendThomas Lively-0/+1
- Compatible with Emscripten 1.38.46-upstream or later upstream. - Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the old incorrect wasm32 C call ABI with the correct one, preserving the old one as wasm32_bindgen_compat for wasm-bindgen compatibility. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649.
2019-10-15minimize the rust-std componentJosh Stone-0/+1
This splits out a rustc-dev component with the compiler crates, and keeps the status quo of default installed files on nightly. The default changing to not install compiler libraries by default is left for a future pull request. However, on stable and beta, this does remove the compiler libraries from the set of libraries installed by default, as they are never needed there (per our stability story, they "cannot" be used).
2019-10-12Revert "Auto merge of #64823 - cuviper:min-std, r=Mark-Simulacrum"Mark Rousskov-1/+0
This reverts commit 000d90b11f7be70ffb7812680f7abc6deb52ec88, reversing changes made to 898f36c83cc28d7921a1d7b3605323dc5cfcf533.
2019-10-10Auto merge of #64823 - cuviper:min-std, r=Mark-Simulacrumbors-0/+1
minimize the rust-std component This changes the `rust-std` dist component to only include the artifacts of compiling the `libstd` step, as listed in `.libstd.stamp`. This does include `test` and `proc-macro` as well. The remaining _unstable_ libraries that are built as part of `rustc` are packaged into a new `rustc-dev` component, intended for use in the development of closely related tools (clippy, miri, rls). Here are the component sizes from the [try build](https://dev-static.rust-lang.org/dist/2019-10-07/index.html): | Name | Size | --- | --- | rust-std-nightly-x86_64-unknown-linux-gnu.tar.gz | 23.94 MiB | rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz | 17.4 MiB | rustc-dev-nightly-x86_64-unknown-linux-gnu.tar.gz | 182.03 MiB | rustc-dev-nightly-x86_64-unknown-linux-gnu.tar.xz | 157.91 MiB Fixes #61978 Fixes #62486
2019-10-10Auto merge of #65129 - andjo403:cargo_args, r=alexcrichtonbors-0/+10
make it possible to add args to cargo in x.py eg. make it easier to test -Ztimings for rustc cc https://github.com/rust-lang/rust/issues/65088
2019-10-09make it possible to add args to cargo in x.pyAndreas Jonson-0/+10
eg. make it easier to test -Ztimings for rustc
2019-10-07add dist::RustcDev for unstable compiler librariesJosh Stone-1/+1
2019-10-07[WIP] minimize the rust-std componentJosh Stone-0/+1
2019-10-05Revert "Auto merge of #63649 - tlively:emscripten-upstream-upgrade, ↵Tyler Mandry-1/+0
r=alexcrichton" This reverts commit 7870050796e5904a0fc85ecbe6fa6dde1cfe0c91, reversing changes made to 2e7244807a7878f6eca3eb7d97ae9b413aa49014.
2019-10-04Fix ABI, run and fix more tests, re-enable CI for PRsThomas Lively-0/+1