about summary refs log tree commit diff
path: root/src/bootstrap/bin
AgeCommit message (Collapse)AuthorLines
2023-06-27[PATCH] Fix build on Solaris where fd-lock cannot be used.Petr Sumbera-4/+6
2023-06-23display pid of process holding lockZephaniah Ong-36/+21
2023-05-07Give a more helpful error when running the rustc shim directlyjyn-4/+14
cc https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Building.20.60coretests.60.20by.20hand
2023-04-18Auto merge of #110492 - GuillaumeGomez:rollup-n4tpbl4, r=GuillaumeGomezbors-2/+4
Rollup of 5 pull requests Successful merges: - #110417 (Spelling compiler) - #110441 (5 little typos) - #110485 (Fix bootstrap locking) - #110488 (Add a failing rustdoc-ui test for public infinite recursive type) - #110490 (Bump `download-ci-llvm-stamp` for loong support) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-18Fix bootstrap lockingAlbert Larsan-2/+4
Fix the regression introduced in 108607
2023-04-17Support `x test --stage 1 ui-fulldeps`jyn-1/+1
Nils had an excellent idea the other day: the same way that rustdoc is able to load `rustc_driver` from the sysroot, ui-fulldeps tests should also be able to load it from the sysroot. That allows us to run fulldeps tests with stage1, without having to fully rebuild the compiler twice. It does unfortunately have the downside that we're running the tests on the *bootstrap* compiler, not the in-tree sources, but since most of the fulldeps tests are for the *API* of the compiler, that seems ok. I think it's possible to extend this to `run-make-fulldeps`, but I've run out of energy for tonight. - Move `plugin` tests into a subdirectory. Plugins are loaded at runtime with `dlopen` and so require the ABI of the running compile to match the ABI of the compiler linked with `rustc_driver`. As a result they can't be supported in stage 1 and have to use `// ignore-stage1`. - Remove `ignore-stage1` from most non-plugin tests - Ignore diagnostic tests in stage 1. Even though this requires a stage 2 build to load rustc_driver, it's primarily testing the error message that the *running* compiler emits when the diagnostic struct is malformed. - Pass `-Zforce-unstable-if-unmarked` in stage1, not just stage2. That allows running `hash-stable-is-unstable` in stage1, since it now suggests adding `rustc_private` to enable loading the crates. - Add libLLVM.so to the stage0 target sysroot, to allow fulldeps tests that act as custom drivers to load it at runtime. - Pass `--sysroot stage0-sysroot` in compiletest so that we use the correct version of std.
2023-03-20migrate compiler, bootstrap, and compiletest to windows-rsAndy Russell-22/+30
2023-03-13Rollup merge of #108607 - psumbera:solaris-no-flock-bootstrap, r=albertlarsan68Matthias Krüger-7/+10
Don't use fd-lock on Solaris in bootstrap ...as Solaris is missing flock() fixes #103630
2023-03-13Don't use fd-lock on Solaris in bootstrapPetr Sumbera-7/+10
...as Solaris is missing flock() fixes #103630
2023-03-11Rename `config.toml.example` to `config.example.toml`Thom Chiovoloni-4/+4
2023-01-23Print PID holding bootstrap build lock on Linuxclubby789-2/+34
2023-01-09Update mdbookEric Huss-0/+35
2022-12-22Use LLVM_CMAKE_DIR for lld buildNikita Popov-24/+0
LLVM_CONFIG_PATH is no longer supported as of LLVM 16, switch to using the cmake module instead. We separately return the llvm-config and cmake directory paths, because llvm-config always refers to the host binary, while the cmake directory is for the target triple.
2022-11-25remove unused codeTshepang Mbambo-3/+1
2022-11-25remove obsolete commentTshepang Mbambo-4/+0
2022-11-05Place config.toml in current working directory if config not foundTanner Davies-1/+1
2022-10-26check lld version to choose correct flag for testsDaniil Belov-6/+2
2022-10-06Remove `-Ztime` option.Nicholas Nethercote-1/+1
The compiler currently has `-Ztime` and `-Ztime-passes`. I've used `-Ztime-passes` for years but only recently learned about `-Ztime`. What's the difference? Let's look at the `-Zhelp` output: ``` -Z time=val -- measure time of rustc processes (default: no) -Z time-passes=val -- measure time of each rustc pass (default: no) ``` The `-Ztime-passes` description is clear, but the `-Ztime` one is less so. Sounds like it measures the time for the entire process? No. The real difference is that `-Ztime-passes` prints out info about passes, and `-Ztime` does the same, but only for a subset of those passes. More specifically, there is a distinction in the profiling code between a "verbose generic activity" and an "extra verbose generic activity". `-Ztime-passes` prints both kinds, while `-Ztime` only prints the first one. (It took me a close reading of the source code to determine this difference.) In practice this distinction has low value. Perhaps in the past the "extra verbose" output was more voluminous, but now that we only print stats for a pass if it exceeds 5ms or alters the RSS, `-Ztime-passes` is less spammy. Also, a lot of the "extra verbose" cases are for individual lint passes, and you need to also use `-Zno-interleave-lints` to see those anyway. Therefore, this commit removes `-Ztime` and the associated machinery. One thing to note is that the existing "extra verbose" activities all have an extra string argument, so the commit adds the ability to accept an extra argument to the "verbose" activities.
2022-09-16Pass --cfg=bootstrap for rustdoc for proc_macro cratesest31-4/+13
This commit does three things: * First, it passes --cfg=bootstrap on stage 0 for rustdoc invocations on proc_macro crates. This mirrors what we do already for rustc invocations of those, and is needed because cargo doesn't respect RUSTFLAGS or RUSTDOCFLAGS when confronted with a proc macro. * Second, it marks the bootstrap config variable as expected. This is needed both on later stages where it's not set, but also on stage 0, where it is set. * Third, it adjusts the comment in the rustc wrapper to better reflect the reason why we set the bootstrap variable as expected: due to recent changes, setting it as expected is also required even if the cfg variable is passed: ebf4cc361e0d0f11a25b42372bd629953365d17e .
2022-08-16bootstrap: don't apply `-Ztls-model=initial-exec` to proc macrosAlex Macleod-3/+12
2022-07-04Auto merge of #98731 - InfRandomness:fix-#98728, r=Mark-Simulacrumbors-3/+1
Revert #95993 fix This reverts the temporary fix implemented by https://github.com/rust-lang/rust/pull/95993 since a permanent fix has been implemented by https://github.com/rust-lang/cargo/pull/10594 Fixes https://github.com/rust-lang/rust/issues/98728
2022-06-30Revert #95993 fixInfRandomness-3/+1
This reverts the temporary fix implemented by https://github.com/rust-lang/rust/pull/95993 since a permanent fix has been implemented by https://github.com/rust-lang/cargo/pull/10594
2022-06-27Move locking from bootstrap.py to rust bootstrap, using fd-lockJosh Triplett-1/+17
2022-06-16Make #[cfg(bootstrap)] not error in proc macros on later stagesest31-3/+9
As was discovered in https://github.com/rust-lang/rust/pull/93628#issuecomment-1154697627 , adding #[cfg(bootstrap)] to a rust-internal proc macro crate would yield an unexpected cfg name error, at least on later stages wher the bootstrap cfg arg wasn't set. rustc already passes arguments to mark bootstrap as expected, however the means of delivery through the RUSTFLAGS env var is unable to reach proc macro crates, as described in the issue linked in the code this commit touches. This wouldn't be an issue for cfg args that get passed through RUSTFLAGS, as they would never become *active* either, so any usage of one of these flags in a proc macro's code would legitimately yield a lint warning. But since dc302587e2cf5105a3a864319d7e7bcb434bba20, rust takes extra measures to pass --cfg=bootstrap even in proc macros, by passing it via the wrapper. Thus, we need to send the flags to mark bootstrap as expected also from the wrapper, so that #[cfg(bootstrap)] also works from proc macros. I want to thank Urgau and jplatte for helping me find the cause of this. ❤️
2022-04-24Remove dead code in rustdoc shimJoshua Nelson-9/+2
The `RUSTDOC_RESOURCE_SUFFIX` variable was never actually set.
2022-04-12Fix `x test --doc --stage 0 library/std`Joshua Nelson-1/+3
I managed to break this in https://github.com/rust-lang/rust/pull/95449. I am not quite sure why this is the correct fix, but it doesn't break `doc --stage 0` and is strictly closer to the previous behavior. Previously, rustdoc would error with strange issues because of the mismatched sysroot: ``` error[E0460]: found possibly newer version of crate `std` which `rustc_span` depends on --> /home/jnelson/rust-lang/rust/compiler/rustc_lint_defs/src/lib.rs:14:5 | 14 | use rustc_span::{sym, symbol::Ident, Span, Symbol}; | ^^^^^^^^^^ | = note: perhaps that crate needs to be recompiled? = note: the following crate versions were found: crate `std`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-ff9290e971253a38.rlib crate `std`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-ff9290e971253a38.so crate `rustc_span`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_span-ed11dce30c1766f9.rlib ```
2022-04-05Rollup merge of #95449 - jyn514:doc-stage-0, r=ehussDylan DPC-4/+16
Fix `x doc --stage 0 compiler` Eric figured out the fix to this almost 2 years ago, I just didn't read his comment carefully enough at the timme. The issue was that fake rustc and fake rustdoc were inconsistent about when they passed `--sysroot` to the real compiler. Change them to consistently only pass it when `--target` is present. cc https://github.com/rust-lang/rust/issues/74976#issuecomment-667265945 Fixes https://github.com/rust-lang/rust/issues/79980 r? ``@ehuss``
2022-03-29Fix `x doc --stage 0 compiler`Joshua Nelson-4/+16
Eric figured out the fix to this almost 2 years ago, I just didn't read his comment carefully enough at the timme. The issue was that fake rustc and fake rustdoc were inconsistent about when they passed `--sysroot` to the real compiler. Change them to consistently only pass it when `--target` is present.
2022-03-28Revert "Auto merge of #93893 - oli-obk:sad_revert, r=oli-obk"Oli Scherer-0/+6
This reverts commit 6499c5e7fc173a3f55b7a3bd1e6a50e9edef782d, reversing changes made to 78450d2d602b06d9b94349aaf8cece1a4acaf3a8.
2022-02-11Revert "Auto merge of #92007 - oli-obk:lazy_tait2, r=nikomatsakis"Oli Scherer-6/+0
This reverts commit e7cc3bddbe0d0e374d05e7003e662bba1742dbae, reversing changes made to 734368a200904ef9c21db86c595dc04263c87be0.
2022-02-07Auto merge of #92007 - oli-obk:lazy_tait2, r=nikomatsakisbors-0/+6
Lazy type-alias-impl-trait Previously opaque types were processed by 1. replacing all mentions of them with inference variables 2. memorizing these inference variables in a side-table 3. at the end of typeck, resolve the inference variables in the side table and use the resolved type as the hidden type of the opaque type This worked okayish for `impl Trait` in return position, but required lots of roundabout type inference hacks and processing. This PR instead stops this process of replacing opaque types with inference variables, and just keeps the opaque types around. Whenever an opaque type `O` is compared with another type `T`, we make the comparison succeed and record `T` as the hidden type. If `O` is compared to `U` while there is a recorded hidden type for it, we grab the recorded type (`T`) and compare that against `U`. This makes implementing * https://github.com/rust-lang/rfcs/pull/2515 much simpler (previous attempts on the inference based scheme were very prone to ICEs and general misbehaviour that was not explainable except by random implementation defined oddities). r? `@nikomatsakis` fixes #93411 fixes #88236
2022-02-07Rollup merge of #88313 - jyn514:pre-push, r=Mark-SimulacrumMara Bos-0/+14
Make the pre-commit script pre-push instead This should make it substantially less annoying, and hopefully more people will find it useful. In particular, it will no longer run tidy each time you run `git commit --amend` or rebase a branch. This also warns if you have the old script in pre-commit; see the HACK comment for details. r? ````@Mark-Simulacrum```` cc ````@caass````
2022-02-02Add a convenient way to inject rustc flags somewhere late in the bootstrap ↵Oli Scherer-0/+6
pipeline without causing rebuilds Useful for -Ztreat-err-as-bug
2022-01-01Make the rustc and rustdoc wrapper not depend on libbootstrapbjorn3-6/+10
This slightly improves compilation time by reducing linking time (saving about a 1/10 of the the total compilation time after changing rustbuild) and slightly reduces disk usage (from 16MB for the rustc wrapper to 4MB).
2021-10-16bootstrap: tweak verbosity settingsXimin Luo-1/+1
Currently the verbosity settings are: - 2: RUSTC-SHIM envvars get spammed on every invocation, O(30) lines cargo is passed -v which outputs CLI invocations, O(5) lines - 3: cargo is passed -vv which outputs build script output, O(0-10) lines This commit changes it to: - 1: cargo is passed -v, O(5) lines - 2: cargo is passed -vv, O(10) lines - 3: RUSTC-SHIM envvars get spammed, O(30) lines
2021-08-24Make the pre-commit script pre-push insteadJoshua Nelson-0/+14
This should make it substantially less annoying, and hopefully more people will find it useful. In particular, it will no longer run tidy each time you run `git commit --amend` or rebase a branch. This also warns if you have the old script in pre-commit; see the HACK comment for details.
2021-06-07build doctests with lld if use-lld = trueThe8472-1/+6
2021-06-04Pass --cfg=bootstrap for proc_macros or build scripts built by stage0Joshua Nelson-0/+7
Cargo ignores RUSTFLAGS when building proc macro crates. However, sometimes rustc_macro needs to have conditional compilation when there are breaking changes to the `libproc_macro` API (see for example tell the difference between stage 0 and stage 1. Another alternative is to unconditionally build rustc_macros with the master libstd instead of the beta one (i.e. use `--sysroot stage0-sysroot`), but that led to strange and maddening errors: ``` error[E0460]: found possibly newer version of crate `std` which `proc_macro2` depends on --> /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/tracing-attributes-0.1.13/src/lib.rs:90:5 | 90 | use proc_macro2::TokenStream; | ^^^^^^^^^^^ | = note: perhaps that crate needs to be recompiled? = note: the following crate versions were found: crate `std`: /home/joshua/rustc2/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-b3602c301b71cc3d.rmeta crate `proc_macro2`: /home/joshua/rustc2/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps/libproc_macro2-a83c1f01610c129e.rlib ```
2021-05-21facepalm: operator precedence fail on my part.Felix S. Klock II-1/+1
This bug was only visible on mac. Also, print_step_rusage is a relatively new internal feature, that is not heavily used, and has no tests. All of these factors contributed to how this went uncaught this long. Thanks to Josh Triplett for pointing it out!
2021-03-19Auto merge of #82754 - rylev:rusage-windows, r=pnkfelixbors-9/+75
Attempt to gather similar stats as rusage on Windows A follow up to #82532. This is a bit hacked in because I think we need to discuss this before merging, but this is an attempt to gather similar metrics as `libc::rusage` on Windows. Some comments on differences: * Currently, we're passing `RUSAGE_CHILDREN` to `rusage` which collects statistics on all children that have been waited on and terminated. I believe this is currently just the invocation of the real `rustc` that the shim is wrapping. Does `rustc` itself spawn children processes? The windows version gets the child processes handle when spawning it, and uses that to collect the statistics. For maxrss, `rusage` will return "the resident set size of the largest child, not the maximum resident set size of the process tree.", the Windows version will only collect statistics on the wrapped `rustc` child process directly even if some theoretical sub process has a larger memory footprint. * There might be subtle differences between `rusage`'s "resident set" and Window's "working set". The "working set" and "resident set" should both be the number of pages that are in memory and which would not cause a page fault when accessed. * I'm not yet sure how best to get the same information that `ru_minflt`, `ru_inblock`, `ru_oublock`, `ru_nivcsw ` and `ru_nvcsw` provide. r? `@pnkfelix`
2021-03-11Clean up handling of child processRyan Levick-19/+9
2021-03-05Revise prefix a bit, adding both `--test` (conditionally) and `[RUSTC-SHIM]` ↵Felix S. Klock II-3/+4
unconditionally. 1. I added `--test` based on review feedback from simulacrum: I decided I would rather include such extra context than get confused later on by its absence. (However, I chose to encode it differently than how `[RUSTC-TIMING]` does... I don't have much basis for doing so, other than `--test` to me more directly reflects what it came from.) 2. I also decided to include `[RUSTC-SHIM]` at start of all of these lines driven by the verbosity level, to make to clear where these lines of text originate from. (Basically, I skimmed over the output and realized that a casual observer might not be able to tell where this huge set of new lines were coming from.)
2021-03-05Add more windows specific numbersRyan Levick-28/+42
2021-03-04Make rustc shim's verbose output include crate_name being compiled.Felix S. Klock II-5/+10
This change is mainly motivated by an issue with the environment printing I added in PR 82403: multiple rustc invocations progress in parallel, and the environment output, spanning multiple lines, gets interleaved in ways make it difficult to extra the enviroment settings. (This aforementioned difficulty is more of a hiccup than an outright show-stopper, because the environment variables tend to be the same for all of the rustc invocations, so it doesn't matter too much if one mixes up which lines one is looking at. But still: Better to fix it.)
2021-03-04Attempt to gather similar stats as rusage on WindowsRyan Levick-5/+67
2021-03-01Rollup merge of #82532 - pnkfelix:rustbuild-print-step-rusage, r=Mark-SimulacrumYuki Okushi-3/+79
Add `build.print_step_rusage` to config.toml Adds `build.print_step_rusage` to config.toml, which is meant to be an easy way to let compiler developers get feedback on the terminal during bootstrap about resource usage during each step. The output is piggy-backed on `[PRINT-STEP-TIMINGS]`, mostly because the functionality seemed to naturally fit there in the overall control-flow and output structure (even if very little is shared between the implementations themselves). Some sample output (from my Linux box, where I believe the `max rss` output to be somewhat trust-worthy...): ``` [...] Compiling regex v1.4.3 [RUSTC-TIMING] tempfile test:false 0.323 user: 1.418662 sys: 0.81767 max rss (kb): 182084 page reclaims: 26615 page faults: 0 fs block inputs: 0 fs block outputs: 2160 voluntary ctxt switches: 798 involuntary ctxt switches: 131 Completed tempfile v3.1.0 in 0.3s [RUSTC-TIMING] chalk_ir test:false 1.890 user: 1.893603 sys: 0.99663 max rss (kb): 239432 page reclaims: 32107 page faults: 0 fs block inputs: 0 fs block outputs: 25008 voluntary ctxt switches: 108 involuntary ctxt switches: 183 Completed chalk-ir v0.55.0 in 1.9s Compiling rustc_data_structures v0.0.0 (/home/pnkfelix/Dev/Rust/rust.git/compiler/rustc_data_structures) [RUSTC-TIMING] chrono test:false 1.244 user: 3.333198 sys: 0.134963 max rss (kb): 246612 page reclaims: 44857 page faults: 0 fs block inputs: 0 fs block outputs: 11704 voluntary ctxt switches: 1043 involuntary ctxt switches: 326 Completed chrono v0.4.15 in 1.3s [RUSTC-TIMING] rustc_rayon test:false 1.332 user: 1.763912 sys: 0.75996 max rss (kb): 239076 page reclaims: 35285 page faults: 0 fs block inputs: 0 fs block outputs: 19576 voluntary ctxt switches: 359 involuntary ctxt switches: 168 Completed rustc-rayon v0.3.0 in 1.3s Compiling matchers v0.0.1 [RUSTC-TIMING] matchers test:false 0.100 user: 0.94495 sys: 0.15119 max rss (kb): 140076 page reclaims: 8200 page faults: 0 fs block inputs: 0 fs block outputs: 392 voluntary ctxt switches: 43 involuntary ctxt switches: 12 Completed matchers v0.0.1 in 0.1s [...] ```
2021-02-25Implementation of build.print_step_rusage.Felix S. Klock II-3/+79
On non-unix platforms, does not try to call `getrusage` (and does not attempt to implement its own shim; that could be follow-on work, though its probably best to not invest too much effort there, versus using separate dedicated tooling). On unix platforms, calls libc::rusage and attempts to emit the subset of fields that are supported on Linux and Mac OS X. Omits groups of related stats which appear to be unsupported on the platform (due to them all remaining zero). Adjusts output to compensate for Mac using bytes instead of kb (a well known discrepancy on Mac OS X). However, so far I observe a lot of strange values (orders of magnitude wrong) reported on Mac OS X in some cases, so I would not trust this in that context currently.
2021-02-22Print out env vars related to Rust on (sufficiently verbose) rustc invocations.Felix S. Klock II-0/+6
Fix issue 38686. (update: placated tidy.)
2021-02-17make suggest setup help messages betterHenry Boisdequin-3/+9
2020-10-11Mostly print statements to see where things areWinnie Xiao-4/+4
More print statementsstatements lol Solved the basic case of eliminating check_version ifk_version if subcommand = setup Finished v1 checking out old bootstrap.py checked out old irrelevant files fixed tidy Moved VERSION from bin/main.rs to lib.rs Fixed semicolon return issue x.py fmt