summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2020-02-28bootstrap: Configure cmake when building sanitizer runtimesTomasz Miąsko-9/+19
2020-02-27ci: switch macOS builders to 10.15Pietro Albini-2/+2
2020-01-24Rollup merge of #68500 - Mark-Simulacrum:fix-bootstrap-clearing, r=alexcrichtonTyler Mandry-1/+1
Clear out std, not std tools This was a typo that slipped in, and meant that we were still not properly clearing out std. This is basically #67760 but actually correct...
2020-01-24Rollup merge of #68473 - nopsledder:rust_sanitizer_fuchsia, r=alexcrichtonTyler Mandry-0/+18
Enable ASan on Fuchsia This change adds the x86_64-fuchsia and aarch64-fuchsia LLVM targets to those allowed to invoke -Zsanitizer. Currently, the only overlap between compiler_rt sanitizers supported by both rustc and Fuchsia is ASan.
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-23Auto merge of #68391 - tmiasko:compiletest-debuginfo, r=alexcrichtonbors-8/+0
compiletest: Simplify multi-debugger support Previous implementation used a single mode type to store various pieces of otherwise loosely related information: * Whether debuginfo mode is in use or not. * Which debuggers should run in general. * Which debuggers are enabled for particular test case. The new implementation introduces a separation between those aspects. There is a single debuginfo mode parametrized by a debugger type. The debugger detection is performed first and a separate configuration is created for each detected debugger. The test cases are gathered independently for each debugger which makes it trivial to implement support for `ignore` / `only` conditions. Functional changes: * A single `debuginfo` entry point (rather than `debuginfo-cdb`, `debuginfo-gdb+lldb`, etc.). * Debugger name is included in the test name. * Test outputs are placed in per-debugger directory. * Fixed spurious hash mismatch. Previously, the config mode would change from `DebugInfoGdbLldb` (when collecting tests) to `DebugInfoGdb` or `DebugInfoLldb` (when running them) which would affect hash computation. * PYTHONPATH is additionally included in gdb hash. * lldb-python and lldb-python-dir are additionally included in lldb hash.
2020-01-22Enable ASan on FuchsiaAaron Green-0/+18
This change adds the x86_64-fuchsia and aarch64-fuchsia LLVM targets to those allowed to invoke -Zsanitizer. Currently, the only overlap between compiler_rt sanitizers supported by both rustc and Fuchsia is ASan.
2020-01-22bootstrap: update clippy subcmd decriptionMatthias Krüger-1/+1
Clarify where the clippy used in `./x.py clippy` is coming from. It uses whatever clippy binary was installed via rustup, cargo-install or otherwise and does NOT use the binary generated by `./x.py build src/tools/clippy`.
2020-01-20compiletest: Simplify multi-debugger supportTomasz Miąsko-8/+0
Previous implementation used a single mode type to store various pieces of otherwise loosely related information: * Whether debuginfo mode is in use or not. * Which debuggers should run in general. * Which debuggers are enabled for particular test case. The new implementation introduces a separation between those aspects. There is a single debuginfo mode parametrized by a debugger type. The debugger detection is performed first and a separate configuration is created for each detected debugger. The test cases are gathered independently for each debugger which makes it trivial to implement support for `ignore` / `only` conditions. Functional changes: * A single `debuginfo` entry point (rather than `debuginfo-cdb`, `debuginfo-gdb+lldb`, etc.). * Debugger name is included in the test name. * Test outputs are placed in per-debugger directory. * Fixed spurious hash mismatch. Previously, the config mode would change from `DebugInfoGdbLldb` (when collecting tests) to `DebugInfoGdb` or `DebugInfoLldb` (when running them) which would affect hash computation. * PYTHONPATH is additionally included in gdb hash. * lldb-python and lldb-python-dir are additionally included in lldb hash.
2020-01-15Rollup merge of #68231 - danielframpton:windows-crosscompile, r=alexcrichtonYuki Okushi-0/+2
Better support for cross compilation on Windows. I have been investigating enabling panic=unwind for aarch64-pc-windows-msvc (see #65313) and building rustc and cargo hosted on aarch64-pc-windows-msvc. Without the libpath changes we were trying to link a mix of amd64 and arm64 binaries. Without the cmake system name change, the llvm build was trying to run an arm64 build tool on the x86_64 build machine. That said, I haven't tested all different combinations here and am very open to resolving this a different way.
2020-01-15Rollup merge of #68141 - euclio:replace-bindings-with-winapi, r=alexcrichtonYuki Okushi-127/+27
use winapi for non-stdlib Windows bindings
2020-01-14Better support for cross compilation on Windows.Daniel Frampton-0/+2
2020-01-14Tweak assertion note in fmtYuki Okushi-1/+9
2020-01-11use winapi for non-stdlib Windows bindingsAndy Russell-127/+27
2020-01-11Rollup merge of #68074 - matthew-healy:skip-llvm-rebuild-option, r=CentrilMazdak Farrokhzad-2/+19
Add `llvm-skip-rebuild` flag to `x.py` This PR follows on from #67437 to complete the feature request from #65612. Specifically it adds a new command-line flag, `--llvm-skip-rebuild`, which overrides both any value set in `config.toml` and the default value (`false`). I'm not 100% confident that I've implemented the override in the "best" way, but I've checked it locally and it seems to work at least. This option isn't currently mentioned in the Guide to Rustc Development. I'd be happy to write something on it if folk think that's worthwhile.
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.