Commit graph

565 commits

Author SHA1 Message Date
Guillaume Gomez be7b587cd1 Migrate run-make/const_fn_mir to rmake.rs 2024-06-13 12:59:24 +02:00
bors 56e112afb6 Auto merge of #126374 - workingjubilee:rollup-tz0utfr, r=workingjubilee
Rollup of 10 pull requests

Successful merges:

 - #125674 (Rewrite `symlinked-extern`, `symlinked-rlib` and `symlinked-libraries` `run-make` tests in `rmake.rs` format)
 - #125688 (Walk into alias-eq nested goals even if normalization fails)
 - #126142 (Harmonize using root or leaf obligation in trait error reporting)
 - #126303 (Urls to docs in rust_hir)
 - #126328 (Add Option::is_none_or)
 - #126337 (Add test for walking order dependent opaque type behaviour)
 - #126353 (Move `MatchAgainstFreshVars` to old solver)
 - #126356 (docs(rustc): Improve discoverable of Cargo docs)
 - #126358 (safe transmute: support `Single` enums)
 - #126362 (Make `try_from_target_usize` method public)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-13 05:00:13 +00:00
Jubilee 1a6b1a14f9
Rollup merge of #125674 - Oneirical:another-day-another-test, r=jieyouxu
Rewrite `symlinked-extern`, `symlinked-rlib` and `symlinked-libraries` `run-make` tests in `rmake.rs` format

Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

try-job: x86_64-msvc
2024-06-12 20:03:18 -07:00
bors f6b4b71ef1 Auto merge of #125165 - Oneirical:pgo-branch-weights, r=jieyouxu
Migrate `run-make/pgo-branch-weights` 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).

This is a scary one and I expect things to break. Set as draft, because this isn't ready.

- [x] There is this comment here, which suggests the test is excluded from the testing process due to a platform specific issue? I can't see anything here that would cause this test to not run...
> // FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
// properly. Since we only have GCC on the CI ignore the test for now."

EDIT: This is specific to Windows-gnu.

- [x] The Makefile has this line:
```
ifneq (,$(findstring x86,$(TARGET)))
COMMON_FLAGS=-Clink-args=-fuse-ld=gold
```
I honestly can't tell whether this is checking if the target IS x86, or IS NOT. EDIT: It's checking if it IS x86.

- [x] I don't know why the Makefile was trying to pass an argument directly in the Makefile instead of setting that "aaaaaaaaaaaa2bbbbbbbbbbbb2bbbbbbbbbbbbbbbbcc" input as a variable in the Rust program directly. I changed that, let me know if that was wrong.

- [x] Trying to rewrite `cat "$(TMPDIR)/interesting.ll" | "$(LLVM_FILECHECK)" filecheck-patterns.txt` resulted in some butchery. For starters, in `tools.mk`, LLVM_FILECHECK corrects its own backslashes on Windows distributions, but there is no further mention of it, so I assume this is a preset environment variable... but is it really? Then, the command itself uses a Standard Input and a passed input file as an argument simultaneously, according to the [documentation](https://llvm.org/docs/CommandGuide/FileCheck.html#synopsis).

try-job: aarch64-gnu
2024-06-13 02:46:23 +00:00
Michael Goulet d25227c236
Rollup merge of #126036 - Oneirical:the-intelligent-intestor, r=jieyouxu
Migrate `run-make/short-ice` 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).

try-job: x86_64-msvc
2024-06-12 14:26:25 -04:00
Oneirical 2ac5faa509 port symlinked-libraries to rmake 2024-06-12 09:44:21 -04:00
Oneirical 59acd23457 port symlinked-rlib to rmake 2024-06-12 09:44:21 -04:00
Oneirical 80408e0649 port symlinked-extern to rmake 2024-06-12 09:44:21 -04:00
Oneirical 17b07716f8 rewrite pgo-branch-weights to rmake 2024-06-12 09:40:12 -04:00
Guillaume Gomez 45a9bd5d40 Use fs_wrapper in run-make/prefer-dylib 2024-06-12 11:46:05 +02:00
Guillaume Gomez d79aeaf898 Remove unused import in run-make/prefer-dylib/rmake.rs 2024-06-12 11:44:33 +02:00
Guillaume Gomez f2cce98149 Migrate run-make/prefer-rlib to rmake.rs 2024-06-12 11:38:56 +02:00
许杰友 Jieyou Xu (Joe) e37c423f10
Rollup merge of #126174 - GuillaumeGomez:migrate-run-make-prefer-dylib, r=jieyouxu
Migrate `tests/run-make/prefer-dylib` to `rmake.rs`

Part of https://github.com/rust-lang/rust/issues/121876.

r? ```@jieyouxu```
2024-06-11 21:27:47 +01:00
Oneirical 8a6bc13cfe Add set_backtrace_level helper function to run_make_support 2024-06-11 15:39:54 -04:00
bors 3ea5e236ec Auto merge of #125736 - Oneirical:run-make-file-management, r=jieyouxu
run-make-support: add wrapper for `fs` operations

Suggested by #125728.

The point of this wrapper is to stop silent fails caused by forgetting to `unwrap` `fs` functions. However, functions like `fs::read` which return something and get stored in a variable should cause a failure on their own if they are not unwrapped (as the `Result` will be stored in the variable, and something will be done on that `Result` that should have been done to its contents). Is it still pertinent to wrap `fs::read_to_string`, `fs::metadata` and so on?

Closes: https://github.com/rust-lang/rust/issues/125728

try-job: x86_64-msvc
try-job: i686-mingw
2024-06-11 15:50:25 +00:00
Oneirical c84afee898 Implement fs wrapper for run_make_support 2024-06-11 09:53:31 -04:00
bors 0c960618b5 Auto merge of #126274 - jieyouxu:rollup-uj93sfm, r=jieyouxu
Rollup of 5 pull requests

Successful merges:

 - #126186 (Migrate `run-make/multiple-emits` to `rmake.rs`)
 - #126236 (Delegation: fix ICE on recursive delegation)
 - #126254 (Remove ignore-cross-compile directive from ui/macros/proc_macro)
 - #126258 (Do not define opaque types when selecting impls)
 - #126265 (interpret: ensure we check bool/char for validity when they are used in a cast)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-11 13:38:45 +00:00
许杰友 Jieyou Xu (Joe) dea5237c0e
Rollup merge of #126186 - GuillaumeGomez:migrate-run-make-multiple-emits, r=jieyouxu
Migrate `run-make/multiple-emits` to `rmake.rs`

Part of https://github.com/rust-lang/rust/issues/121876.

r? `@jieyouxu`
2024-06-11 14:16:45 +01:00
Guillaume Gomez 19a2dfea88 Migrate tests/run-make/prefer-dylib to rmake.rs 2024-06-11 14:11:30 +02:00
Guillaume Gomez e8b04cc95f Migrate run-make/multiple-emits to rmake.rs 2024-06-11 14:09:38 +02:00
bors 20ba13c38e Auto merge of #125752 - jieyouxu:kaboom, r=Kobzol
run-make: arm command wrappers with drop bombs

This PR is one in a series of cleanups to run-make tests and the run-make-support library.

### Summary

It's easy to forget to actually executed constructed command wrappers, e.g. `rustc().input("foo.rs")` but forget the `run()`, so to help catch these mistakes, we arm command wrappers with drop bombs on construction to force them to be executed by test code.

This PR also removes the `Deref`/`DerefMut` impl for our custom `Command` which derefs to `std::process::Command` because it can cause issues when trying to use a custom command:

```rs
htmldocck().arg().run()
```

fails to compile because the `arg()` is resolved to `std::process::Command::arg`, which returns `&mut std::process::Command` that doesn't have a `run()` command.

This PR also:

- Removes `env_var` on the `impl_common_helper` macro that was wrongly named and is a footgun (no users).
- Bumps the run-make-support library to version `0.1.0`.
- Adds a changelog to the support library.

### Details

Especially for command wrappers like `Rustc`, it's very easy to build up
a command invocation but forget to actually execute it, e.g. by using
`run()`. This commit adds "drop bombs" to command wrappers, which are
armed on command wrapper construction, and only defused if the command
is executed (through `run`, `run_fail`).

If the test writer forgets to execute the command, the drop bomb will
"explode" and panic with an error message. This is so that tests don't
silently pass with constructed-but-not-executed command wrappers.

This PR is best reviewed commit-by-commit.

try-job: x86_64-msvc
2024-06-11 11:29:02 +00:00
许杰友 Jieyou Xu (Joe) ca95f783c1 tests/run-make: update tests to use new API 2024-06-11 09:14:28 +00:00
Zalathar 3923b686c7 Rename needs-matching-clang to needs-force-clang-based-tests
This header is much more restrictive than its old name would suggest. As a
result, most of the tests that use it don't actually run in any CI jobs.
2024-06-11 16:45:51 +10:00
Matthias Krüger d762ef1d0c
Rollup merge of #126223 - jieyouxu:rmake-run-in-tmpdir-self-test, r=Kobzol
run-make: add `run_in_tmpdir` self-test

Add a basic sanity test for `run_in_tmpdir` to make sure that files (including read-only files) and directories created inside the "scratch" tmpdir are removed after the closure returns.

r? ghost (while i run a try job)

try-job: x86_64-msvc
2024-06-10 21:12:28 +02:00
Matthias Krüger 61eb29e958
Rollup merge of #126211 - lolbinarycat:llvm-outputs-rmake, r=jieyouxu
migrate tests/run-make/llvm-outputs to use rmake.rs

part of #121876

<!--
If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue here. If you don't know of a related
tracking issue or there are none, feel free to ignore this.

This PR will get automatically assigned to a reviewer. In case you would like
a specific user to review your work, you can assign it to them by using

    r​? <reviewer name>
-->
2024-06-10 21:12:26 +02:00
许杰友 Jieyou Xu (Joe) 256387b63e run-make: add run_in_tmpdir self-test 2024-06-10 10:46:36 +00:00
binarycat 91f5530b2d migrate tests/run-make/llvm-outputs to use rmake.rs
part of #121876
2024-06-10 05:30:58 -04:00
Oneirical f88c647cda rewrite short-ice in rmake format 2024-06-09 13:49:55 -04:00
Edward Shen d9f78cb793
rustdoc: Add support for --remap-path-prefix
Adds --remap-path-prefix as an unstable option. This is implemented to
mimic the behavior of rustc's --remap-path-prefix but with minor
adjustments.

This flag similarly takes in two paths, a prefix to replace and a
replacement string.
2024-06-09 10:34:54 -07:00
bors 13423befc4 Auto merge of #126087 - jieyouxu:rmake-docs, r=Kobzol
run-make: add some basic docs about the test suite's setup

r? `@Kobzol`
2024-06-09 03:18:49 +00:00
许杰友 Jieyou Xu (Joe) e7409d2130 run-make: add some basic docs about the test suite's setup 2024-06-08 18:16:49 +00:00
Jakub Beránek 0a190e8d2d
Migrate runmake tests away from custom commands and command_output 2024-06-08 19:36:31 +02:00
bors cfdb6175c2 Auto merge of #126097 - Kobzol:runmake-change-cwd, r=jieyouxu
Change how runmake v2 tests are executed

This PR makes execution of v2 runmake tests more sane, by executing each test in a temporary directory by default, rather than running it inside `tests/run-make`. This will have.. a lot of conflicts.

Fixes: https://github.com/rust-lang/rust/issues/126080
Closes https://github.com/rust-lang/rust/issues/125726, because it removes `tmp_dir`, lol.

r? `@jieyouxu`

try-job: x86_64-msvc
2024-06-08 15:25:05 +00:00
Jakub Beránek b10a404199
Fix windows test 2024-06-08 15:40:43 +02:00
Jakub Beránek 5844b679f3
Remove unnecessary functions and the last mention of TMPDIR from run-make-support 2024-06-08 13:10:55 +02:00
Matthias Krüger b8e28d1426
Rollup merge of #126112 - Kobzol:runmake-source-root, r=jieyouxu
Clean up source root in run-make tests

The name `S` isn't exactly the most descriptive, and we also shouldn't need to pass it when building (actually I think that most of the env. vars that we pass to `cargo` here are probably not really needed).

Related issue: https://github.com/rust-lang/rust/issues/126071

r? ```@jieyouxu```
2024-06-07 20:14:32 +02:00
Jakub Beránek c9cb3280f3
Address review comments 2024-06-07 14:07:02 +02:00
Jakub Beránek d86c981908
Remove all usages of tmp_dir from tests 2024-06-07 11:12:24 +02:00
Jakub Beránek 7ebcc37d65
Fix bare-outfile test 2024-06-07 11:12:04 +02:00
Jakub Beránek 3f20c721ce
Fix mixing-formats run-make test 2024-06-07 11:12:04 +02:00
Jakub Beránek 7eff2d9b22
Do not pass source root when building run-make tests 2024-06-07 09:20:25 +02:00
Jubilee 2acb24c462
Rollup merge of #126098 - Kobzol:remove-same-lib-runmake-test, r=jieyouxu
Remove `same-lib-two-locations-no-panic` run-make test

This test doesn't really make any sense anymore, it became broken a long time ago.

r? ``@jieyouxu``
2024-06-06 21:10:10 -07:00
bors 76e7a0849c Auto merge of #126104 - workingjubilee:rollup-t1ac2ld, r=workingjubilee
Rollup of 12 pull requests

Successful merges:

 - #125220 (Repair several `riscv64gc-unknown-linux-gnu` codegen tests)
 - #126033 (CI: fix publishing of toolstate history)
 - #126034 (Clarify our tier 1 Windows Server support)
 - #126035 (Some minor query system cleanups)
 - #126051 (Clarify an `x fmt` error.)
 - #126059 (Raise `DEFAULT_MIN_STACK_SIZE` to at least 64KiB)
 - #126064 (Migrate `run-make/manual-crate-name` to `rmake.rs`)
 - #126072 (compiletest: Allow multiple `//@ run-flags:` headers)
 - #126073 (Port `tests/run-make-fulldeps/obtain-borrowck` to ui-fulldeps)
 - #126081 (Do not use relative paths to Rust source root in run-make tests)
 - #126086 (use windows compatible executable name for libcxx-version)
 - #126096 ([RFC-2011] Allow `core_intrinsics` when activated)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-06 22:27:56 +00:00
Jubilee af229f5e00
Rollup merge of #126081 - Kobzol:run-make-relative-paths, r=jieyouxu
Do not use relative paths to Rust source root in run-make tests

Pre-requisite for https://github.com/rust-lang/rust/issues/126080.

Fixes: https://github.com/rust-lang/rust/issues/126071

r? `@jieyouxu`
2024-06-06 14:46:24 -07:00
Jubilee 2c1e71bac5
Rollup merge of #126064 - GuillaumeGomez:migrate-run-make-manual-crate-name, r=jieyouxu
Migrate `run-make/manual-crate-name` to `rmake.rs`

Part of https://github.com/rust-lang/rust/issues/121876.

r? ``@jieyouxu``
2024-06-06 14:46:23 -07:00
Jakub Beránek a5429d53af
Remove same-lib-two-locations-no-panic run-make test
This test doesn't really make any sense anymore, it became broken a long time ago.
2024-06-06 21:41:47 +02:00
Jakub Beránek 6e1121b492
Do not use relative paths to Rust source root in run-make tests 2024-06-06 19:16:53 +02:00
Rémy Rakic 9ddf5726f0 add non-regression run-make test for issues 125474, 125484, and 125646 2024-06-06 10:06:28 +00:00
Guillaume Gomez 7ad5ebc75c Migrate run-make/manual-crate-name to rmake.rs 2024-06-06 10:19:15 +02:00
Jubilee 0f2b34acdc
Rollup merge of #125683 - Oneirical:patience-testing-test, r=jieyouxu
Rewrite `suspicious-library`, `resolve-rename` and `incr-prev-body-beyond-eof` `run-make` tests in `rmake.rs` format

Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Some oddly specific ignore flags in `incr-prev-body-beyond-eof`:

```rs
// ignore-none
// ignore-nvptx64-nvidia-cuda
```

it could be interesting to run a try job, but it seems there is no nvidia-cuda in the CI settings (`jobs.yml`).

try-job: armhf-gnu
2024-06-05 01:14:30 -07:00