Commit Graph

646 Commits

Author SHA1 Message Date
Matthias Krüger
3c5ff6efd3
Rollup merge of #126355 - ferrocene:hoverbear/run-make-pass-target, r=Kobzol
Pass target to some run-make tests

<!--
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>
-->

While trying to enable riscv64gc in https://github.com/rust-lang/rust/pull/125669, I noticed several tests failing in https://github.com/rust-lang/rust/actions/runs/9454116367/job/26040977376. I spoke a bit with `@pietroalbini` and he recommended this approach to resolving the issue.

This PR interacts with https://github.com/rust-lang/rust/pull/126279, and it is likely preferable that https://github.com/rust-lang/rust/pull/126279 merges and my changes in ae769f930e2510e57ed8bd379b1b2d393b2312c3 get removed from this PR.

## Testing

> [!NOTE]
> `riscv64gc-unknown-linux-gnu` is a [**Tier 2 with Host Tools** platform](https://doc.rust-lang.org/beta/rustc/platform-support.html), all tests may not necessarily pass! There is work in https://github.com/rust-lang/rust/pull/125220 which helps fix several related tests.

You can test out the renamed job:

```sh
DEPLOY=1 ./src/ci/docker/run.sh riscv64gc-gnu
```

`DEPLOY=1` helps reproduce the CI's environment and also avoids the chance of a `llvm-c/BitReader.h` error (detailed in https://github.com/rust-lang/rust/issues/85424 and https://github.com/rust-lang/rust/issues/56650).

<details>

<summary>tests/run-make/inaccessible-temp-dir failure</summary>

```bash
---- [run-make] tests/run-make/inaccessible-temp-dir stdout ----
# ...
  --- stdout -------------------------------
  # Create an inaccessible directory
  mkdir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/inaccessible-temp-dir/inaccessible-temp-dir/inaccessible
  chmod 000 /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/inaccessible-temp-dir/inaccessible-temp-dir/inaccessible
  # Run rustc with `-Ztemps-dir` set to a directory
  # *inside* the inaccessible one, so that it can't create it
  LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/inaccessible-temp-dir/inaccessible-temp-dir:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/inaccessible-temp-dir/inaccessible-temp-dir -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/inaccessible-temp-dir/inaccessible-temp-dir  -Ainternal_features -Clinker='riscv64-linux-gnu-gcc' program.rs -Ztemps-dir=/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/inaccessible-temp-dir/inaccessible-temp-dir/inaccessible/tmp 2>&1 \
  	| "/checkout/src/etc/cat-and-grep.sh" 'failed to find or create the directory specified by `--temps-dir`'
  [[[ begin stdout ]]]
  error: linking with `riscv64-linux-gnu-gcc` failed: exit status: 1
    |
    = note: LC_ALL="C" PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "riscv64-linux-gnu-gcc" "-m64" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/inaccessible-temp-dir/inaccessible-temp-dir/rustcHHUPmd/symbols.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/inaccessible-temp-dir/inaccessible-temp-dir/inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/inaccessible-temp-dir/inaccessible-temp-dir/inaccessible/tmp/program.dv9uftjrq86w5xa7l2eo7g9l7.rcgu.o" "-Wl,--as-needed" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/inaccessible-temp-dir/inaccessible-temp-dir" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-e6e3c30ae61f5a31.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-4f01f359c61a0a5e.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-02c7b58963139ffd.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-b66d5aea60ed3c58.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-5208f104036103e4.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-fdc5183e4f6dcbdd.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-eab0987d4aea0945.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-7ef07c8021adbf53.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-35ca031413717e66.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-9bf8f545a9224c8a.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-d6c6aeb7f3b89252.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-80de6049595b0062.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-49619208c34115e6.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-b4719719d9691028.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-279763368bc9fa45.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-86a2a7591afd1d37.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-d0bf37205fb9f76a.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-70719e8645e6f000.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-97c640fd5e54ed4c.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/inaccessible-temp-dir/inaccessible-temp-dir/program" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
    = note: riscv64-linux-gnu-gcc: error: unrecognized command-line option '-m64'

  error: aborting due to 1 previous error

  [[[ end stdout ]]]
  Error: cannot match: failed to find or create the directory specified by `--temps-dir`
  ------------------------------------------
  --- stderr -------------------------------
  make: *** [Makefile:26: all] Error 1
  ------------------------------------------
```

</details>

<details>

<summary>tests/run-make/issue-47551 failure</summary>

```bash
---- [run-make] tests/run-make/issue-47551 stdout ----
# ...
  --- stdout -------------------------------
  LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/issue-47551/issue-47551:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/issue-47551/issue-47551 -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/issue-47551/issue-47551  -Ainternal_features -Clinker='riscv64-linux-gnu-gcc' eh_frame-terminator.rs
  ------------------------------------------
  --- stderr -------------------------------
  error: linking with `riscv64-linux-gnu-gcc` failed: exit status: 1
    |
    = note: LC_ALL="C" PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "riscv64-linux-gnu-gcc" "-m64" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/issue-47551/issue-47551/rustcL9WAHK/symbols.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/issue-47551/issue-47551/eh_frame-terminator.eh_frame_terminator.de96000750278472-cgu.0.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/issue-47551/issue-47551/eh_frame-terminator.11u7alf4d09fd9gei30vk4yzn.rcgu.o" "-Wl,--as-needed" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/issue-47551/issue-47551" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-e6e3c30ae61f5a31.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-4f01f359c61a0a5e.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-02c7b58963139ffd.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-b66d5aea60ed3c58.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-5208f104036103e4.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-fdc5183e4f6dcbdd.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-eab0987d4aea0945.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-7ef07c8021adbf53.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-35ca031413717e66.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-9bf8f545a9224c8a.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-d6c6aeb7f3b89252.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-80de6049595b0062.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-49619208c34115e6.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-b4719719d9691028.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-279763368bc9fa45.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-86a2a7591afd1d37.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-d0bf37205fb9f76a.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-70719e8645e6f000.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-97c640fd5e54ed4c.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/issue-47551/issue-47551/eh_frame-terminator" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
    = note: riscv64-linux-gnu-gcc: error: unrecognized command-line option '-m64'

  error: aborting due to 1 previous error

  make: *** [Makefile:7: all] Error 1
  ------------------------------------------

  failures:
      [run-make] tests/run-make/inaccessible-temp-dir
      [run-make] tests/run-make/issue-47551

  test result: FAILED. 151 passed; 2 failed; 201 ignored; 0 measured; 0 filtered out; finished in 59.77s

  Some tests failed in compiletest suite=run-make mode=run-make host=x86_64-unknown-linux-gnu target=riscv64gc-unknown-linux-gnu
  Build completed unsuccessfully in 1:03:01
    local time: Mon Jun 10 20:20:39 UTC 2024
    network time: Mon, 10 Jun 2024 20:20:39 GMT
</details>

try-job: riscv64gc-gnu
2024-06-17 20:34:50 +02:00
Oneirical
6228b3e40e Rewrite and rename issue-26092 to rmake 2024-06-17 13:51:52 -04:00
Oneirical
cdfcc9442e rewrite incremental-session-fail to rmake 2024-06-17 13:01:15 -04:00
Oneirical
5f44f9511d rewrite link-dedup to rmake 2024-06-17 10:43:44 -04:00
Oneirical
553204d26d Rewrite link-arg in rmake.rs 2024-06-17 10:43:44 -04:00
Guillaume Gomez
20d6485e94 Add missing test annotation 2024-06-17 11:15:59 +02:00
Guillaume Gomez
5b49b68f30 Migrate run-make/used to rmake.rs 2024-06-17 00:23:28 +02:00
bors
f6236f63d2 Auto merge of #126542 - GuillaumeGomez:migrate-run-make-duplicate-output-flavors, r=Kobzol
Migrate `run-make/duplicate-output-flavors` to `rmake.rs`

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

r? `@jieyouxu`
2024-06-16 12:34:44 +00:00
Guillaume Gomez
ac751b3049 Migrate run-make/duplicate-output-flavors to rmake.rs 2024-06-16 11:46:02 +02:00
Guillaume Gomez
38b3c9acd4
Rollup merge of #126517 - GuillaumeGomez:migrate-run-make-dep-graph, r=Kobzol
Migrate `run-make/dep-graph` to `rmake.rs`

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

r? `@jieyouxu`
2024-06-15 19:51:37 +02:00
Guillaume Gomez
1f076c273b
Rollup merge of #126478 - GuillaumeGomez:migrate-run-make-codegen-options-parsing, r=jieyouxu
Migrate `run-make/codegen-options-parsing` to `rmake.rs`

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

r? `@jieyouxu`
2024-06-15 19:51:36 +02:00
Guillaume Gomez
a4eaf87982 Migrate run-make/dep-graph to rmake.rs 2024-06-15 17:34:43 +02:00
bors
3fc81daffd Auto merge of #122613 - Zalathar:profiler, r=nnethercote
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-15 00:04:01 +00:00
Oneirical
5f2b47fcb6 rewrite native-link-modifier-verbatim-rustc to rmake 2024-06-14 16:45:52 -04:00
Oneirical
8ece5ce319 rewrite output-filename-overwrites-input to rmake 2024-06-14 16:21:55 -04:00
Oneirical
e088edd149 rewrite output-filename-conflicts-with-directory to rmake 2024-06-14 16:01:24 -04:00
Oneirical
e9ff47ff40 rewrite error-found-staticlib-instead-crate to rmake 2024-06-14 15:50:33 -04:00
Oneirical
ab71510704 rewrite incremental-debugger-visualiser to rmake 2024-06-14 15:10:34 -04:00
Oneirical
a3b7c2993e rewrite extern-flag-fun to rmake 2024-06-14 13:42:42 -04:00
Ana Hobden
f3dd4b16bc
Pass target to run-make issue-47551 2024-06-14 08:08:42 -07:00
Oneirical
cabc982253 rewrite invalid-staticlib to rmake 2024-06-14 10:02:39 -04:00
Oneirical
ff82e43ca3 rewrite and rename issue-64153 to rmake.rs 2024-06-14 10:02:39 -04:00
Guillaume Gomez
267ba9ade2 Migrate run-make/codegen-options-parsing to rmake.rs 2024-06-14 13:59:44 +02:00
bors
63491e1012 Auto merge of #126463 - matthiaskrgr:rollup-lnkfibf, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #124884 (place explicit lifetime bound after generic param)
 - #126343 (Remove some msys2 utils)
 - #126351 (std::unix::fs::link using direct linkat call for Solaris.)
 - #126368 (Remove some unnecessary crate dependencies.)
 - #126386 (Migrate `run-make/allow-non-lint-warnings-cmdline` to `rmake.rs`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-14 09:19:38 +00:00
Zalathar
2646db92fe Remove //@ ignore-windows-gnu from tests that need the profiler
The profiler runtime is no longer built in mingw test jobs, so these tests
should naturally be skipped by `//@ needs-profiler-support`.
2024-06-14 13:31:46 +10:00
Zalathar
5330ccdb34 Use -Zno-profiler-runtime instead of //@ needs-profiler-support
For PGO/coverage tests that don't need to build or run an actual artifact, we
can use `-Zno-profiler-runtime` to run the test even when the profiler runtime
is not available.
2024-06-14 13:31:46 +10:00
Guillaume Gomez
be7b587cd1 Migrate run-make/const_fn_mir to rmake.rs 2024-06-13 12:59:24 +02:00
Guillaume Gomez
eca8d209d9 Make run-make/allow-non-lint-warnings-cmdline into a ui test 2024-06-13 12:55:55 +02:00
Guillaume Gomez
96f9fe5488 Migrate run-make/allow-non-lint-warnings-cmdline to rmake.rs 2024-06-13 12:55:55 +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
7c2b3b5615 rewrite output-with-hyphens to rmake format 2024-06-12 10:12:51 -04:00
Oneirical
03982dae01 rewrite inaccessible-temp-dir to rmake format 2024-06-12 10:12:51 -04:00
Oneirical
d2268902f7 rewrite and rename issue-10971-temps-dir to rmake format 2024-06-12 10:12:51 -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
bors
a330e49593 Auto merge of #125989 - GuillaumeGomez:rollup-xu69i13, r=GuillaumeGomez
Rollup of 11 pull requests

Successful merges:

 - #106186 (Add function `core::iter::chain`)
 - #125596 (Convert `proc_macro_back_compat` lint to an unconditional error.)
 - #125696 (Explain differences between `{Once,Lazy}{Cell,Lock}` types)
 - #125917 (Create `run-make` `env_var` and `env_var_os` helpers)
 - #125927 (Ignore `vec_deque_alloc_error::test_shrink_to_unwind` test on non-unwind targets)
 - #125930 (feat(opt-dist): new flag `--benchmark-cargo-config`)
 - #125932 (Fix typo in the docs of `HashMap::raw_entry_mut`)
 - #125933 (Update books)
 - #125944 (Update fuchsia maintainers)
 - #125946 (Include trailing commas in wrapped function declarations [RustDoc])
 - #125973 (Remove `tests/run-make-fulldeps/pretty-expanded`)

Failed merges:

 - #125815 (`rustc_parse` top-level cleanups)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-04 21:21:18 +00:00
Oneirical
59e2074c79 rewrite suspicious-library in rmake 2024-06-04 15:27:13 -04:00
bors
23e040adec Auto merge of #125426 - jieyouxu:rmake-support-env-reset, r=saethlin
Update `compiler-builtins` test to not clear essential env vars

Noticed in https://github.com/rust-lang/rust/pull/122580#issuecomment-2125755689, the `compiler-builtins` test failed on Windows for a `cargo` invocation because necessary env vars `TMP` and `TEMP` were cleared by `Command::env_clear`, causing temp dir eventually used by codegen to fallback to the Windows directory, which will trigger permission errors.

This PR removes the `env_clear` on the cargo invocation.

r? `@saethlin` (feel free to reroll, since you authored the test)

try-job: x86_64-msvc
try-job: test-various
2024-06-04 19:14:28 +00:00
Guillaume Gomez
7e993b24d5 Create run-make env_var and env_var_os helpers 2024-06-04 21:07:48 +02:00
许杰友 Jieyou Xu (Joe)
2949195d9a compiler-builtins: don't clear env vars for cargo invocation 2024-06-04 08:04:22 +00:00
许杰友 Jieyou Xu (Joe)
756af9d5bc
Rollup merge of #125818 - Urgau:print-check-cfg-no-values, r=petrochenkov
Handle no values cfgs with `--print=check-cfg`

This PR fix a bug with `--print=check-cfg`, where no values cfgs where not printed since we only printed cfgs that had at least one values.

The representation I choose is `CFG=`, since it doesn't correspond to any valid config, it also IMO nicely complements the `values()` (to indicate no values). Representing the absence of value by the absence of the value.

So for `cfg(feature, values())` we would print `feature=`.

I also added the missing tracking issue number in the doc.

r? ```@petrochenkov```
2024-06-04 08:25:48 +01:00
bors
1689a5a531 Auto merge of #122597 - pacak:master, r=bjorn3
Show files produced by `--emit foo` in json artifact notifications

Right now it is possible to ask `rustc` to save some intermediate representation into one or more files with `--emit=foo`, but figuring out what exactly was produced is difficult. This pull request adds information about `llvm_ir` and `asm` intermediate files into notifications produced by `--json=artifacts`.

Related discussion: https://internals.rust-lang.org/t/easier-access-to-files-generated-by-emit-foo/20477

Motivation - `cargo-show-asm` parses those intermediate files and presents them in a user friendly way, but right now I have to apply some dirty hacks. Hacks make behavior confusing: https://github.com/hintron/computer-enhance/issues/35

This pull request introduces a new behavior: now `rustc` will emit a new artifact notification for every artifact type user asked to `--emit`, for example for `--emit asm` those will include all the `.s` files.

Most users won't notice this behavior, to be affected by it all of the following must hold:
- user must use `rustc` binary directly (when `cargo` invokes `rustc` - it consumes artifact notifications and doesn't emit anything)
- user must specify both `--emit xxx` and `--json artifacts`
- user must refuse to handle unknown artifact types
- user must disable incremental compilation (or deal with it better than cargo does, or use a workaround like `save-temps`) in order not to hit #88829 / #89149
2024-06-04 00:05:56 +00:00
bors
7c52d2db63 Auto merge of #125383 - Oneirical:bundle-them-up, r=jieyouxu
Rewrite `emit`, `mixing-formats` and `bare-outfile` `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-03 18:35:54 +00:00
Oneirical
6e120cf464 Remove some allowed-makefiles 2024-06-02 21:59:37 -04:00
Jubilee
800b2f8b64
Rollup merge of #125808 - GuillaumeGomez:migrate-run-make-c-link-to-rust-dylib, r=jieyouxu
Migrate `run-make/c-link-to-rust-dylib` to `rmake.rs`

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

First commit comes from https://github.com/rust-lang/rust/pull/125773.

r? `@jieyouxu`
2024-06-02 12:58:08 -07:00
Jubilee
0722c9439e
Rollup merge of #125849 - GuillaumeGomez:migrate-emit-named-files, r=jieyouxu
Migrate `run-make/emit-named-files` to `rmake.rs`

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

r? `@jieyouxu`
2024-06-02 05:06:47 -07:00
Guillaume Gomez
32933a6869 Migrate run-make/c-link-to-rust-dylib to rmake.rs 2024-06-02 12:04:39 +02:00
Urgau
5f0043ace6 Handle no values cfg with --print=check-cfg 2024-06-02 11:49:28 +02:00
bors
a83cf567b5 Auto merge of #125822 - Urgau:print-check-cfg-refactor-test, r=jieyouxu
Refactor `--print=check-cfg` test

*as asked in https://github.com/rust-lang/rust/pull/125818#discussion_r1622463592*

r? `@jieyouxu`
2024-06-02 05:58:46 +00:00
Guillaume Gomez
190a96f9d3 Migrate run-make/emit-named-files to rmake.rs 2024-06-01 10:29:45 +02:00
Guillaume Gomez
8742bf375b Migrate run-make/cdylib to rmake.rs 2024-06-01 10:12:45 +02:00
Urgau
a7e7848833 Refactor --print=check-cfg test 2024-05-31 17:11:46 +02:00
bors
2a2c29aafa Auto merge of #125759 - nnethercote:format-some-tests, r=GuillaumeGomez
Format some tests

There are more directories under `tests/` still to do, but this is enough for one PR.

r? `@GuillaumeGomez`
2024-05-31 12:18:57 +00:00
Nicholas Nethercote
3079bd96b9 Run rustfmt on tests/run-make/.
With the exception of `tests/run-make/translation/test.rs`, which has a
syntax error.

The expected output in `rustdoc-error-lines/rmake.rs`'s required slight
tweaking.

The two `reproducible-build.rs` files need `// ignore-tidy-linelength`
because rustfmt produces lines longer than 100 chars, which tidy doesn't
like, yuk.
2024-05-31 21:30:08 +10:00