about summary refs log tree commit diff
path: root/src/tools/compiletest
AgeCommit message (Collapse)AuthorLines
2024-09-29add has_enzyme/needs-enzyme to the test infraManuel Drehwald-0/+15
2024-09-29Auto merge of #129687 - Urgau:rfc3127-sysroot-2, r=jieyouxubors-4/+15
Implement RFC3137 trim-paths sysroot changes - take 2 This PR is a continuation of https://github.com/rust-lang/rust/pull/118149. Nothing really changed, except for https://github.com/rust-lang/rust/pull/129408 which I was able to trigger locally. Original description: > Implement parts of #111540 > > Right now, backtraces into sysroot always shows /rustc/$hash in diagnostics, e.g. > > ``` > thread 'main' panicked at 'hello world', map-panic.rs:2:50 > stack backtrace: > 0: std::panicking::begin_panic > at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:616:12 > 1: map_panic::main::{{closure}} > at ./map-panic.rs:2:50 > 2: core::option::Option<T>::map > at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/option.rs:929:29 > 3: map_panic::main > at ./map-panic.rs:2:30 > 4: core::ops::function::FnOnce::call_once > at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:248:5 > note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. > ``` > > [RFC 3127 said](https://rust-lang.github.io/rfcs/3127-trim-paths.html#changing-handling-of-sysroot-path-in-rustc) > > > We want to change this behaviour such that, when rust-src source files can be discovered, the virtual path is discarded and therefore the local path will be embedded, unless there is a --remap-path-prefix that causes this local path to be remapped in the usual way. > > This PR implements this behaviour. When `rust-src` is present at compile time, rustc replaces /rustc/$hash with a real path into local rust-src with best effort. To sanitise this, users must explicitly supply `--remap-path-prefix=<path to rust-src>=foo`. cc `@cbeuw` Fix #105907 Fix #85463 try-job: dist-x86_64-linux try-job: x86_64-msvc try-job: dist-x86_64-msvc try-job: armhf-gnu
2024-09-28compiletest: normalize to `$SRC_DIR_REAL` before `$TEST_BUILD_DIR`Urgau-6/+6
in case the real paths into the libstd/libcore are located inside the the build directory, maybe because it's coming from an extracted dist component in the build dir (cc opt-dist)
2024-09-28compiletest: rename "runtest/crash.rs" to "runtest/crashes.rs" to be in line ↵Matthias Krüger-1/+1
with the test directory r? jieyouxu
2024-09-27compiletest: fallback to the original path if it's not a symlinkUrgau-11/+6
2024-09-27Implement RFC3137 trim-paths sysroot changesUrgau-3/+19
2024-09-27bump few depsklensy-1/+1
cargo_metadata, thorin-dwp, windows
2024-09-24Mention `COMPILETEST_VERBOSE_CRASHES` on crash test failure许杰友 Jieyou Xu (Joe)-4/+5
2024-09-23Rollup merge of #129545 - notriddle:notriddle/toolbar-v2, r=GuillaumeGomezMichael Goulet-1/+1
rustdoc: redesign toolbar and disclosure widgets Fixes #77899 Fixes #90310 ## Preview | before | after | ------ | ----- | ![image](https://github.com/user-attachments/assets/ebeec185-3a72-481d-921e-a9a885f348d9) | ![image](https://github.com/user-attachments/assets/08735a65-99d1-4523-ab77-ddb164c0a5db) | ![image](https://github.com/user-attachments/assets/ae8e0f24-49cb-445d-b9bd-cec9c57b94e7) | ![image](https://github.com/user-attachments/assets/ba484f94-b031-41fc-b8a8-6cd81be8fb6b) | ![image](https://github.com/user-attachments/assets/8c2cc041-a138-4950-a12e-3d529c8a5339) | ![image](https://github.com/user-attachments/assets/e7f010bd-19e2-4711-85bf-3fd00c3e5647) | ![image](https://github.com/user-attachments/assets/e2b63785-971c-489e-b069-eb85f6a30620) | ![image](https://github.com/user-attachments/assets/b65eea16-d6a3-4aa3-8a27-6ded74009010) | ![image](https://github.com/user-attachments/assets/1c7b0901-a61a-4325-9d01-9d8b14b476aa) | ![image](https://github.com/user-attachments/assets/d4a485db-d9f1-4a62-94bc-a3d125ea6dc1) | N/A | ![image](https://github.com/user-attachments/assets/7add0a2a-7fd7-483d-87ee-51ee45a2fe5d) | ![image](https://github.com/user-attachments/assets/334f50bc-9f8d-42d9-a7df-95058f7cdfd5) | ![image](https://github.com/user-attachments/assets/451fcc22-b034-453c-ae4b-b948fd6bd779) | ![image](https://github.com/user-attachments/assets/132f720c-802a-466d-bd55-c7a4750acdc3) | ![image](https://github.com/user-attachments/assets/177b7921-06c5-467d-87d3-9cdf88c4e50b) https://notriddle.com/rustdoc-html-demo-12/toolbar-v2/std/index.html ## Description This adds labels to the icons and moves them away from the search box. These changes are made together, because they work together, but are based on several complaints: * The [+/-] thing are a Reddit-ism. They don't look like buttons, but look like syntax <https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/More.20visual.20difference.20for.20the.20.2B.2F-.20.20Icons>, <https://github.com/rust-lang/rust/issues/59851> (some of these are laundry lists with more suggestions, but they all mention [+/-] looking wrong) * The settings, help, and summary buttons are also too hard to recognize <https://lwn.net/Articles/987070/>, <https://github.com/rust-lang/rust/issues/90310>, <https://github.com/rust-lang/rust/issues/14475#issuecomment-274241997>, <https://internals.rust-lang.org/t/improve-rustdoc-design/12758> ("Not all functionality is self-explanatory, for example the [+] button in the top right corner, the theme picker or the settings button.") The toggle-all and toggle-individual buttons both need done at once, since we want them to look like they go together. This changes them from both being [+/-] to both being arrows. CC <https://github.com/rust-lang/rust/pull/113074#issuecomment-1677469680> and ``@jsha`` regarding the use of triangles for disclosure, which is what everyone wanted, but was pending a good toggle-all button. This PR adds a toggle-all button that should work. Settings and Help are also migrated, so that the whole group can benefit from being described using actual words. The breadcrumbs also get redesigned, so that they use less space, by shrinking the parent module path parts. This is done at the same time as the toolbar redesign because it's, effectively, moving space from the toolbar to the breadcrumbs. This is aimed at avoiding any line wrapping at desktop sizes. ## Prior art This style of toolbar, with explicit labels on the buttons, used to be more popular. It's not very common in web browsers nowadays, and for truly universal icons like :arrow_left: I can understand why, but words are great when icons fail. ![image](https://github.com/user-attachments/assets/9a4a0498-232d-4d60-87b9-f601f4515254)
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-30/+29
2024-09-20Pass the current cargo to `run-make` testsJosh Stone-0/+14
A couple tests were using `BOOTSTRAP_CARGO` with `-Zbuild-std`, but that stage0 cargo might not always be in sync with in-tree changes. In particular, those tests started failing on the beta branch because the older cargo couldn't find the library `Cargo.lock`, and then couldn't build the latest version of `compiler_builtins` that had nightly changes.
2024-09-20Rollup merge of #130566 - jieyouxu:breakup-runtest, r=compiler-errorsGuillaume Gomez-2041/+2156
Break up compiletest `runtest.rs` into smaller helper modules Previously compiletest's `runtest.rs` was a massive 4700 lines file that made reading and navigation very awkward. This PR breaks the `runtest.rs` file up into smaller helper modules, one for each test suite/mode. > [!NOTE] > This PR should not contain functional changes, it is intended to be mostly code motion to breakup `runtest.rs` into smaller helper modules to make it easier to digest. > > This PR intentionally does not neatly reorganize where all the methods on `TestCx` goes, that is intended for a follow-up PR. Some methods on `TestCx` do not need to be on `TestCx`. It also does not address a weirdness in valgrind, that is intended for a follow-up PR as well. Part of a series of compiletest cleanups #130565. Fixes #89475. r? `@ghost` (I need to do a self-review pass first)
2024-09-19Fix compiletest doc comments许杰友 Jieyou Xu (Joe)-6/+6
2024-09-19Break up compiletest runtest.rs into smaller helper modules许杰友 Jieyou Xu (Joe)-2041/+2156
Previously compiletest's `runtest.rs` was a massive 4700 lines file that made reading and navigation very awkward. This commit intentionally does not neatly reorganize where all the methods on `TestCx` goes, that is intended for a follow-up PR.
2024-09-12Re-run coverage tests if `coverage-dump` was modifiedZalathar-0/+6
2024-09-11Rollup merge of #130161 - onur-ozkan:fmt-changed-files, r=Kobzol,RalfJungMatthias Krüger-2/+15
refactor merge base logic and fix `x fmt` When remote upstream is not configured, using [get_git_modified_files](https://github.com/rust-lang/rust/blob/38e3a5771cefc9362976a605549f8b04d5707311/src/tools/build_helper/src/git.rs#L114) to find modified files fails because [get_rust_lang_rust_remote](https://github.com/rust-lang/rust/blob/38e3a5771cefc9362976a605549f8b04d5707311/src/tools/build_helper/src/git.rs#L46-L48) can not resolve "rust-lang/rust" from the git output. The changes in this PR makes bootstrap to find the latest bors commit, treating it as the "closest upstream commit" so that the change tracker logic can use it to find the diffs. In addition, [skips formatting](https://github.com/rust-lang/rust/commit/e3924544832668a6e239153a90d3be2077fbdce4) if there are no modified files. Fixes #130147
2024-09-11document the new git logic in more detailonur-ozkan-1/+6
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-10rustdoc: redesign toolbar and disclosure widgetsMichael Howell-1/+1
This adds labels to the icons and moves them away from the search box. These changes are made together, because they work together, but are based on several complaints: * The [+/-] thing are a Reddit-ism. They don't look like buttons, but look like syntax <https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/More.20visual.20difference.20for.20the.20.2B.2F-.20.20Icons>, <https://github.com/rust-lang/rust/issues/59851> (some of these are laundry lists with more suggestions, but they all mention [+/-] looking wrong) * The settings, help, and summary buttons are also too hard to recognize <https://lwn.net/Articles/987070/>, <https://github.com/rust-lang/rust/issues/90310>, <https://github.com/rust-lang/rust/issues/14475#issuecomment-274241997>, <https://internals.rust-lang.org/t/improve-rustdoc-design/12758> ("Not all functionality is self-explanatory, for example the [+] button in the top right corner, the theme picker or the settings button.") The toggle-all and toggle-individual buttons both need done at once, since we want them to look like they go together. This changes them from both being [+/-] to both being arrows. Settings and Help are also migrated, so that the whole group can benefit from being described using actual words. Additionally, the Help button is only shown on SERPs, not all the time. This is done for two major reasons: * Most of what's in there is search-related. The things that aren't are keyboard commands, and the search box tells you about that anyway. Pressing <kbd>?</kbd> will temporarily show the button and its popover. * I'm trading it off by showing the help button, even on mobile. It's useful since you can use the search engine suggestions there. * The three buttons were causing line wrapping on too many desktop layouts.
2024-09-10handle `GitConfig` for `tools/compiletest`onur-ozkan-2/+10
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-09Print a helpful message if any tests were skipped for being up-to-dateZalathar-0/+1
2024-09-09Add an explicit ignore message for "up-to-date" testsZalathar-2/+5
When running tests without the `--force-rerun` flag, compiletest will automatically skip any tests that (in its judgement) don't need to be run again since the last time they were run. This patch adds an explicit reason to those skipped tests, which is visible when running with `rust.verbose-tests = true` in `config.toml`.
2024-09-05Rollup merge of #101339 - the8472:ci-randomize-debug, r=Mark-SimulacrumMatthias Krüger-0/+15
enable -Zrandomize-layout in debug CI builds This builds rustc/libs/tools with `-Zrandomize-layout` on *-debug CI runners. Only a handful of tests and asserts break with that enabled, which is promising. One test was fixable, the rest is dealt with by disabling them through new cargo features or compiletest directives. The config.toml flag `rust.randomize-layout` defaults to false, so it has to be explicitly enabled for now.
2024-08-31Add rust.randomize-layout config to build artifacts with -Zrandomize-layoutThe 8472-0/+15
Additionally teach compiletest to ignore tests that rely on deterministic layout. Tests themselves aren't built with randomization but they can still observe slight changes in std or rustc
2024-08-30add borrows to NLL MIR dumpsRémy Rakic-0/+1
explicitly disable `-Zmir-include-spans` in mir-opt tests This will override the NLL default of true, and keep the blessed dumps easier to work with.
2024-08-25strip whitespace for ignored tests reason commentsRémy Rakic-1/+1
2024-08-25compiletest: implement `needs-lvm-zstd` directiveRémy Rakic-1/+111
2024-08-22Revert "compiletest: use `std::fs::remove_dir_all` now that it is available"许杰友 Jieyou Xu (Joe)-2/+25
This reverts commit 75ed08972703798888fceff12b3217408ca6a4b5.
2024-08-20compiletest: use `std::fs::remove_dir_all` now that it is available许杰友 Jieyou Xu (Joe)-25/+2
2024-08-19Auto merge of #129218 - saethlin:gdb-supports-rust-now, r=jieyouxubors-69/+19
Delete debuginfo test suite infra for gdb without Rust support and lldb with Rust support Implements https://github.com/rust-lang/rust/issues/128953 I also deleted all the `min-lldb-version: 310` comments, because the oldest compatible distro I can find is Ubuntu 16.04 which ships lldb 3.8, though of course the package that the Ubuntu maintainers put together for that is broken. Rocky Linux 8 amusingly ships lldb 17, even though it has a similar glibc and kernel version. This PR is multiple highly mechanical changes. Some of the commits were created by just running `sed`. You may find it easier to review each commit separately.
2024-08-18Auto merge of #125854 - beetrees:zst-arg-abi, r=estebankbors-0/+5
Move ZST ABI handling to `rustc_target` Currently, target specific handling of ZST function call ABI (specifically passing them indirectly instead of ignoring them) is handled in `rustc_ty_utils`, whereas all other target specific function call ABI handling is located in `rustc_target`. This PR moves the ZST handling to `rustc_target` so that all the target-specific function call ABI handling is in one place. In the process of doing so, this PR fixes #125850 by ensuring that ZST arguments are always correctly ignored in the x86-64 `"sysv64"` ABI; any code which would be affected by this fix would have ICEd before this PR. Tests are also added using `#[rustc_abi(debug)]` to ensure this behaviour does not regress. Fixes #125850
2024-08-18Clean up compiletestBen Kimock-59/+19
2024-08-18Delete compiletest support for gdbgBen Kimock-11/+1
2024-08-13Rollup merge of #129049 - Zalathar:json-like, r=jieyouxuMatthias Krüger-6/+4
compiletest: Don't panic on unknown JSON-like output lines The `json::extract_rendered` function is called for both compiler output and non-compiler output, so it's inappropriate to panic just because a line starting with `{` didn't contain a compiler output message. It is called from two places: when checking the output of a `ui` test process, and when printing the output of an arbitrary non-passing `ProcRes`. So unfortunately there's currently no easy way to know for sure whether it is seeing compiler output or not. Fortunately, neither call site appears to be relying on this panic; it's just an overzealous internal check. Fixes #126373.
2024-08-13Remove a confusing commentZalathar-1/+0
The JSON messages parsed by this file are from the _compiler_, not from libtest.
2024-08-13Don't panic on unknown JSON-like output linesZalathar-5/+4
This function is called for both compiler and non-compiler output, so if the line isn't recognized as JSON from the compiler then just print it as-is.
2024-08-13Fix blessing of rmake testsZalathar-8/+7
2024-08-10Fix and enable disabled codegen-units testsBen Kimock-1/+7
2024-08-07Rollup merge of #128384 - dheaton-arm:mte-test, r=jieyouxuMatthias Krüger-0/+1
Add tests to ensure MTE tags are preserved across FFI boundaries Added run-make tests to verify that, between a Rust-C FFI boundary in both directions, any MTE tags included in a pointer are preserved for the following pointer types, as well as any information stored using TBI: - int - float - string - function try-job: aarch64-gnu
2024-08-07rewrite pgo-indirect-call-promotion to rmakeOneirical-0/+1
2024-08-03Rollup merge of #128161 - EtomicBomb:just-compiletest, r=notriddleMatthias Krüger-35/+74
nested aux-build in tests/rustdoc/ tests * Fixes bug that prevented using nested aux-build in `tests/rustdoc/` tests. Before, `fn document` and the auxiliary builder disagreed about where to find the nested aux-build source file (`auxiliary/auxiliary/aux.rs` vs `auxiliary/aux.rs`), preventing them from building. Picked the latter in line with other builders in compiletest. * Adds `//@ doc-flags` header, which forwards flags to rustdoc and not rustc. * Adds `//@ unique-doc-out-dir` header, which sets the --out-dir for the rustdoc invocation to a unique directory: `<root out dir>/docs/<test name>/doc` * Changes working directory of the rustdoc invocation to the root out directory (common among all aux-builds). Prior art: exec_compiled_test in runtest.rs * Adds tests that use nested aux builds and new headers These changes provide useful capabilities for writing rustdoc tests on their own. They are also needed to test the implementation for the [mergable-rustdoc-cross-crate-info](https://github.com/rust-lang/rfcs/pull/3662) RFC. try-job: x86_64-msvc
2024-08-02Move ZST ABI handling to `rustc_target`beetrees-0/+5
2024-08-01Auto merge of #127060 - Oneirical:testificate, r=jieyouxubors-0/+1
Migrate `symbol-visibility` `run-make` test to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Pretty scary! - The expected number of symbols on each check has been changed slightly to reflect the differences between `llvm_readobj` and `nm`, as I think the former will print hidden symbols once and visible symbols twice, while the latter will only print visible symbols. - The original test ran the same exact checks on `cdylib` twice, for seemingly no reason. I have removed it. - This may be possible to optimize some more? `llvm_readobj` could get called only once for each library type, and the regex could avoid being created repeatedly. I am not sure if these kinds of considerations are important for a `run-make` test. Demands a Windows try-job. try-job: x86_64-mingw
2024-07-31Remove redundant information and simplify `only` conditiondheaton-arm-0/+1
2024-07-31canonicalize path in another place to fix #128411EtomicBomb-1/+3
2024-07-30rewrite symbol-visibility to rmakeOneirical-0/+1
2024-07-30Auto merge of #124339 - oli-obk:supports_feature, r=wesleywiserbors-0/+1
allow overwriting the output of `rustc --version` Our wonderful bisection folk [have to work around](https://github.com/rust-lang/rust/issues/123276#issuecomment-2075001510) crates that do incomplete nightly/feature detection, as otherwise the bisection just points to where the feature detection breaks, and not to the actual breakage they are looking for. This is also annoying behaviour to nightly users who did not opt-in to those nightly features. Most nightly users want to be in control of the nightly breakage they get, by * choosing when to update rustc * choosing when to update dependencies * choosing which nightly features they are willing to take the breakage for The reason this breakage occurs is that the build script of some crates run `rustc --version`, and if the version looks like nightly or dev, it will enable nightly features. These nightly features may break in random ways whenever we change something in nightly, so every release of such a crate will only work with a small range of nightly releases. This causes bisection to fail whenever it tries an unsupported nightly, even though that crate is not related to the bisection at all, but is just an unrelated dependency. This PR (and the policy I want to establish with this FCP) is only for situations like the `version_check`'s `supports_feature` function. It is explicitly not for `autocfg` or similar feature-detection-by-building-rust-code, irrespective of my opinions on it and the similarity of nightly breakage that can occur with such schemes. These cause much less breakage, but should the breakage become an issue, they should get covered by this policy, too. This PR allows changing the version and release strings reported by `rustc --version` via the `RUSTC_OVERRIDE_VERSION_STRING` env var. The bisection issue is then fixed by https://github.com/rust-lang/cargo-bisect-rustc/pull/335. I mainly want to establish a compiler team policy: > We do not consider feature detection on nightly (on stable via compiler version numbering is fine) a valid use case that we need to support, and if it causes problems, we are at liberty to do what we deem best - either actively working to prevent it or to actively ignore it. We may try to work with responsive and cooperative authors, but are not obligated to. Should they subvert the workarounds that nightly users or cargo-bisect-rustc can use, we should be able to land rustc PRs that target the specific crates that cause issues for us and outright replace their build script's logic to disable nightly detection. I am not including links to crates, PRs or issues here, as I don't actually care about the specific use cases and don't want to make it trivial to go there and leave comments. This discussion is going to be interesting enough on its own, without branching out.
2024-07-30Test RUSTC_OVERRIDE_VERSION_STRINGOli Scherer-0/+1
2024-07-29Fix tidy call in runtest with custom HTML elementMichael Howell-0/+1
2024-07-29merge conflicts; fix rebase duplicating importsEtomicBomb-11/+0
2024-07-29file_stem and comment per notriddleEtomicBomb-8/+3