about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2020-01-08Build compiletest with in-tree libtestJosh Stone-2/+8
2020-01-08Remove obsolete llvm_tools flagJosh Stone-11/+1
2020-01-08Auto merge of #67760 - Mark-Simulacrum:rustc-dirty, r=alexcrichtonbors-2/+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-03Rollup merge of #67636 - semarie:bootstrap-rustfmt, r=Mark-SimulacrumYuki Okushi-0/+1
allow rustfmt key in [build] section Permit using `rustfmt` in `config.toml`. It will allow to not download `rustfmt` binary, which is not possible for at least some tiers-3 platforms. Fixes: #67624 r? @Mark-Simulacrum
2020-01-02bootstrap: Allow for setting the ThinLTO import limit used for compiler the ↵Michael Woerister-0/+18
compiler.
2020-01-01Clear out target directory if compiler has changedMark Rousskov-2/+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-29tidy: Enforce formatting rather than just check it if `--bless` is specifiedVadim Petrochenkov-1/+1
2019-12-27allow rustfmt key in [build] sectionSebastien Marie-0/+1
2019-12-26Skip LLVM rebuild when skip-rebuild is trueMatthew Healy-0/+9
2019-12-26Parse llvm_skip_rebuild into ConfigMatthew Healy-0/+6
2019-12-24bootstrap miri: remove no longer used env varRalf Jung-3/+0
2019-12-22Format the worldMark Rousskov-2154/+1836
2019-12-22Remove most files from format ignore listMark Rousskov-20/+23
Also moves formatting to use edition 2018, and to be done in parallel. This brings near-linear speed ups (at least with a small amount of cores).
2019-12-22Auto merge of #65939 - anp:incremental-rustfmt-rollout, r=Mark-Simulacrumbors-10/+159
Enable incremental rustfmt adoption Enables an incremental rollout of rustfmt usage within the compiler via a granular ignore configuration and automated enforcement. The decision to format the repository was approved in https://github.com/rust-lang/compiler-team/issues/80#issuecomment-491324079. This PR includes: * an `[ignore]` section to `rustfmt.toml` including most of the repository * `./x.py` downloads rustfmt from a specific nightly (we do not pin to beta or stable as we need unstable features) * an `./x.py fmt [--check]` command which runs cargo-fmt * `./x.py fmt --check` runs during the same test step as `src/tools/tidy`, on master, but not on beta or stable as we don't want to depend on nightly rustfmt there. * a commit to format `src/librustc_fs_util` as an initial target and to ensure enforcement is working from the start
2019-12-22Do not run if rustfmt.toml does not existMark Rousskov-2/+7
distcheck (and generally publishing tarballs) will not package rustfmt.toml and we for now still support running tidy etc in those tarballs.
2019-12-22Rollup merge of #67410 - mati865:mingw_link_fix, r=Mark-SimulacrumMazdak Farrokhzad-1/+1
Reenable static linking of libstdc++ on windows-gnu Fixes https://github.com/rust-lang/rust/issues/67408 Verified locally that `rustc_driver` is now statically linked to libstdc++.
2019-12-21Implement rustfmt running manually using ignore crateMark Rousskov-15/+47
This replaces cargo-fmt with rustfmt with --skip-children which should allow us to format code without running into rust-lang/rustfmt#3930. This also bumps up the version of rustfmt used to a more recent one.
2019-12-21Include formatting check in the test step for tidy.Adam Perry-0/+8
2019-12-21Implement `./x.py fmt [--check]`.Adam Perry-5/+70
2019-12-21bootstrap.py fetches rustfmt.Adam Perry-5/+44
Co-Authored-By: Mark Rousskov <mark.simulacrum@gmail.com>
2019-12-21Rollup merge of #67491 - lzutao:res-map-or, r=Mark-SimulacrumMazdak Farrokhzad-2/+2
use Result::map_or for bootstrap
2019-12-21use Result::map_or for bootstrapLzu Tao-2/+2
2019-12-21Drop petgraph dependency from bootstrapMark Rousskov-47/+1
It was essentially unused, likely leftover from a previous refactoring iteration.
2019-12-19Remove newline from commit in toolstateMark Rousskov-1/+1
2019-12-19Rollup merge of #67432 - Mark-Simulacrum:fix-toolstate, r=CentrilMark Rousskov-1/+1
Fix toolstate history format We were inserting *before* the existing newline, so we should prepend it not append it to our inserted string.
2019-12-19Rollup merge of #67351 - Mark-Simulacrum:always-channel, r=pietroalbiniMark Rousskov-3/+3
Set release channel on non-dist builders Toolstate publication only runs if the channel is "nightly" and previously the toolstate builders did not know that the channel was nightly (since they are not dist builders). A look through bootstrap seems to indicate that nothing should directly depend on the channel being set to `-dev` on the test builders, though this may cause some problems with UI tests (if for some reason they're dumping the channel into stderr), but we cannot find evidence of such so hopefully this is fine. r? @pietroalbini
2019-12-19Fix toolstate history formatMark Rousskov-1/+1
We were inserting *before* the existing newline, so we should prepend it not append it to our inserted string.
2019-12-19Rollup merge of #67286 - cuviper:configure-llvm, r=Dylan-DPCMazdak Farrokhzad-2/+2
Fix the configure.py TOML field for a couple LLVM options The actual fields in `config.toml.example` have dashes, not underscores.
2019-12-18Set release channel on non-dist buildersMark Rousskov-3/+3
Toolstate publication only runs if the channel is "nightly" and previously the toolstate builders did not know that the channel was nightly (since they are not dist builders). A look through bootstrap seems to indicate that nothing should directly depend on the channel being set to `-dev` on the test builders, though this may cause some problems with UI tests (if for some reason they're dumping the channel into stderr), but we cannot find evidence of such so hopefully this is fine.
2019-12-18Reenable static linking of libstdc++ on windows-gnuMateusz Mikuła-1/+1
2019-12-18Bump stage0Mark Rousskov-1/+1
2019-12-17Revert "Auto merge of #67362 - Mark-Simulacrum:par-4-default, r=alexcrichton"Mark Rousskov-13/+13
This reverts commit 3ed3b8bb7b100afecf7d5f52eafbb70fec27f537, reversing changes made to 99b89533d4cdf7682ea4054ad0ee36c351d05df1. We will reland a similar patch at a future date but for now we should get a nightly released in a few hours with the parallel patch, so this should be reverted to make sure that the next nightly is not parallel-enabled.
2019-12-17Disable cargo tests for nowMark Rousskov-13/+13
These depend on rustc being bug-free and it looks like that's not currently entirely the case (e.g., we know of at least one bug that introduces nondeterminism).
2019-12-13Fix the configure.py TOML field for a couple LLVM optionsJosh Stone-2/+2
The actual fields in `config.toml.example` have dashes, not underscores.
2019-12-13Auto merge of #67077 - Aaron1011:build-llvm-in-binary, r=alexcrichtonbors-344/+125
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-11/+17
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-11Add comment explaining original `maybe_install_llvm_dylib` callAaron Hill-0/+3
2019-12-11Fix missing libLLVM.so in stage0 sysroot.Aaron Hill-0/+38
When we dynamically link against libLLVM.so (as opposed to statically linking LLVM), we need libLLVM.so to be present in the stage0 sysroot, so that stage1 tools (which are built against the stage0 compiler+sysroot) can see it at build time (when the linker is run) See the comment in the commit for more details
2019-12-11Fix a test in the bootstrap test suiteAlex Crichton-0/+4
2019-12-11Fix some linking of LLVM's dynamic libraryAlex Crichton-25/+24
Ensure it shows up in the same places it did before so tools can find it at runtime.
2019-12-11rustc: Link LLVM directly into rustc againAlex Crichton-320/+57
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-10Move CI to new builtin check-toolstateMark Rousskov-0/+2
2019-12-10Add toolstate checking into bootstrapMark Rousskov-27/+406
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-11/+17
2019-12-04SGX: Fix target linker used by bootstrapJethro Beekman-0/+1
2019-12-02Update the minimum external LLVM to 7Josh Stone-2/+2
LLVM 7 is over a year old, which should be plenty for compatibility. The last LLVM 6 holdout was llvm-emscripten, which went away in #65501. I've also included a fix for LLVM 8 lacking `MemorySanitizerOptions`, which was broken by #66522.
2019-12-01rustbuild: don't clobber RUSTFLAGS, append to itXimin Luo-5/+7
2019-12-01rustbuild: fix cross-compile installXimin Luo-1/+1
although, not sure why this works - it wasn't needed before
2019-11-26Fix spelling typosBrian Wignall-1/+1
2019-11-25Rollup merge of #66569 - pietroalbini:gha-1, r=alexcrichtonPietro Albini-0/+4
GitHub Actions: preparations, part 1 This PR adds the first batch of commits in preparation for GitHub Actions: * Added GitHub Actions support in `src/ci/shared.sh` and bootstrap. * Addded a `setup-environment.sh` script which guesses and sets the `DEPLOY`, `DEPLOY_ALT` and `IMAGE` environment variables automatically, to reduce the verbosity of the CI configuration. This PR does **not** yet add any builders on GitHub Actions. r? @alexcrichton