about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2020-01-10Auto merge of #65241 - tmiasko:no-std-san, r=alexcrichtonbors-47/+159
build-std compatible sanitizer support ### Motivation When using `-Z sanitizer=*` feature it is essential that both user code and standard library is instrumented. Otherwise the utility of sanitizer will be limited, or its use will be impractical like in the case of memory sanitizer. The recently introduced cargo feature build-std makes it possible to rebuild standard library with arbitrary rustc flags. Unfortunately, those changes alone do not make it easy to rebuild standard library with sanitizers, since runtimes are dependencies of std that have to be build in specific environment, generally not available outside rustbuild process. Additionally rebuilding them requires presence of llvm-config and compiler-rt sources. The goal of changes proposed here is to make it possible to avoid rebuilding sanitizer runtimes when rebuilding the std, thus making it possible to instrument standard library for use with sanitizer with simple, although verbose command: ``` env CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS=-Zsanitizer=thread cargo test -Zbuild-std --target x86_64-unknown-linux-gnu ``` ### Implementation * Sanitizer runtimes are no long packed into crates. Instead, libraries build from compiler-rt are used as is, after renaming them into `librusc_rt.*`. * rustc obtains runtimes from target libdir for default sysroot, so that they are not required in custom build sysroots created with build-std. * The runtimes are only linked-in into executables to address issue #64629. (in previous design it was hard to avoid linking runtimes into static libraries produced by rustc as demonstrated by sanitizer-staticlib-link test, which still passes despite changes made in #64780). cc @kennytm, @japaric, @firstyear, @choller
2020-01-11Rollup merge of #68075 - ollie27:rustbuild_books, r=Mark-SimulacrumYuki Okushi-72/+14
rustbuild: Cleanup book generation The Cargo book can be generated the same way as the other books.
2020-01-11Rollup merge of #68039 - euclio:remove-strip-hidden, r=dtolnayYuki Okushi-1/+1
remove explicit strip-hidden pass from compiler doc generation `strip-hidden` is now implied by `--document-private-items` with #67875, so there's no need to specify it anymore.
2020-01-10Prefer llvm-skip-rebuild flag value over config.tomlMatthew Healy-2/+6
2020-01-10Match llvm-skip-rebuild flagMatthew Healy-0/+5
2020-01-09rustbuild: Cleanup book generationOliver Middleton-72/+14
The Cargo book can be generated the same way as the other books.
2020-01-09Add llvm-skip-rebuild to optsMatthew Healy-0/+8
2020-01-09Add bootstrap step for building sanitizer runtimesTomasz Miąsko-43/+159
2020-01-09Remove sanitizer runtime cratesTomasz Miąsko-4/+0
2020-01-08remove strip-hidden pass from compiler doc generationAndy Russell-1/+1
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.