Commit Graph

372 Commits

Author SHA1 Message Date
bors
8f9080db42 Auto merge of #124847 - Oneirical:master, r=jieyouxu
Document tests in the `run-make` directory (A to C)

Part of the #121876 project.

This PR adds comments to some `run-make` tests which lack one, explaining _what_ is being tested. If possible, a link to the relevant PR or Issue responsible for the test is also provided.

This will help the porting efforts to `rmake.rs`, and will also allow maintainers to focus efforts on tests which are more pertinent to port. For example, [this test](https://github.com/rust-lang/rust/blob/master/tests/run-make/cat-and-grep-sanity-check/Makefile) will become useless after all tests containing `CGREP` are successfully ported.

In order to simplify review and at the suggestion of Kobzol on the rust-lang #gsoc Zulip, only the first 23 comments are part of this PR. If it is merged, future PRs will ensue commenting the rest of the tests.

Could be an UI test:

- `dep-info-doesnt-run-much`
2024-05-09 21:19:38 +00:00
Julien
bdab8b1c0c
add FIXME 2024-05-09 13:29:46 -04:00
Oneirical
304c183d4f correct comments 2024-05-08 21:44:57 -04:00
Guillaume Gomez
c078a44247 Migrate run-make/rustdoc-map-file to rmake 2024-05-08 16:58:12 +02:00
Julien
79cf61a9ae Update Makefiles with explanatory comments 2024-05-07 22:12:36 -04:00
Guillaume Gomez
34fe2172b1 Migrate run-make/rustdoc-error-lines to rmake.rs 2024-05-06 09:16:35 +02:00
Guillaume Gomez
823b423d4c Add new output method to Rustc and Rustdoc types 2024-05-06 09:16:35 +02:00
Guillaume Gomez
c04d09a76b Rename run-make-support library output method to command_output 2024-05-05 16:53:57 +02:00
Guillaume Gomez
3c2cf2e50b Migrate run-make/doctests-runtool to rmake 2024-05-05 16:53:57 +02:00
Matthias Krüger
b8711373cd
Rollup merge of #124698 - JoverZhang:test-rustdoc-determinism, r=jieyouxu
Rewrite `rustdoc-determinism` test in Rust

Rewrite the `rustdoc-determinism` test from #121876.

r? `@jieyouxu`
2024-05-04 12:37:23 +02:00
Jover Zhang
2f4861c0e6 Rewrite rustdoc-determinism test in Rust 2024-05-04 15:52:42 +08:00
Guillaume Gomez
5ea65c8ccb Migrate run-make/doctests-keep-binaries to new rmake.rs format 2024-05-03 21:27:52 +02:00
Matthias Krüger
82030f2dd4
Rollup merge of #124613 - GuillaumeGomez:fmt-run-make, r=onur-ozkan
Allow fmt to run on rmake.rs test files

As discussed with `@jieyouxu,` `rmake.rs` from the `run-make` testsuite would benefit from being formatted as well.

Only thing needed to be done for it to work: allow support for `!` in our `rustfmt.toml` file parsing.

r? `@onur-ozkan`
2024-05-03 15:26:11 +02:00
Matthias Krüger
c27d3d5d2a
Rollup merge of #124612 - Urgau:run-make-stdin, r=jieyouxu
Add support for inputing via stdin with run-make-support

This PR adds the facility to set a input bytes that will be passed via the standard input.

This is useful for testing `rustc -` (and soon `rustdoc -`).

In #124611 took the approach of having a dedicated `run` method but it is not very convenient to use and would necessitate many functions, one for success, one for fail, ...

Instead this PR takes a different approach and allows setting the input bytes as if it were a parameter and when calling the (now custom) `output` function, we write the input bytes into stdin. I think this gives us maximum flexibility in the implementation and a simple interface for users.

To test this new logic I ported `tests/run-make/stdin-non-utf8/` to an `rmake.rs` one.

r? `@jieyouxu`
2024-05-03 15:26:10 +02:00
Guillaume Gomez
8f47f9773d Allow fmt to run on rmake.rs test files 2024-05-03 11:05:58 +02:00
Urgau
2c4214e0a0 run-make: port stdin-rustc to Rust-based rmake.rs 2024-05-03 08:09:57 +02:00
Matthias Krüger
6cc3959230
Rollup merge of #124622 - fmease:yeet-extern-crate-run_make_support, r=jieyouxu
Cleanup: Rid the `rmake` test runners of `extern crate run_make_support;`

`run_make_support` is part of the *extern prelude* of `rmake` test runners rendering `extern crate run_make_support` redundant:

80451a485b/src/tools/compiletest/src/runtest.rs (L3826-L3827)

~~Contains some fmt'ing changes because I've enabled format-on-save in my editor and because we don't run `x fmt` for `rmake` test runners yet (this gets addressed by #124613). I can revert those if you'd like me to.~~ (reverted)

r? jieyouxu or testing-devex(?) or boostrap(?)
2024-05-02 19:42:49 +02:00
Matthias Krüger
f01e99f191
Rollup merge of #124138 - mati865:ignore-llvm-abi-in-dlltool-tests, r=davidtwco
Ignore LLVM ABI in dlltool tests since those targets don't use dlltool

Otherwise those two tests fail when running `./x.py test` with this target.
2024-05-02 19:42:47 +02:00
León Orell Valerian Liehr
09aa77299b
Cleanup: Rid the rmake test runners of extern crate run_make_support; 2024-05-02 17:57:23 +02:00
许杰友 Jieyou Xu (Joe)
ce18639b92
Rollup merge of #124280 - beetrees:repr128-test-rmake, r=jieyouxu
Port repr128-dwarf run-make test to rmake

This PR ports the repr128-dwarf run-make test to rmake, using the `gimli` crate instead of the `llvm-dwarfdump` command.

Note that this PR changes `rmake.rs` files to be compiled with the 2021 edition (previously no edition was passed to `rustc`, meaning they were compiled with the 2015 edition). This means that `panic!("{variable}")` will now work as expected in `rmake.rs` files (there's already a usage in the [wasm-symbols-not-exported test](aca749eefc/tests/run-make/wasm-symbols-not-exported/rmake.rs (L34)) that this will fix).

Tracking issue: #121876
2024-04-30 19:29:51 +01:00
beetrees
c2fd6ed235
Port repr128-dwarf run-make test to rmake 2024-04-30 17:50:49 +01:00
Urgau
006c94cfa1 Use named struct arguments instead of comment named args 2024-04-28 17:17:22 +02:00
Urgau
607497d57c Port print-cfg run-make to Rust-based rmake.rs 2024-04-28 17:17:22 +02:00
Urgau
7688f798d5 Also support MSVC in print-native-static-libs test 2024-04-27 00:26:06 +02:00
Urgau
74cbc09fc9 Port run-make --print=native-static-libs to rmake.rs 2024-04-26 19:45:45 +02:00
Daniel Paoliello
29f2e27156 Keep the LIB env var in the compiler-builtins test 2024-04-25 13:49:46 -07:00
Matthias Krüger
a2d6b1b2d6
Rollup merge of #124257 - JoverZhang:rmake-diff, r=jieyouxu
Rewrite the `no-input-file.stderr` test in Rust and support diff

Rewrite the `no-input-file.stderr` test from #121876.
Use the `similar` lib to replace the `diff` command.
2024-04-25 06:31:03 +02:00
Jover Zhang
f3530cf003 Rewrite no-input-file.stderr test in Rust and support diff 2024-04-25 09:10:10 +08:00
Mateusz Mikuła
a51ad79712 Refactor dlltool searching code into separate function 2024-04-24 19:24:45 +02:00
Urgau
153b1f0421 Improve diagnostic for unknown --print request 2024-04-24 15:52:01 +02:00
bors
32885838c0 Auto merge of #124112 - beetrees:incremental-os-str, r=Nadrieril
Fix ICE when there is a non-Unicode entry in the incremental crate directory

Fix the ICE that occurs when there is a non-Unicode entry in the incremental crate directory by replacing uses of `to_string_lossy` + `assert_no_characters_lost` with `to_str`. The added test would cause the compiler to ICE before this PR.
2024-04-22 04:00:58 +00:00
beetrees
71f751d139
Fix ICE when there is a non-Unicode entry in the incremental crate directory 2024-04-21 11:24:55 +01:00
Matthias Krüger
b1eee427a0
Rollup merge of #123729 - jieyouxu:rmake-refactor-2, r=oli-obk
run-make: refactor out command wrappers for `clang` and `llvm-readobj`

This PR is rebased on top of https://github.com/rust-lang/rust/pull/123699.

This PR is a follow up to https://github.com/rust-lang/rust/pull/123612 to refactor out command wrappers into the support library for `llvm-readobj` and `clang`.

r? ghost
2024-04-19 19:30:48 +02:00
bors
38104f3a88 Auto merge of #123936 - Mark-Simulacrum:zst-no-alloc, r=oli-obk
Codegen ZSTs without an allocation

This makes sure that &[] is equivalent to unsafe code (from_raw_parts(dangling, 0)). No new stable guarantee is intended about whether or not we do this, this is just an optimization.

This regressed in #67000 (no comments I can see about that regression in the PR, though it did change the test modified here). We had previously performed this optimization since #63635.
2024-04-17 18:31:10 +00:00
许杰友 Jieyou Xu (Joe)
ca945e9ed8 tests: update cross-lang-lto-riscv-abi to use command wrappers 2024-04-17 16:28:49 +00:00
Matthias Krüger
d5258af4c1
Rollup merge of #122723 - bjorn3:archive_writer_fixes, r=nnethercote
Use same file permissions for ar_archive_writer as the LLVM archive writer

This is required to switch to ar_archive_writer in the future without regressions. In addition to this PR support for reading thin archives needs to be added (https://github.com/rust-lang/rust/issues/107407) to fix all known regressions.

Fixes https://github.com/rust-lang/rust/issues/107495
2024-04-17 18:01:38 +02:00
bjorn3
297fceb9ac Use the default file permissions when writing
static libraries with ar_archive_writer

Fixes #107495
2024-04-17 12:51:20 +00:00
bjorn3
66a73f0c20 Add regression test for #107495 2024-04-17 12:50:03 +00:00
Mark Rousskov
9ab6e36d8d Fix broken test
Testing for ASLR by casting &ZST to *const _ is not useful, there's no
guarantee that &ZST produces an ASLR'd pointer.
2024-04-16 21:13:21 -04:00
Guillaume Gomez
ec1618cf17
Rollup merge of #123975 - lqd:rust-lld-tests, r=jieyouxu
Port the 2 `rust-lld` run-make tests to `rmake`

In preparation for finalizing most of the `rust-lld` work, this PR ports the following tests to `rmake`:
- `tests/run-make/rust-lld`
- `tests/run-make/rust-lld-custom-target`

As they use `$(CGREP) -e` I added `regex` as an exported dependency to the `run_make_support` library.

Unfortunately, the most recent versions depend on `memchr` 2.6.0 but it's currently pinned at 2.5.0 in the workspace, and therefore had to settle for the older `regex-1.8.0`.

r? `@jieyouxu`
2024-04-17 00:00:23 +02:00
Guillaume Gomez
7709b7d44a
Rollup merge of #124023 - pacak:less-splody, r=jieyouxu
Allow workproducts without object files.

This pull request partially reverts changes from e16c3b4a44

Original motivation for this assert was described with "A WorkProduct without a saved file is useless"
which was true at the time but now it is possible to have work products with other types of files
(llvm-ir, asm, etc) and there are bugreports for this failure:

For example: https://github.com/rust-lang/rust/issues/123695

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

Now existing `assert` and `.unwrap_or_else` are unified into a single
check that emits slightly more user friendly error message if an object
files was meant to be produced but it's missing
2024-04-16 21:41:27 +02:00
Michael Baikov
a03aeca99a Allow workproducts without object files.
This pull request partially reverts changes from e16c3b4a44

Original motivation for this assert was described with "A WorkProduct without a saved file is useless"
which was true at the time but now it is possible to have work products with other types of files
(llvm-ir, asm, etc) and there are bugreports for this failure:

For example: https://github.com/rust-lang/rust/issues/123695

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

Now existing `assert` and `.unwrap_or_else` are unified into a single
check that emits slightly more user friendly error message if an object
files was meant to be produced but it's missing
2024-04-16 11:19:35 -04:00
Guillaume Gomez
26b6a234a1
Rollup merge of #121694 - davidtwco:stabilize-relro-level, r=Mark-Simulacrum
sess: stabilize `-Zrelro-level` as `-Crelro-level`

Stabilise `-Zrelro-level` as `-Crelro-level`. There's no tracking issue for this flag to close.
2024-04-16 15:19:10 +02:00
Rémy Rakic
8acfe9a138 add link_arg helper to run_make_support
and use it in the `rust-lld` tests
2024-04-15 18:08:55 +00:00
Rémy Rakic
8fa6984e8e port rust-lld-custom-target test to rmake
also make sure that rust-lld can be disabled via linker features, even
when enabled by default by the target spec
2024-04-15 18:01:37 +00:00
Rémy Rakic
97795923fc port rust-lld test to rmake
also check that turning off the linker feature does not use lld
2024-04-15 17:33:02 +00:00
bors
7106800e16 Auto merge of #123656 - lqd:linker-features, r=petrochenkov
Linker flavors next steps: linker features

This is my understanding of the first step towards `@petrochenkov's` vision for the future of linker flavors, described in https://github.com/rust-lang/rust/pull/119906#issuecomment-1895693162 and the discussion that followed.

To summarize: having `Cc` and `Lld` embedded in linker flavors creates tension about naming, and a combinatorial explosion of flavors for each new linker feature we'd want to use. Linker features are an extension mechanism that is complementary to principal flavors, with benefits described in #119906.

The most immediate use of this flag would be to turn self-contained linking on and off via features instead of flavors. For example, `-Clinker-features=+/-lld` would toggle using lld instead of selecting a precise flavor, and would be "generic" and work cross-platform (whereas linker flavors are currently more tied to targets). Under this scheme, MCP510 is expected to be `-Clink-self-contained=+linker -Zlinker-features=+lld -Zunstable-options` (though for the time being, the original flags using lld-cc flavors still work).

I purposefully didn't add or document CLI support for `+/-cc`, as it would be a noop right now. I only expect that we'd initially want to stabilize `+/-lld` to begin with.

r? `@petrochenkov`

You had requested that minimal churn would be done to the 230 target specs and this does none yet: the linker features are inferred from the flavor since they're currently isomorphic. We of course expect this to change sooner rather than later.

In the future, we can allow targets to define linker features independently from their flavor, and remove the cc and lld components from the flavors to use the features instead, this actually doesn't need to block stabilization, as we discussed.

(Best reviewed per commit)
2024-04-13 11:10:01 +00:00
Rémy Rakic
dee834b8a6 test duplicate features, that the last +/-lld on the CLI wins 2024-04-12 09:46:38 +00:00
Rémy Rakic
5359d9c02a test self-contained linking via -Zlinker-features=+lld 2024-04-12 09:46:38 +00:00
Matthias Krüger
a510cbdead
Rollup merge of #123763 - cuviper:host-rpath-run-make-v2, r=jieyouxu
Set the host library path in run-make v2

When the build is configured with `[rust] rpath = false`, we need to set
`LD_LIBRARY_PATH` (or equivalent) to what would have been the `RPATH`,
so the compiler can find its own libraries. The old `tools.mk` code has
this environment prefixed in the `$(BARE_RUSTC)` variable, so we just
need to wire up something similar for run-make v2.

This is now set while building each `rmake.rs` itself, as well as in the
`rust-make-support` helpers for `rustc` and `rustdoc` commands. This is
also available in a `set_host_rpath` function for manual commands, like
in the `compiler-builtins` test.
2024-04-12 04:38:21 +02:00