about summary refs log tree commit diff
path: root/src/tools/compiletest
AgeCommit message (Collapse)AuthorLines
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
2024-07-29ordering and wrapping cross-crate-info testsEtomicBomb-1/+1
2024-07-29initial implementation of rustdoc nested aux-buildEtomicBomb-34/+87
2024-07-29Reformat `use` declarations.Nicholas Nethercote-63/+59
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-25rewrite incr-foreign-head-span to rmakeOneirical-0/+1
2024-07-24Rollup merge of #128100 - GuillaumeGomez:run-make-path, r=Kobzol,jieyouxuMatthias Krüger-2/+25
Allow to pass a full path for `run-make` tests It's common (at least for me) to pass a full path to a `run-make` test (including the `rmake.rs` file) and to see that it isn't found, which is a bit frustrating. With these changes, we can now optionally pass the `rmake.rs` (or even `Makefile`) at the end of the path. cc ```@jieyouxu``` r? ```@Kobzol```
2024-07-23Allow to pass a full path for `run-make` testsGuillaume Gomez-2/+25
2024-07-23Rollup merge of #125886 - GuillaumeGomez:migrate-run-make-issue-15460, ↵Matthias Krüger-0/+2
r=jieyouxu Migrate run make issue 15460 Part of https://github.com/rust-lang/rust/issues/121876. r? `@jieyouxu` try-job: x86_64-msvc try-job: aarch64-apple try-job: x86_64-gnu-llvm-18
2024-07-23Rollup merge of #127962 - jieyouxu:cleanup-dll-compiletest, r=fmeaseMatthias Krüger-11/+7
Cleanup compiletest dylib name calculation Use `std::env::consts::{DLL_PREFIX, DLL_EXTENSION}` for dylib name calculation which is more accurate for the various different platforms, and is more likely to be looked at by target maintainers. cc ``@bzEq`` (as this impacts how compiletest handles AIX dll extensions)
2024-07-22Add new `MSVC_LIB_PATH` runtest environment variable to know location of the ↵Guillaume Gomez-0/+2
`msvc_lib` binary
2024-07-20Rollup merge of #127958 - jieyouxu:compiletest-rmake-cleanup, r=KobzolMatthias Krüger-92/+186
Cleanup rmake.rs setup in compiletest While debugging rmake.rs tests I realized that the rmake.rs setup itself in compiletest is very messy and confused. Now that I know some of the bootstrap steps and the rmake.rs tests themselves better, I realized there are cleanups that are possible: - Rework how `source_root` and `build_root` are calculated. They should now be less fragile then before. - Shuffle around path calculations to make them more logically grouped and closer to eventual use site(s). - Cleanup executable extension calculation with `std::env::consts::EXE_EXTENSION`. - Cleanup various dylib search path handling: renamed variables to better reflect their purpose, minimized mutability scope of said variables. - Prune useless env vars passed to both `rustc` and recipe binary commands. - Vastly improve the documentation for the setup of rmake.rs tests, including assumed bootstrap-provided build layouts, rmake.rs test layout, dylib search paths, intended purpose of passed env vars and the `COMPILETEST_FORCE_STAGE0=1 ./x test run-make --stage 0` stage0 sysroot special handling. This PR is best reviewed commit-by-commit. Fixes https://github.com/rust-lang/rust/issues/127920. r? bootstrap (or Kobzol, or Mark, or T-compiler) try-job: aarch64-apple try-job: armhf-gnu try-job: dist-x86_64-linux try-job: test-various try-job: x86_64-mingw try-job: x86_64-msvc try-job: x86_64-gnu-llvm-18
2024-07-20compiletest/rmake: simplify path calculations许杰友 Jieyou Xu (Joe)-36/+10
2024-07-20compiletest/rmake: avoid double test directory for rmake.rs tests许杰友 Jieyou Xu (Joe)-2/+8
This is important for other tests that have various things like modes, revisions and the like. These features are not supported in run-make tests, so we don't need the double layering.
2024-07-20compiletest/rmake: improve comments许杰友 Jieyou Xu (Joe)-30/+7
2024-07-20compiletest/rmake: prune unused `RUST_BUILD_STAGE` and explain env vars ↵许杰友 Jieyou Xu (Joe)-6/+20
passed to recipes
2024-07-19Update jsondocck directives to follow ui_test-styleLeón Orell Valerian Liehr-9/+22
2024-07-19compiletest/rmake: cleanup `stage_std_path` and `recipe_dylib_search_paths` ↵许杰友 Jieyou Xu (Joe)-9/+17
handling
2024-07-19compiletest/rmake: better explain why stage0 sysroot is needed if forced stage0许杰友 Jieyou Xu (Joe)-4/+21
2024-07-19compiletest/rmake: prune useless env vars and explain passed rustc options ↵许杰友 Jieyou Xu (Joe)-9/+8
and env vars
2024-07-19compiletest/rmake: rename `cmd` to `rustc`许杰友 Jieyou Xu (Joe)-5/+6
2024-07-19compiletest/rmake: cleanup rmake exe extension calculation许杰友 Jieyou Xu (Joe)-8/+9
2024-07-19compiletest/rmake: cleanup library search paths许杰友 Jieyou Xu (Joe)-4/+5
2024-07-19compiletest/rmake: cleanup dylib search paths related calculations许杰友 Jieyou Xu (Joe)-16/+24
2024-07-19compiletest/rmake: improve clarity of `support_lib_{path,deps,deps_deps}` ↵许杰友 Jieyou Xu (Joe)-21/+42
calculations
2024-07-19compiletest/rmake: move `stage_std_path` and `recipe_bin` closer to use site许杰友 Jieyou Xu (Joe)-15/+14
2024-07-19compiletest/rmake: improve `stage` explanation许杰友 Jieyou Xu (Joe)-4/+23
2024-07-19compiletest/rmake: make `{source,build}_root` path calculation more robust ↵许杰友 Jieyou Xu (Joe)-18/+47
for rmake.rs setup
2024-07-19compiletest/rmake: adjust docs for rmake.rs setup and add FIXMEs许杰友 Jieyou Xu (Joe)-7/+27
2024-07-19compiletest: cleanup dylib name calculation许杰友 Jieyou Xu (Joe)-11/+7
2024-07-19Revert format changeKai Luo-25/+5
2024-07-19AIX uses .a as dylib's suffixKai Luo-5/+27
2024-07-11compiletest: Better error message for bad `normalize-*` headersZalathar-6/+12
2024-07-11Require a colon in `//@ normalize-*:` headersZalathar-17/+7
2024-06-28rewrite used-cdylib-macos to rmakeOneirical-0/+2
2024-06-24Rollup merge of #126413 - matthiaskrgr:crshmsg, r=oli-obkMichael Goulet-4/+5
compiletest: make the crash test error message abit more informative r? ```@oli-obk```
2024-06-24compiletest: make the crash test error message abit more informativeMatthias Krüger-4/+5
2024-06-24Remove commands duplication between `compiletest` and `tests/rustdoc`Guillaume Gomez-230/+234
2024-06-24Move `tests/rustdoc` testsuite to `//@` syntaxGuillaume Gomez-5/+34
2024-06-23Rollup merge of #126862 - ChrisDenton:needs-symlink, r=jieyouxuMatthias Krüger-0/+27
Add needs-symlink directive to compiletest This is an alternative to #126846 that allows running symlink tests on Windows in CI but will ignore them locally if symlinks aren't available. A future improvement would be to check that the `needs-symlink` directive is used in rmake files that call `create_symlink` but this is just a quick PR to unblock Windows users who want to run tests locally without enabling symlinks.
2024-06-23Add need-symlink directive to compiletestChris Denton-0/+27
2024-06-23test: ignore force-frame-pointers test on some targetsJubilee Young-0/+2
all of these currently force stronger frame pointers, and currently the CLI does not override the target
2024-06-15Auto merge of #122613 - Zalathar:profiler, r=nnethercotebors-3/+0
Don't build a broken/untested profiler runtime on mingw targets Context: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Why.20build.20a.20broken.2Funtested.20profiler.20runtime.20on.20mingw.3F #75872 added `--enable-profiler` to the `x86_64-mingw` job (to cause some additional tests to run), but had to also add `//@ ignore-windows-gnu` to all of the tests that rely on the profiler runtime actually *working*, because it's broken on that target. We can achieve a similar outcome by going through all the `//@ needs-profiler-support` tests that don't actually need to produce/run a binary, and making them use `-Zno-profiler-runtime` instead, so that they can run even in configurations that don't have the profiler runtime available. Then we can remove `--enable-profiler` from `x86_64-mingw`, and still get the same amount of testing. This PR also removes `--enable-profiler` from the mingw dist builds, since it is broken/untested on that target. Those builds have had that flag for a very long time.
2024-06-14Remove `//@ ignore-windows-gnu` from tests that need the profilerZalathar-3/+0
The profiler runtime is no longer built in mingw test jobs, so these tests should naturally be skipped by `//@ needs-profiler-support`.
2024-06-13compiletest: apply considerable clippy suggestionsonur-ozkan-56/+51
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-13Rollup merge of #126370 - Zalathar:normalize, r=oli-obkLeón Orell Valerian Liehr-61/+74
compiletest: Stricter parsing of `//@ normalize-*` headers I noticed some problems with the existing parser for these headers: - It is extremely lax, and basically ignores everything other than the text between two pairs of double-quote characters. - Unlike other name-value headers, it doesn't even check for a colon after the header name, so the test suite contains a mixture of with-colon and without-colon normalization rules. - If parsing fails, the header is silently ignored. The latter is especially bad for platform-specific normalization rules, because the lack of normalization probably won't be noticed until the test mysteriously fails in one of the full CI jobs.
2024-06-13Auto merge of #126197 - jieyouxu:rmake-must-use, r=Kobzolbors-0/+4
run-make: annotate library with `#[must_use]` and enforce `unused_must_use` in rmake.rs This PR adds `#[must_use]` annotations to functions of the `run_make_support` library where it makes sense, and adjusts compiletest to compile rmake.rs with `-Dunused_must_use`. The rationale is that it's highly likely that unused `#[must_use]` values in rmake.rs test files are bugs. For example, unused fs/io results are often load-bearing to the correctness of the test and often unchecked fs/io results allow the test to silently pass where it would've failed if the result was checked. This PR is best reviewed commit-by-commit. try-job: test-various try-job: x86_64-msvc