about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2019-07-26rustc: Stabilize options for pipelined compilationAlex Crichton-0/+3
This commit stabilizes options in the compiler necessary for Cargo to enable "pipelined compilation" by default. The concept of pipelined compilation, how it's implemented, and what it means for rustc are documented in #60988. This PR is coupled with a PR against Cargo (rust-lang/cargo#7143) which updates Cargo's support for pipelined compliation to rustc, and also enables support by default in Cargo. (note that the Cargo PR cannot land until this one against rustc lands). The technical changes performed here were to stabilize the functionality proposed in #60419 and #60987, the underlying pieces to enable pipelined compilation support in Cargo. The issues have had some discussion during stabilization, but the newly stabilized surface area here is: * A new `--json` flag was added to the compiler. * The `--json` flag can be passed multiple times. * The value of the `--json` flag is a comma-separated list of directives. * The `--json` flag cannot be combined with `--color` * The `--json` flag must be combined with `--error-format=json` * The acceptable list of directives to `--json` are: * `diagnostic-short` - the `rendered` field of diagnostics will have a "short" rendering matching `--error-format=short` * `diagnostic-rendered-ansi` - the `rendered` field of diagnostics will be colorized with ansi color codes embedded in the string field * `artifacts` - JSON blobs will be emitted for artifacts being emitted by the compiler The unstable `-Z emit-artifact-notifications` and `--json-rendered` flags have also been removed during this commit as well. Closes #60419 Closes #60987 Closes #60988
2019-07-26`run_quiet` outputs stdout/stderr when things go wrong.Giles Cope-1/+1
(was `run` uses `run_silent` under the covers.)
2019-07-26Auto merge of #60260 - videolabs:rust_uwp2, r=alexcrichtonbors-1/+2
Add support for UWP targets Hi, This pull request aims at adding support for UWP (Universal Windows Apps) platform. A few notes: - This requires a very recent mingw-w64 version (containing this commit and the previous related ones: https://github.com/mirror/mingw-w64/commit/e8c433c871687a78408ae9b40ab7776577db908d#diff-eefdfbfe9cec5f4ebab88c9a64d423a9) - This was tested using LLVM/clang rather than gcc, and so far it assumes that LLVM/clang will be the native compiler. This is mostly due to the fact that the support for exceptions/stack unwinding for UWP got much more attention in libunwind - The "uwp" part of the target needs support for it in the `cc-rs` & `backtrace-rs` crates. I'll create the MR there right after I submit this one and will link everything together, but I'm not sure what's the correct way of dealing with external dependencies in the context of rust - Enabling import libraries and copying them across stages requires a change in cargo, for which I'll open a MR right after I submit this one as well - The i686 stack unwinding is unsupported for now, because LLVM assumes SjLj, while rust seems to assume SEH will be used. I'm unsure how to fix this Also, this is my first encounter with rust, so please bear with my code, it might not feel so idiomatic or even correct :) I'm pretty sure there's a way of doing things in a cleaner way when it comes to win/c.rs, maybe having a UWP & desktop specific modules, and import those conditionally? It doesn't feel right to sprinkle `#[cfg(...)]` all over the place Off course, I'll gladly update anything you see fit (to the extent of my abilities/knowledge :) )! Thanks,
2019-07-25Rollup merge of #61890 - golddranks:fix_sanity_check_llvm, r=Dylan-DPCMazdak Farrokhzad-2/+13
Fix some sanity checks Update: Changes that made it not to work dropped. * Fix `building_llvm` in sanity check * This was subtly broken: we build LLVM if any of the hosts builds LLVM, and not setting the config meant that LLVM is built for that target. Because of filtering away the targets not configured and the semantics of `Iterator::any`, it currently didn't set the `building_llvm` flag even if we indeed build it. * Add `swig` sanity check * This checks whether there is a `swig` executable needed for LLDB.
2019-07-25bootstrap: Build startup object for all windows-gnu targetHugo Beauzée-Luyssen-1/+1
So that uwp-windows-gnu also gets its startup objects built
2019-07-25rustc: codegen: Build import library for all windows targetsHugo Beauzée-Luyssen-0/+1
So far it is assumed that using a DLL as a -l parameter argument is ok, but the assumption doesn't hold when compiling the native code with llvm. In which case, an import library is required, so let's build one This also requires the cargo counterpart to add the import library in the stamp files, at least when compiling libstd. Otherwise, the files don't get uplifted
2019-07-23Require a value for configure --debuginfo-levelJosh Stone-5/+5
In `configure.py`, using the `o` function creates an enable/disable boolean setting, and writes `true` or `false` in `config.toml`. However, rustbuild is expecting to parse a `u32` debuginfo level. We can change to the `v` function to have the options require a value.
2019-07-23Fix building_llvm in sanity check, add swig sanity check.Pyry Kontio-2/+13
2019-07-18Rollup merge of #62752 - nikic:llvm-disable-z3, r=alexcrichtonMark Rousskov-0/+1
Disable Z3 in LLVM build Avoid building LLVM with Z3 if it happens to be installed. Fixes #62750. r? @alexcrichton
2019-07-17Update mdbook, cargo, booksEric Huss-29/+9
This updates the last of the books using mdbook 0.1, finally removing it from the build.
2019-07-17Disable Z3 in LLVM buildNikita Popov-0/+1
2019-07-16Auto merge of #61946 - BaoshanPang:vxworks, r=alexcrichtonbors-0/+2
port rust for vxWorks The supporting for vxWorks has been enabled in this branch. Although there are still a lots of work to do, I would like to upstream the code and fix the problems later. Please let me know if there is anything I have to do before upstream the code. r? @alexcrichton Thanks, Baoshan
2019-07-16Rollup merge of #62693 - alexcrichton:rm-travis-appveyor, r=Mark-SimulacrumMark Rousskov-116/+4
ci: Remove Travis/AppVeyor configuration Now that we've fully moved to Azure Pipelines and bors has been updated to only gate on Azure this commit removes the remaining Travis/AppVeyor support contained in this repository. Most of the deletions here are related to producing better output on Travis by folding certain sections. This isn't supported by Azure so there's no need to keep it around, and if Azure ever adds support we can always add it back!
2019-07-16Add supporting for vxWorksBaoshan Pang-0/+2
r? @alexcrichton
2019-07-15ci: Remove Travis/AppVeyor configurationAlex Crichton-116/+4
Now that we've fully moved to Azure Pipelines and bors has been updated to only gate on Azure this commit removes the remaining Travis/AppVeyor support contained in this repository. Most of the deletions here are related to producing better output on Travis by folding certain sections. This isn't supported by Azure so there's no need to keep it around, and if Azure ever adds support we can always add it back!
2019-07-15Update the stdarch submodulegnzlbg-1/+1
2019-07-12rustbuild: Improve assert about building tools onceAlex Crichton-21/+48
In developing #61557 I noticed that there were two parts of our tools that were rebuilt twice on CI. One was rustfmt fixed in #61557, but another was Cargo. The actual fix for Cargo's double compile was rust-lang/cargo#7010 and took some time to propagate here. In an effort to continue to assert that Cargo is itself not compiled twice, I updated the assertion in rustbuild at the time of working on #61557 but couldn't land it because the fix wouldn't be ready until the next bootstrap. The next bootstrap is now here, so the fix can now land! This does not change the behavior of rustbuild but it is intended to catch the previous iteration of compiling cargo twice. The main update here was to consider more files than those in `$target/release/deps` but also consider those in `$target/release`. That's where, for example, `libcargo.rlib` shows up and it's the file we learn about, and that's what we want to deduplicate.
2019-07-12Auto merge of #62549 - ehuss:update-cargo-vendor, r=alexcrichtonbors-46/+43
Update cargo-vendor usage This contains a variety of updates to clean up the usage of cargo-vendor. - Remove the install step for the old cargo-vendor now that it is built-in to cargo and available in the stage0 install. - Update installation instructions, dealing with vendoring. The current instructions of running `sudo ./x.py install` is broken, it will almost always fail (since the vendor directory doesn't exist). Since the steps for properly handling this are numerous, I'm recommending removing the suggestion to use `sudo` altogether. - If the sudo-forced-vendoring detects that the vendor directory is not available, abort with instructions on how to fix. - Now that cargo-vendor is built-in, automatically run it if it looks like it is needed. - Update instructions on how to install cargo. - Remove the unused markdown link references in README/CONTRIBUTING. This reverts most of #44935. These references don't do anything if they are unused. Closes #49269 cc #61142 #48771 #40108
2019-07-09Update cargo-vendor usageEric Huss-46/+43
2019-07-09Rollup merge of #62417 - alexreg:fix-self-in-type-alias, r=pnkfelixMazdak Farrokhzad-8/+8
Fix ICEs when `Self` is used in type aliases I think it is right just to disallow this at resolution stage rather than let typeck produce a cyclic error. This is in line with previous behaviour. There was probably no need at all for the change that introduced this bug in #57428, so I've simply reversed it. Fixes #62263, #62364, #62305. r? @eddyb
2019-07-07Rollup merge of #62438 - petrochenkov:buildwarn, r=Mark-SimulacrumMazdak Farrokhzad-37/+31
rustbuild: Cleanup global lint settings Lint settings do not depend on `if let Some(target) = target` in any way, so they are moved out of that clause. Internal lints now respect `RUSTC_DENY_WARNINGS`. Crate name treatment is cleaned up a bit. cc https://github.com/rust-lang/rust/pull/61545 @flip1995 r? @Mark-Simulacrum
2019-07-07Address review commentsVadim Petrochenkov-2/+4
2019-07-06Add linkcheck command to rustbook toolAndré Luis Leal Cardoso Junior-1/+25
2019-07-06add ./x.py test src/doc/rustc-guideAndré Luis Leal Cardoso Junior-0/+2
2019-07-06rustbuild: Cleanup global lint settingsVadim Petrochenkov-37/+29
2019-07-06Fixed up a few comments.Alexander Regueiro-8/+8
2019-07-05Rollup merge of #62406 - Mark-Simulacrum:warnings-lint, r=RalfJungMazdak Farrokhzad-5/+23
Lint on invalid values passed to x.py --warnings This also introduces support for `--warnings allow` and fixes --warnings being overridden by the configuration file, config.toml. Fixes #62402 r? @RalfJung
2019-07-05Rollup merge of #61545 - flip1995:internal_lints, r=oli-obkMazdak Farrokhzad-1/+14
Implement another internal lints cc #49509 This adds ~~two~~ one internal lint~~s~~: 1. LINT_PASS_IMPL_WITHOUT_MACRO: Make sure, that the `{declare,impl}_lint_pass` macro is used to implement lint passes. cc #59669 2. ~~USAGE_OF_TYCTXT_AND_SPAN_ARGS: item 2 on the list in #49509~~ ~~With 2. I wasn't sure, if this lint should be applied everywhere. That means a careful review of 0955835 would be great. Also 73fb9b4 allows this lint on some functions. Should I also apply this lint there?~~ TODO (not directly relevant for review): - [ ] https://github.com/rust-lang/rust/pull/59316#discussion_r280186517 (not sure yet, if this works or how to query for `rustc_private`, since it's not in [`Features`](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/feature_gate/struct.Features.html) :thinking: cc @eddyb) - [x] https://github.com/rust-lang/rust/pull/61735#discussion_r292389870 - [x] Check explicitly for the `{declare,impl}_lint_pass!` macros r? @oli-obk
2019-07-05Lint on invalid values passed to x.py --warningsMark Rousskov-5/+23
This also introduces support for `--warnings allow` and fixes --warnings being overridden by the configuration file, config.toml.
2019-07-04Switch master to 1.38Mark Rousskov-1/+1
2019-06-29Rollup merge of #61755 - Centril:compiletest-force-check, r=petrochenkovMazdak Farrokhzad-0/+24
Add `--pass $mode` to compiletest through `./x.py` Adds a flag `--pass $mode` to compiletest, which is exposed through `./x.py`. When `--pass $mode` is passed, `{check,build,compile,run}-pass` tests will be forced to run under the given `$mode` unless the directive `// ignore-pass` exists in the test file. The modes are explained in https://github.com/rust-lang/rust/pull/61778: - `check` has the same effect as `cargo check` - `build` or `compile` have the same effect as `cargo build` - `run` has the same effect as `cargo run` On my machine, `./x.py -i test src/test/run-pass --stage 1 --pass check` takes 38 seconds whereas it takes 2 min 7 seconds without `--pass check`. cc https://github.com/rust-lang/rust/issues/61712 r? @petrochenkov
2019-06-25Auto merge of #61765 - Keruspe:rustbuild-cxx, r=alexcrichtonbors-17/+27
rustbuild: detect cxx for all targets Replaces #61544 Fixes #59917 We need CXX to build llvm-libunwind which can be enabled for alltargets. As we needed it for all hosts anyways, just move the detection so that it is ran for all targets (which contains all hosts) instead.
2019-06-24Use symbols in lint tool listflip1995-5/+6
2019-06-24Turn internal lints into tool lintsflip1995-2/+6
2019-06-24Rename internal -> rustc::internalflip1995-1/+3
2019-06-24Enable internal lints in bootstrapflip1995-1/+7
2019-06-24rustbuild: always set cxx for build hostMarc-Antoine Perennou-1/+1
Even if it's not in hosts Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2019-06-24bootstrap: pass '--pass' on to compiletest.Mazdak Farrokhzad-0/+24
2019-06-23Make tidy quieter by defaultMark Rousskov-2/+2
2019-06-21rustbuild: only autodetect cxx for hostsMarc-Antoine Perennou-12/+9
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2019-06-20Update mdbookEric Huss-12/+12
2019-06-18Auto merge of #61864 - lzutao:ptr-null, r=sfacklerbors-5/+6
Make use of `ptr::null(_mut)` instead of casting zero There are few places that I don't replace the zero casting pointer with `ptr::null` or `ptr::null_mut`: ```bash % git grep -E '[ ([{]0 as \*' src/libcore/ptr/mod.rs:216:pub const fn null<T>() -> *const T { 0 as *const T } src/libcore/ptr/mod.rs:231:pub const fn null_mut<T>() -> *mut T { 0 as *mut T } src/test/run-pass/consts/const-cast-ptr-int.rs:12:static a: TestStruct = TestStruct{x: 0 as *const u8}; src/test/ui/issues/issue-45730.rs:5: let x: *const _ = 0 as *const _; //~ ERROR cannot cast src/test/ui/issues/issue-45730.rs:8: let x = 0 as *const i32 as *const _ as *mut _; //~ ERROR cannot cast src/test/ui/issues/issue-45730.stderr:14:LL | let x: *const _ = 0 as *const _; src/test/ui/issues/issue-45730.stderr:24:LL | let x = 0 as *const i32 as *const _ as *mut _; src/test/ui/lint/lint-forbid-internal-unsafe.rs:15: println!("{}", evil!(*(0 as *const u8))); src/test/ui/order-dependent-cast-inference.rs:5: let mut y = 0 as *const _; src/test/ui/order-dependent-cast-inference.stderr:4:LL | let mut y = 0 as *const _; ``` r? @sfackler
2019-06-17Make use of `ptr::null(_mut)` instead of casting zeroLzu Tao-5/+6
2019-06-17Auto merge of #58508 - Zoxc:time-crate, r=oli-obkbors-4/+16
Add a RUSTC_TIME env var to time rust crates during bootstrap Blocked on https://github.com/rust-lang/cargo/pull/6674 r? @michaelwoerister Example for rustc with https://github.com/rust-lang/rust/pull/58507: ``` time: 0.460; rss: 94MB parsing time: 0.000; rss: 94MB attributes injection time: 0.000; rss: 94MB recursion limit time: 0.000; rss: 94MB crate injection time: 0.000; rss: 94MB plugin loading time: 0.000; rss: 94MB plugin registration time: 0.044; rss: 94MB pre ast expansion lint checks time: 1.999; rss: 316MB expand crate time: 0.000; rss: 316MB check unused macros time: 2.000; rss: 316MB expansion time: 0.000; rss: 316MB maybe building test harness time: 0.053; rss: 316MB AST validation time: 0.000; rss: 316MB maybe creating a macro crate time: 1.515; rss: 397MB name resolution time: 0.122; rss: 397MB complete gated feature checking time: 0.655; rss: 546MB lowering ast -> hir time: 0.136; rss: 550MB early lint checks time: 0.117; rss: 540MB validate hir map time: 0.606; rss: 540MB indexing hir time: 0.000; rss: 480MB load query result cache time: 0.000; rss: 478MB dep graph tcx init time: 0.000; rss: 478MB looking for entry point time: 0.001; rss: 478MB looking for plugin registrar time: 0.001; rss: 478MB looking for derive registrar time: 0.049; rss: 478MB loop checking time: 0.064; rss: 479MB attribute checking time: 0.166; rss: 484MB stability checking time: 0.699; rss: 566MB type collecting time: 0.006; rss: 566MB outlives testing time: 0.018; rss: 568MB impl wf inference time: 0.002; rss: 583MB unsafety checking time: 0.005; rss: 583MB orphan checking time: 0.227; rss: 583MB coherence checking time: 0.006; rss: 583MB variance testing time: 1.546; rss: 657MB wf checking time: 0.389; rss: 665MB item-types checking time: 13.999; rss: 837MB item-bodies checking time: 1.692; rss: 883MB rvalue promotion time: 0.067; rss: 883MB intrinsic checking time: 0.624; rss: 887MB match checking time: 0.246; rss: 889MB liveness checking time: 2.629; rss: 889MB misc checking time: 0.000; rss: 889MB borrow checking time: 16.754; rss: 1242MB MIR borrow checking time: 0.050; rss: 1242MB dumping chalk-like clauses time: 0.010; rss: 1242MB MIR effect checking time: 0.001; rss: 1242MB layout testing time: 0.829; rss: 1244MB privacy checking time: 0.183; rss: 1247MB death checking time: 0.100; rss: 1248MB unused lib feature checking time: 0.405; rss: 1250MB lint checking time: 1.518; rss: 1250MB misc checking time: 0.000; rss: 1250MB resolving dependency formats time: 2.928; rss: 1332MB write metadata time: 0.014; rss: 1332MB collecting roots time: 7.621; rss: 1488MB collecting mono items time: 7.635; rss: 1488MB monomorphization collection time: 0.557; rss: 1567MB codegen unit partitioning time: 27.971; rss: 2656MB codegen to LLVM IR time: 0.056; rss: 2656MB assert dep graph time: 0.000; rss: 2656MB serialize dep graph time: 195.414; rss: 2656MB codegen time: 0.000; rss: 329MB serialize work products time: 1.664; rss: 331MB running linker time: 1.965; rss: 331MB linking [RUSTC-TIMING] rustc test:false 950.103 ``` It doesn't really look like the times add up here.
2019-06-16Separate bootstrap modulechansuke-658/+657
2019-06-16Rollup merge of #61829 - Keruspe:libunwind-src, r=alexcrichtonMazdak Farrokhzad-0/+1
rustbuild: include llvm-libunwind in dist tarball Without this we cannot build with llvm-libunwind enabled from a release tarball. Could it be backported in a beta rollup somehow so that this gets fixed before 1.36 is released?
2019-06-16Rollup merge of #61704 - petrhosek:llvm-linker-flags, r=alexcrichtonMazdak Farrokhzad-0/+4
Pass LLVM linker flags to librustc_llvm build Some -L and -l flags may be needed even when building librustc_llvm, for example when using static libc++ on Linux we may need to manually specify the library search path and -ldl -lpthread as additional link dependencies. We pass LLVM linker flags from config to librustc_llvm build to make sure these cases are handled.
2019-06-14rustbuild: include llvm-libunwind in dist tarballMarc-Antoine Perennou-0/+1
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2019-06-13rustbuild: set cxx for hosts even if not configuredMarc-Antoine Perennou-1/+1
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2019-06-13Remove unnecessary Std dependencyMark Rousskov-9/+0