about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2023-09-06fix log formatting in bootstrapGoldstein-3/+3
2023-09-05Auto merge of #114843 - Zalathar:test-coverage-map, r=oli-obkbors-1/+18
coverage: Explicitly test the coverage maps produced by codegen/LLVM Our existing coverage tests verify the output of end-to-end coverage reports, but we don't have any way to test the specific mapping information (code regions and their associated counters) that are emitted by `rustc_codegen_llvm` and LLVM. That makes it harder to to be confident in changes that would modify those mappings (whether deliberately or accidentally). This PR addresses that by adding a new `coverage-map` test suite that does the following: - Compiles test files to LLVM IR assembly (`.ll`) - Feeds those IR files to a custom tool (`src/tools/coverage-dump`) that extracts and decodes coverage mappings, and prints them in a more human-readable format - Checks the output of that tool against known-good snapshots --- I recommend excluding the last commit while reviewing the main changes, because that last commit is just ~40 test files copied over from `tests/run-coverage`, plus their blessed coverage-map snapshots and a readme file. Those snapshots aren't really intended to be checked by hand; they're mostly there to increase the chances that an unintended change to coverage maps will be observable (even if it requires relatively specific circumstances to manifest).
2023-09-05Auto merge of #115544 - onur-ozkan:patch-binaries-for-nix-configure, ↵bors-0/+1
r=albertlarsan68 support `{disable,enable}-patch-binaries-for-nix` in configure.py Provide the control of `patch-binaries-for-nix` flag from configure.py without requiring manual editing. It's useful when: https://github.com/rust-lang/rust/blob/bf1e3f31f95c0f75b9bf51a58e8684f750f919f2/src/bootstrap/bootstrap.py#L661-L667
2023-09-05support `{disable,enable}-patch-binaries-for-nix` in configure.pyonur-ozkan-0/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-09-05Add test suite `coverage-map` to test coverage mappings emitted by LLVMZalathar-0/+15
We compile each test file to LLVM IR assembly, and then pass that IR to a dedicated program that can decode LLVM coverage maps and print them in a more human-readable format. We can then check that output against known-good snapshots. This test suite has some advantages over the existing `run-coverage` tests: - We can test coverage instrumentation without needing to run target binaries. - We can observe subtle improvements/regressions in the underlying coverage mappings that don't make a visible difference to coverage reports.
2023-09-05Add tool `src/tools/coverage-dump` for use by some new coverage testsZalathar-1/+3
2023-09-03Auto merge of #115448 - onur-ozkan:optimize-bootstrap-dep-tree, r=albertlarsan68bors-40/+8
optimize bootstrap dep tree bumped `pretty_assertations` in favor of removing duplicated `syn`, and bumped `hermit-abi` from the yanked version.
2023-09-02Auto merge of #115471 - RalfJung:skipping-sanity, r=onur-ozkanbors-10/+13
also skip musl checks when BOOTSTRAP_SKIP_TARGET_SANITY is set Currently I cannot test musl targets in Miri via x.py; this PR fixes that.
2023-09-02also skip musl checks when BOOTSTRAP_SKIP_TARGET_SANITY is setRalf Jung-10/+13
2023-09-01bump hermit-abi from yanked version(0.3.1) to 0.3.2onur-ozkan-3/+3
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-09-01bump pretty_assertions to 1.4onur-ozkan-37/+5
Removes the duplicated dependency(syn 1.0.102) from bootstrap dependency tree Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-09-01bootstrap/format: remove unnecessary paths.pushRalf Jung-4/+0
2023-08-31bootstrap: use git merge-base for LLVM CI download logicRalf Jung-1/+8
2023-08-31Auto merge of #115323 - onur-ozkan:curl-download-checksum-fix, r=Mark-Simulacrumbors-12/+11
avoid stdout redirection on `curl` executions Avoid redirecting the curl output directly to the stdout. This alteration affects the integrity of the file during the retry process, as it also redirects the logs from the retries. Consequently, this leads to the bootstrap process failing because of an invalid checksum. For more information, see the [zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/checksum.20errors) Fixes #115275
2023-08-28avoid stdout redirection on `curl` executionsonur-ozkan-12/+11
Avoid redirecting the curl output directly to the stdout. This alteration affects the integrity of the file during the retry process, as it also redirects the logs from the retries. Consequently, this leads to the bootstrap process failing because of an invalid checksum. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-08-27Rollup merge of #115261 - onur-ozkan:replace-old-username, r=Mark-SimulacrumGuillaume Gomez-1/+1
replace outdated github username 'ozkanonur'
2023-08-27Rollup merge of #115111 - ozkanonur:check-rust-analyzer-if-enabled, ↵Matthias Krüger-2/+9
r=Mark-Simulacrum compile rust-anaylzer with `x check` if it's enabled By default, `x check` doesn't compile the rust-analyzer. But when it's enabled in the config's tools section, there's no reason not to do it. This change allows `x check` to compile rust-analyzer if it's enabled in config's tools section. Helps to #115031
2023-08-27replace outdated github username 'ozkanonur'ozkanonur-1/+1
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-08-24Rollup merge of #115117 - pnkfelix:detect-and-report-nix-shell, r=albertlarsan68Weihang Lo-9/+31
Detect and report nix shell Better diagnostics for people using nix subshell on non-NixOS. 1. Turned patch-binaries-for-nix from a boolean into a ternary flag: true, false, and unset. 2. When patch-binaries-for-nix is unset, we continue with the existing NixOS detection heuristic (look for nixos in /etc/os-release, if present), but if we are not atop NixOS, then issue a note if we see the IN_NIX_SHELL environment variable telling the user to consider setting patch-binaries-for-nix explicitly. Fix #115073
2023-08-23Accommodate tidy.Felix S. Klock II-11/+9
In addition: Incorporated some review feedback (namely, removed a useless initial assignment to True that was never read), and unified code a bit more between bootstrap.py and download.rs (by using the same variable name for the same concept).
2023-08-23Rollup merge of #115109 - cuviper:yaml-404, r=albertlarsan68Guillaume Gomez-0/+5
Skip ExpandYamlAnchors when the config is missing The dist-src tarball does not include `.github/` at all, so we can't check whether it needs to be regenerated.
2023-08-23Rollup merge of #115103 - djkoloski:disable_bootstrap_version_check, ↵Guillaume Gomez-1/+2
r=compiler-errors Disable bootstrap rustc version check Mitigates #115065
2023-08-22Better diagnostics for people using nix subshell on non-NixOS.Felix S. Klock II-8/+32
1. Turned patch-binaries-for-nix from a boolean into a ternary flag: true, false, and unset. 2. When patch-binaries-for-nix is unset, we continue with the existing NixOS detection heuristic (look for nixos in /etc/os-release, if present), but if we are not atop NixOS, then issue a note if we see the IN_NIX_SHELL environment variable telling the user to consider setting patch-binaries-for-nix explicitly.
2023-08-22drive-by fix to Python doc comment.Felix S. Klock II-1/+1
2023-08-22compile rust-anaylzer with `x check` if it's enabledozkanonur-2/+9
By default, `x check` doesn't compile the rust-analyzer. But when it's enabled in the config's tools section, there's no reason not to do it. This change allows `x check` to compile rust-analyzer if it's enabled in config's tools section. Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-08-22Skip ExpandYamlAnchors when the config is missingJosh Stone-0/+5
The dist-src tarball does not include `.github/` at all, so we can't check whether it needs to be regenerated.
2023-08-22Rollup merge of #115090 - eopb:dont-check-lib-bootstrap, r=ozkanonurMichael Goulet-8/+3
Always use `os-release` rather than `/lib` to detect `NixOS` (bootstrap) [Two users over on zulip](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Bootstrapping.20on.20NixOS) bumped into issues where NixOS wasn't being properly detected. I believe this was caused by the presence of `/lib` on their machines. `/lib` is not standard on NixOS but can still be created by users or scripts. We are already checking `/etc/os-release`. The presence of `ID=nixos` in it's output should be trustworthy and we shouldn't then go on to also check for `/lib`.
2023-08-22Rollup merge of #115011 - compiler-errors:warn-on-elided-assoc-ct-lt, r=cjgillotMichael Goulet-1/+1
Warn on elided lifetimes in associated constants (`ELIDED_LIFETIMES_IN_ASSOCIATED_CONSTANT`) Elided lifetimes in associated constants (in impls) erroneously resolve to fresh lifetime parameters on the impl since #97313. This is not correct behavior (see #38831). I originally opened #114716 to fix this, but given the time that has passed, the crater results seem pretty bad: https://github.com/rust-lang/rust/pull/114716#issuecomment-1682091952 This PR alternatively implements a lint against this behavior, and I'm hoping to bump this to deny in a few versions.
2023-08-22Disable bootstrap rustc version checkDavid Koloski-1/+2
Mitigates #115065
2023-08-22bootstrap: builder: don't add origin paths on xousSean Cross-1/+4
Don't add the origin rpath when calling the linker. This is unnecessary on Xous since there is no dynamic linker, and Xous can use an ordinary bare-metal linker with no rpath options. As part of this patch, the logic was inverted so that the "else" clause contains everything except "windows" and "xous". Signed-off-by: Sean Cross <sean@xobs.io>
2023-08-22Always use `os-release` rather than `/lib` to detect `NixOS`Ethan Brierley-8/+3
[Two users over on zulip](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Bootstrapping.20on.20NixOS) bumped into issues where NixOS wasn't being properly detected. I believe this was caused by the presence of `/lib` on their machines. `/lib` is not standard on NixOS but can still be created by users or scripts. We are already checking `/etc/os-release`. The presence of `ID=nixos` in it's output should be trustworthy and we shouldn't then go on to also check for `/lib`.
2023-08-22bootstrap/miri: respect config_locked_depsRalf Jung-0/+7
2023-08-21Fix elided lifetimes in rust-lang/rustMichael Goulet-1/+1
2023-08-14Upgrade Object and related depsdirreke-5/+4
2023-08-14Update llvm.rsDirreck-18/+3
2023-08-14add details for csky-unknown-linux-gnuabiv2 and add docsDirreke-0/+16
2023-08-14add a csky-unknown-linux-gnuabiv2 targetDirreke-2/+3
2023-08-13Auto merge of #114786 - GuillaumeGomez:rollup-0cos5gn, r=GuillaumeGomezbors-6/+28
Rollup of 5 pull requests Successful merges: - #94667 (Add `Iterator::map_windows`) - #114069 (Allow using external builds of the compiler-rt profile lib) - #114354 (coverage: Store BCB counter info externally, not directly in the BCB graph) - #114625 (CI: use smaller machines in PR runs) - #114777 (Migrate GUI colors test to original CSS color format) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-13Rollup merge of #114069 - cuviper:profiler-path, r=Mark-SimulacrumGuillaume Gomez-6/+28
Allow using external builds of the compiler-rt profile lib This changes the bootstrap config `target.*.profiler` from a plain bool to also allow a string, which will be used as a path to the pre-built profiling runtime for that target. Then `profiler_builtins/build.rs` reads that in a `LLVM_PROFILER_RT_LIB` environment variable.
2023-08-13Auto merge of #114480 - ozkanonur:fix-stage0-compiler-llvm, r=Mark-Simulacrumbors-0/+10
copy the correct version of LLVM into the stage0 sysroot In some cases(see https://github.com/rust-lang/rust/issues/109314), when the stage0 compiler relies on more recent version of LLVM than the beta compiler, it may not be able to locate the correct LLVM in the sysroot. This situation typically occurs when we upgrade LLVM version while the beta compiler continues to use an older version. Fixes #109314
2023-08-10Auto merge of #114697 - matthiaskrgr:rollup-ywooy8x, r=matthiaskrgrbors-3/+17
Rollup of 5 pull requests Successful merges: - #114278 (better error handling for `rust.codegen-backends` on deserialization) - #114674 (Add clubby789 to `users_on_vacation`) - #114678 (`Expr::can_have_side_effects()` is incorrect for struct/enum/array/tuple literals) - #114681 (doc (unstable-book): fix a typo) - #114684 (Remove redundant calls to `resolve_vars_with_obligations`) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-10Rollup merge of #114278 - ozkanonur:validate-codegen-backend-config, r=clubby789Matthias Krüger-3/+17
better error handling for `rust.codegen-backends` on deserialization Fixes #109315
2023-08-10Auto merge of #112482 - tgross35:ci-non-rust-linters, r=pietroalbinibors-6/+39
Add support for tidy linting via external tools for non-rust files This change adds the flag `--check-extras` to `tidy`. It accepts a comma separated list of any of the options: * py (test everything applicable for python files) * py:lint (lint python files using `ruff`) * py:fmt (check formatting for python files using `black`) * shell or shell:lint (lint shell files using `shellcheck`) Specific files to check can also be specified via positional args. Examples: * `./x test tidy --check-extras=shell,py` * `./x test tidy --check-extras=py:fmt -- src/bootstrap/bootstrap.py` * `./x test tidy --check-extras=shell -- src/ci/*.sh` * Python formatting can be applied with bless: `./x test tidy --ckeck-extras=py:fmt --bless` `ruff` and `black` need to be installed via pip; this tool manages these within a virtual environment at `build/venv`. `shellcheck` needs to be installed on the system already. --- This PR doesn't fix any of the errors that show up (I will likely go through those at some point) and it doesn't enforce anything new in CI. Relevant zulip discussion: https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/Other.20linters.20in.20CI
2023-08-10Auto merge of #114001 - meysam81:issue-111894-fix, r=clubby789bors-18/+19
fix(bootstrap): rename exclude flag to skip 🐛 fixes #111894
2023-08-08Rollup merge of #114613 - ferrocene:pa-fix-rebuild, r=lqdMatthias Krüger-21/+36
Prevent constant rebuilds of `rustc-main` (and thus everything else) PR #114305 changed bootstrap to run `strip -g` on `librustc_driver.so` and `libllvm.so` on Linux when no debuginfo was requested. Unfortunately, that PR resulted in bootstrap always rebuilding everything starting from stage 1 `rustc-main` (including stage 1 libraries and tests) when invoking bootstrap multiple times. We noticed this because Ferrocene's CI times increased to between 2x and 3x total execution time, but the regression can also be reproduced locally by running `./x build library/sysroot --stage 1` twice. The explanation of the problem is in the code comments. r? ```@lqd``` cc ```@ozkanonur```
2023-08-08Rollup merge of #113480 - Sword-Destiny:master, r=petrochenkovMatthias Krüger-1/+1
add aarch64-unknown-teeos target TEEOS is a mini os run in TrustZone, for trusted/security apps. The libc of TEEOS is a part of musl. The kernel of TEEOS is micro kernel. This MR is to add a target for teeos. MRs for libc and rust-std are in progress. Compiler team MCP: [MCP](https://github.com/rust-lang/compiler-team/issues/652)
2023-08-08prevent constant rebuilds of rustc-main (and thus everything else)Pietro Albini-21/+36
2023-08-07Adjust path to crtbegin.c / crtend.cNikita Popov-2/+2
These were moved into builtins by https://reviews.llvm.org/D153989.
2023-08-07add the correct version of LLVM into the stage0 sysrootozkanonur-0/+10
In some cases(see https://github.com/rust-lang/rust/issues/109314), when the stage0 compiler relies on more recent version of LLVM than the beta compiler, it may not be able to locate the correct LLVM in the sysroot. This situation typically occurs when we upgrade LLVM version while the beta compiler continues to use an older version. Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-08-07Auto merge of #112916 - tgross35:patch-1, r=Mark-Simulacrumbors-2/+9
Add more context to `quit_if_file_exists` in `configure.py` & delete config.toml in CI If the `obj` directory isn't empty, the error message is subtle and not very helpful: ``` == clock drift check == local time: Sun Jul 2 00:57:06 UTC 2023 network time: Sun, 02 Jul 2023 00:57:06 GMT == end clock drift check == sccache: Starting the server... configure: error: Existing 'config.toml' detected. == clock drift check == local time: Sun Jul 2 00:57:06 UTC 2023 network time: Sun, 02 Jul 2023 00:57:06 GMT == end clock drift check == ``` This makes it stand out and suggests how to resolve the issue: ``` == clock drift check == local time: Sun Jul 2 02:11:30 UTC 2023 network time: Sun, 02 Jul 2023 02:11:31 GMT == end clock drift check == sccache: Starting the server... configure: ERROR: Existing 'config.toml' detected. Exiting Is objdir '/home/tmgross/projects/rust/obj' clean? == clock drift check == local time: Sun Jul 2 02:11:31 UTC 2023 network time: Sun, 02 Jul 2023 02:11:31 GMT == end clock drift check == ```