about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2022-06-13move stage0 config closer to ConfigPietro Albini-22/+22
2022-06-10fix testsPietro Albini-0/+3
2022-06-09future-proof adding more protocolsPietro Albini-2/+11
2022-06-09load configuration for downloading artifacts from stage0.jsonPietro Albini-49/+55
2022-06-09keep the same config values in stage0 between invocationsPietro Albini-1/+1
This commit allows users to change the contents of the "config" key in src/stage0.json without having it overridden the next time the bump-stage0 tool is executed.
2022-06-09Revert "Remove num_cpus dependency from bootstrap, build-manifest and ↵David Tolnay-5/+4
rustc_session" This reverts commit 2d854f9c340df887e30896f49270ae81feb3e227.
2022-06-07Don't build the compiler before building rust-demanglerJoshua Nelson-2/+6
This saves a lot of time compiling.
2022-06-07Add a `DownloadSource` enumJoshua Nelson-43/+44
This simplifies the arguments to `download_component` in config.rs. It also moves stage0.json metadata handling to `Build::new`, making it easier to download the stage0 compiler in rustbuild later if necessary.
2022-06-07Add checksum verification for rustfmt downloadsJoshua Nelson-10/+81
2022-06-07Move beta rustfmt downloads to rustbuildJoshua Nelson-95/+153
2022-06-07Simplify handling of `initial_rustfmt`Joshua Nelson-13/+5
2022-06-07Rename `download_component` -> `download_ci_component`Joshua Nelson-4/+4
It was confusing to have two functions with the same name but different behavior.
2022-06-07Auto merge of #95565 - jackh726:remove-borrowck-mode, r=nikomatsakisbors-7/+2
Remove migrate borrowck mode Closes #58781 Closes #43234 # Stabilization proposal This PR proposes the stabilization of `#![feature(nll)]` and the removal of `-Z borrowck`. Current borrow checking behavior of item bodies is currently done by first infering regions *lexically* and reporting any errors during HIR type checking. If there *are* any errors, then MIR borrowck (NLL) never occurs. If there *aren't* any errors, then MIR borrowck happens and any errors there would be reported. This PR removes the lexical region check of item bodies entirely and only uses MIR borrowck. Because MIR borrowck could never *not* be run for a compiled program, this should not break any programs. It does, however, change diagnostics significantly and allows a slightly larger set of programs to compile. Tracking issue: #43234 RFC: https://github.com/rust-lang/rfcs/blob/master/text/2094-nll.md Version: 1.63 (2022-06-30 => beta, 2022-08-11 => stable). ## Motivation Over time, the Rust borrow checker has become "smarter" and thus allowed more programs to compile. There have been three different implementations: AST borrowck, MIR borrowck, and polonius (well, in progress). Additionally, there is the "lexical region resolver", which (roughly) solves the constraints generated through HIR typeck. It is not a full borrow checker, but does emit some errors. The AST borrowck was the original implementation of the borrow checker and was part of the initially stabilized Rust 1.0. In mid 2017, work began to implement the current MIR borrow checker and that effort ompleted by the end of 2017, for the most part. During 2018, efforts were made to migrate away from the AST borrow checker to the MIR borrow checker - eventually culminating into "migrate" mode - where HIR typeck with lexical region resolving following by MIR borrow checking - being active by default in the 2018 edition. In early 2019, migrate mode was turned on by default in the 2015 edition as well, but with MIR borrowck errors emitted as warnings. By late 2019, these warnings were upgraded to full errors. This was followed by the complete removal of the AST borrow checker. In the period since, various errors emitted by the MIR borrow checker have been improved to the point that they are mostly the same or better than those emitted by the lexical region resolver. While there do remain some degradations in errors (tracked under the [NLL-diagnostics tag](https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3ANLL-diagnostics), those are sufficiently small and rare enough that increased flexibility of MIR borrow check-only is now a worthwhile tradeoff. ## What is stabilized As said previously, this does not fundamentally change the landscape of accepted programs. However, there are a [few](https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3ANLL-fixed-by-NLL) cases where programs can compile under `feature(nll)`, but not otherwise. There are two notable patterns that are "fixed" by this stabilization. First, the `scoped_threads` feature, which is a continutation of a pre-1.0 API, can sometimes emit a [weird lifetime error](https://github.com/rust-lang/rust/issues/95527) without NLL. Second, actually seen in the standard library. In the `Extend` impl for `HashMap`, there is an implied bound of `K: 'a` that is available with NLL on but not without - this is utilized in the impl. As mentioned before, there are a large number of diagnostic differences. Most of them are better, but some are worse. None are serious or happen often enough to need to block this PR. The biggest change is the loss of error code for a number of lifetime errors in favor of more general "lifetime may not live long enough" error. While this may *seem* bad, the former error codes were just attempts to somewhat-arbitrarily bin together lifetime errors of the same type; however, on paper, they end up being roughly the same with roughly the same kinds of solutions. ## What isn't stabilized This PR does not completely remove the lexical region resolver. In the future, it may be possible to remove that (while still keeping HIR typeck) or to remove it together with HIR typeck. ## Tests Many test outputs get updated by this PR. However, there are number of tests specifically geared towards NLL under `src/test/ui/nll` ## History * On 2017-07-14, [tracking issue opened](https://github.com/rust-lang/rust/issues/43234) * On 2017-07-20, [initial empty MIR pass added](https://github.com/rust-lang/rust/pull/43271) * On 2017-08-29, [RFC opened](https://github.com/rust-lang/rfcs/pull/2094) * On 2017-11-16, [Integrate MIR type-checker with NLL](https://github.com/rust-lang/rust/pull/45825) * On 2017-12-20, [NLL feature complete](https://github.com/rust-lang/rust/pull/46862) * On 2018-07-07, [Don't run AST borrowck on mir mode](https://github.com/rust-lang/rust/pull/52083) * On 2018-07-27, [Add migrate mode](https://github.com/rust-lang/rust/pull/52681) * On 2019-04-22, [Enable migrate mode on 2015 edition](https://github.com/rust-lang/rust/pull/59114) * On 2019-08-26, [Don't downgrade errors on 2015 edition](https://github.com/rust-lang/rust/pull/64221) * On 2019-08-27, [Remove AST borrowck](https://github.com/rust-lang/rust/pull/64790)
2022-06-05Auto merge of #93717 - pietroalbini:pa-ci-profiler, r=Mark-Simulacrumbors-0/+236
Add build metrics to rustbuild This PR adds a new module of rustbuild, `ci_profiler`, whose job is to gather as much information as possible about the CI build as possible and store it in a JSON file uploaded to `ci-artifacts`. Right now for each step it collects: * Type name and debug representation of the `Step` object. * Duration of the step (excluding child steps). * Systemwide CPU stats for the duration of the step (both single core and all cores). * Which child steps were executed. This is capable of replacing both the scripts to collect CPU stats and the `[TIMING]` lines in build logs (not yet removed, until we port our tooling to use the CI profiler). The format is also extensible to be able in the future to collect more information. r? `@Mark-Simulacrum`
2022-06-04Auto merge of #97529 - Urgau:bootstrap-check-cfg-features, r=Mark-Simulacrumbors-20/+17
Use new cargo argument in bootstrap for cfg checking This PR use new cargo argument in bootstrap for doing cfg checking. Follow-up to https://github.com/rust-lang/rust/pull/97044 and https://github.com/rust-lang/rust/pull/97214. r? `@Mark-Simulacrum`
2022-06-04bump sysinfo versionPietro Albini-5/+5
2022-06-04Auto merge of #97137 - Kobzol:ci-llvm-pgo-pid, r=Mark-Simulacrumbors-0/+3
Add PID to LLVM PGO profile path This is a continuation of https://github.com/rust-lang/rust/pull/97110, which adds PID to the filename pattern of LLVM profiles. It also adds some metrics to the pgo.sh script, so that we can observe how many profiles there are and how large are they. r? `@lqd`
2022-06-03Fully stabilize NLLJack Huey-7/+2
2022-06-03Use new cargo argument of cfg checking in bootstrapUrgau-20/+17
2022-05-30Auto merge of #97548 - Dylan-DPC:rollup-9x0va1d, r=Dylan-DPCbors-15/+30
Rollup of 6 pull requests Successful merges: - #97494 (Use Box::new() instead of box syntax in library tests) - #97499 (Remove "sys isn't exported yet" phrase) - #97504 (Ensure source file present when calculating max line number) - #97519 (Re-add help_on_error for download-ci-llvm) - #97531 (Note pattern mismatch coming from `for` loop desugaring) - #97545 (Reword safety comments in core/hash/sip.rs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-30Rollup merge of #97519 - binggh:readd-help-on-error, r=jyn514Dylan DPC-15/+30
Re-add help_on_error for download-ci-llvm Closes #97503 - Re-added `help_on_error` for `download_component()` and the downstream functions - Removed dead code in `bootstrap.py` Thanks `@jyn514` for the helpful tips! (first contribution here, please let me know if I missed anything out!)
2022-05-30Auto merge of #97546 - RalfJung:miri, r=oli-obkbors-6/+0
update Miri First update with the new ui test suite, let's hope this all works. :) r? `@oli-obk` Fixes https://github.com/rust-lang/rust/issues/97486
2022-05-30be less redundant redundantRalf Jung-4/+0
2022-05-30Let miri decide the flags to use for the test suiteOli Scherer-2/+0
2022-05-29Auto merge of #97214 - Mark-Simulacrum:stage0-bump, r=pietroalbinibors-3/+1
Finish bumping stage0 It looks like the last time had left some remaining cfg's -- which made me think that the stage0 bump was actually successful. This brings us to a released 1.62 beta though. This now brings us to cfg-clean, with the exception of check-cfg-features in bootstrap; I'd prefer to leave that for a separate PR at this time since it's likely to be more tricky. cc https://github.com/rust-lang/rust/pull/97147#issuecomment-1132845061 r? `@pietroalbini`
2022-05-29Re-add help_on_error for download-ci-llvmbinggh-15/+30
Remove dead code Missing } ./x.py fmt Remove duplicate check Recursively remove all usage of help_on_error
2022-05-29Auto merge of #94214 - nikic:rust-opaque-pointers, r=cuviperbors-0/+4
Prepare Rust for opaque pointers Fix one codegen bug with opaque pointers, and update our IR tests to accept both typed pointer and opaque pointer IR. This is a bit annoying, but unavoidable if we want decent test coverage on both LLVM 14 and LLVM 15. This prepares Rust for when LLVM will enable opaque pointers by default.
2022-05-29Auto merge of #96687 - jyn514:download-rustc, r=Mark-Simulacrumbors-352/+418
Move download-rustc from python to rustbuild - Remove download-rustc handling from bootstrap.py - Allow a custom `pattern` in `builder.unpack()` - Only download rustc once another part of bootstrap depends on it. This is somewhat necessary since the download functions rely on having a full `Builder`, which isn't available until after config parsing finishes. Helps with https://github.com/rust-lang/rust/issues/94829.
2022-05-28Auto merge of #97476 - Dylan-DPC:rollup-t53nxoe, r=Dylan-DPCbors-25/+25
Rollup of 5 pull requests Successful merges: - #94640 (Partially stabilize `(const_)slice_ptr_len` feature by stabilizing `NonNull::len`) - #97034 (Implement `Hash` for `core::alloc::Layout`) - #97327 (macros: introduce `fluent_messages` macro ) - #97448 (docs: Don't imply that OsStr on Unix is always UTF-8) - #97466 ([bootstrap] Move `sanitize_sh` from `dist` to `install`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-28Add PID to LLVM PGO profiles generated in CI and measure PGO statisticsJakub Beránek-0/+3
2022-05-28Rollup merge of #97466 - jyn514:consolidate-install, r=Mark-SimulacrumDylan DPC-25/+25
[bootstrap] Move `sanitize_sh` from `dist` to `install` This is the only place it's used, so there's no need for it to be public in another module. In general, `dist` shouldn't ever touch shell scripts.
2022-05-28Auto merge of #97465 - jyn514:dist-ra, r=Mark-Simulacrumbors-0/+3
Fix `x dist --stage 1 src/tools/rust-analyzer` Previously, this would break because the submodule wasn't checked out. Fixes https://github.com/rust-lang/rust/issues/97464.
2022-05-28Rollup merge of #97411 - raiyansayeed:print-stderr-consistently, ↵Matthias Krüger-38/+38
r=Mark-Simulacrum Print stderr consistently Solves https://github.com/rust-lang/rust/issues/96712 I tried to follow what I perceived as the general consensus for error messages in boostrap i.e messages that were .. * resulting from an Err(...) => * literally called as "Error: ...." * by the end of the block scope forced to run a panic! or process::exit with a guaranteed non-zero error code.
2022-05-27[bootstrap] Move `sanitize_sh` from `dist` to `install`Joshua Nelson-25/+25
This is the only place it's used, so there's no need for it to be public in another module. In general, `dist` shouldn't ever touch shell scripts.
2022-05-27Fix `x dist --stage 1 src/tools/rust-analyzer`Joshua Nelson-0/+3
Previously, this would break because the submodule wasn't checked out.
2022-05-27Finish bumping stage0Mark Rousskov-3/+1
It looks like the last time had left some remaining cfg's -- which made me think that the stage0 bump was actually successful. This brings us to a released 1.62 beta though.
2022-05-26Auto merge of #97410 - jyn514:tool-std-features, r=Mark-Simulacrumbors-1/+6
Only allow `compiletest` to use `feature(test)`, not any other feature Using language features occasionally causes issues when using nightly to bootstrap, rather than beta. See #59264 for additional context.
2022-05-25fix: undo old changesRaiyan-2/+2
2022-05-25feat: refactored bootstrap files to use stderr consistentlyRaiyan-40/+40
2022-05-25Only allow `compiletest` to use `feature(test)`, not any other featureJoshua Nelson-1/+6
Using language features occasionally causes issues when using nightly to bootstrap, rather than beta. See #59264 for additional context.
2022-05-25Remove download-rustc handling from bootstrap.pyJoshua Nelson-53/+2
2022-05-25Add support for UTF-8 paths to downloads in builder.rsJoshua Nelson-8/+9
This is for a pre-existing FIXME, but it was easy enough to do.
2022-05-25Remove FIXME about nixOS detectionJoshua Nelson-1/+3
2022-05-25Move download-rustc from bootstrap.py to rustbuildJoshua Nelson-86/+200
- Remove download-rustc handling from bootstrap.py - Allow a custom `pattern` in `builder.unpack()` - Only download rustc once another part of bootstrap depends on it. This is somewhat necessary since the download functions rely on having a full `Builder`, which isn't available until after config parsing finishes.
2022-05-25Move `download` functions from `native` to builder.rsJoshua Nelson-222/+222
This has no logic changes, just a move.
2022-05-25Simplify implementation of `-Z gcc-ld`Vadim Petrochenkov-15/+8
- The logic is now unified for all targets (wasm targets should also be supported now) - Additional "symlink" files like `ld64` are eliminated - lld-wrapper is used for propagating the correct lld flavor - Cleanup "unwrap or exit" logic in lld-wrapper
2022-05-25Set LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN for lld build as wellNikita Popov-0/+4
2022-05-24Make llvm-libunwind a per-target optionTyler Mandry-7/+20
2022-05-24Rollup merge of #97290 - jyn514:fast-submodules, r=Mark-SimulacrumYuki Okushi-44/+30
Turn on `fast_submodules` unconditionally I don't know why anyone would turn this off; doing so makes builds much slower (nearly a 60x slowdown according to #49057). Remove the option to do so, which makes bootstrap a little easier to maintain. Bootstrap continues to allow you to manage submodules manually by setting `submodules = false`.
2022-05-23Turn on `fast_submodules` unconditionallyJoshua Nelson-44/+30
I don't know why anyone would turn this off; doing so makes builds much slower (nearly a 60x slowdown according to #49057). Remove the option to do so, which makes bootstrap a little easier to maintain. Bootstrap continues to allow you to manage submodules manually by setting `submodules = false`.