Commit Graph

362 Commits

Author SHA1 Message Date
Jynn Nelson 00dae097c4 Print the command and output even if it succeeds
Previously, it was quite hard to get access to this output because it
was printed to a buffer in memory and then discarded. This output is
already hidden behind libtest's output capturing, we don't need to hide
it twice.
2026-03-15 17:56:50 +01:00
Josh Stone eb093cfd5d Reformat with the new stage0 2026-03-07 10:42:02 -08:00
Folkert de Vries b6fb48654e add rustc_minicore helper function 2026-03-04 13:38:52 +01:00
Folkert de Vries 66246a61fd use minicore in some run-make tests 2026-03-04 12:28:18 +01:00
Folkert de Vries 2d8ceee19c add tests for a thumb program calling arm code
and in particular for naked functions in that scenario
2026-03-02 10:53:51 +01:00
Zalathar 2c89741a35 Overhaul tests/run-make/short-ice to make it easier to read 2026-02-04 23:41:48 +11:00
Ben Kimock df386c5b48 Test that -Zbuild-std=core works on a variety of profiles 2026-01-14 20:39:12 -05:00
Jieyou Xu dd948f96f3 Thread --jobs from bootstrap -> compiletest -> run-make-support 2026-01-06 14:51:51 +08:00
Urgau 1b8ee46683 Add needs-std-remap-debuginfo directive to compiletest & run-make 2025-12-22 17:55:25 +01:00
Brian Cain bf9a874b26 Correct library linking for hexagon targets in run-make tests
Fixes the run-make test framework to use target-specific library linking
instead of host-based detection. Previously, tests for hexagon targets
failed because the framework used uname() to detect libraries to link,
which returned Linux libraries (-lm -lrt -ldl -lpthread) that don't
exist on all hexagon targets.

- Use target() instead of uname() to detect cross-compilation targets
- Add hexagon-specific library configuration (-lunwind -lclang_rt.builtins-hexagon)
- Maintain backward compatibility for host-native compilation

This enables hexagon tests to compile and link successfully with the
appropriate runtime libraries for the hexagon platform.
2025-12-14 19:52:50 -06:00
Alona Enraght-Moony 8c569c1416 run-make-support: re-export rustdoc_json_types
This is useful for allowing writing run-make tests that test
rustdoc-json.
2025-11-19 19:36:43 +00:00
Guillaume Gomez 2c3c82c4c5 Add new run_make_support::CompletedProcess::assert_ice method 2025-11-05 22:43:25 +01:00
Augie Fackler eb3fb457f1 split-dwarf: add documentation and test coverage 2025-09-26 16:02:59 -04:00
Jieyou Xu aebcbe0a4b run-make-support: handle unavailable in-tree cargo under run-make test suite 2025-09-05 21:22:50 +08:00
Nicholas Nethercote 301655eafe Revert introduction of [workspace.dependencies].
This was done in #145740 and #145947. It is causing problems for people
using r-a on anything that uses the rustc-dev rustup package, e.g. Miri,
clippy.

This repository has lots of submodules and subtrees and various
different projects are carved out of pieces of it. It seems like
`[workspace.dependencies]` will just be more trouble than it's worth.
2025-09-02 19:12:54 +10:00
Nicholas Nethercote daf6fe2c1b Add serde_json to [workspace.dependencies]. 2025-08-28 20:10:54 +10:00
Nicholas Nethercote 12dc789bc6 Add libc to [workspace.dependencies]. 2025-08-28 20:10:54 +10:00
StackOverflowExcept1on f978932903 fix(compiler/rustc_codegen_llvm): apply target-cpu attribute 2025-08-13 17:49:06 +00:00
ywxt bc8a521619 Fix pgo tests 2025-08-13 09:42:46 +08:00
Stuart Cook 2edfd36361 Rollup merge of #144931 - dpaoliello:msvc-wholearchive, r=jieyouxu
[win][arm64ec] Fix msvc-wholearchive for Arm64EC

`msvc-wholearchive` was failing on Arm64EC Windows as it requires the `/MACHINE:ARM64EC` flag to be passed to the MSVC linker.

This required splitting the `extra_c_flags` function into a new `extra_linker_flags` function as `/MACHINE:ARM64EC` is not a valid argument to be passed to the MSVC Compiler (instead, `/arm64EC` should be used).
2025-08-08 12:52:54 +10:00
Zalathar f96fbb214b run-make: Allow blessing snapshot files that don't exist yet
This makes it possible to bless the snapshot files used by `diff()` in
newly-created run-make tests, without having to create the files manually
beforehand.
2025-08-06 11:17:56 +10:00
Daniel Paoliello 36383dd2b8 [win][arm64ec] Fix msvc-wholearchive for Arm64EC 2025-08-04 17:05:20 -07:00
Curtis D'Alves 37d52ed092 add correct dynamic_lib_extension for aix 2025-07-31 15:49:23 -04:00
Flakebi 7a127fba65 Fix linker-plugin-lto only doing thin lto
When rust provides LLVM bitcode files to lld and the bitcode contains
function summaries as used for thin lto, lld defaults to using thin lto.
This prevents some optimizations that are only applied for fat lto.

We solve this by not creating function summaries when fat lto is
enabled. The bitcode for the module is just directly written out.

An alternative solution would be to set the `ThinLTO=0` module flag to
signal lld to do fat lto.
The code in clang that sets this flag is here:
https://github.com/llvm/llvm-project/blob/560149b5e3c891c64899e9912e29467a69dc3a4c/clang/lib/CodeGen/BackendUtil.cpp#L1150
The code in LLVM that queries the flag and defaults to thin lto if not
set is here:
https://github.com/llvm/llvm-project/blob/e258bca9505f35e0a22cb213a305eea9b76d11ea/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp#L4441-L4446
2025-07-31 10:38:34 +02:00
Jens Reidel a546a7cb25 Fix run-make tests on musl hosts
On musl hosts, we already set -Ctarget-feature=-crt-static and
IS_MUSL_HOST=1 in compiletest. However, in order for the run-make tests
to compile fine on musl hosts, we need to propagate this flag in our
rustc invocations to ensure we can generate cdylibs.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-21 02:14:01 +02:00
Samuel Tardieu b89c63de0e Rollup merge of #143837 - jieyouxu:symbol-apis, r=ChrisDenton
Adjust `run_make_support::symbols` helpers

Massage the `symbols` helpers to fill out {match all, match any} x {substring match, exact match}:

|           | Substring match                        | Exact match                   |
|-----------|----------------------------------------|-------------------------------|
| Match any | `object_contains_any_symbol_substring` | `object_contains_any_symbol`  |
| Match all | `object_contains_all_symbol_substring` | `object_contains_all_symbols` |

As I'd like to use `object_contains_all_symbols` for rust-lang/rust#143669.

As part of this:

- Rename `any_symbol_contains` to `object_contains_any_symbol_substring` for accuracy, as `any_symbol_contains` is actually "contains any matching substring".
- Remove `with_symbol_iter`.

Noticed while working on https://github.com/rust-lang/rust/pull/143669.

r? ``@ChrisDenton`` (or compiler)
2025-07-15 12:52:39 +02:00
Jieyou Xu afeed50677 Adjust run_make_support::symbols helpers
Massage the `symbols` helpers to fill out {match all, match any} x
{substring match, exact match}:

|           | Substring match                        | Exact match                   |
|-----------|----------------------------------------|-------------------------------|
| Match any | `object_contains_any_symbol_substring` | `object_contains_any_symbol`  |
| Match all | `object_contains_all_symbol_substring` | `object_contains_all_symbols` |

As part of this, rename `any_symbol_contains` to
`object_contains_any_symbol_substring` for accuracy.
2025-07-13 14:28:41 +08:00
Jieyou Xu 120c9fcb86 Disambiguate between rustc vs std having debug assertions
Additionally, `NO_DEBUG_ASSERTIONS` is set by CI that threads through to
the `./configure` script, which is somewhat fragile and "spooky action
at a distance". Instead, use env vars controlled by compiletest, whose
debug assertion info comes from bootstrap.
2025-07-11 19:58:22 +08:00
Jieyou Xu 87a41210d4 Only provide is_windows_msvc to gate on windows-msvc
And not both `is_windows_msvc` and `is_msvc`.
2025-07-10 13:54:43 +08:00
Jieyou Xu 200f132367 Massage lib.rs so it can be rustfmt'd
Even if the formatting isn't strictly "better", it at least allows
rustfmtting it automatically.
2025-07-09 20:30:49 +08:00
Jieyou Xu fae15466aa Sort and document run-make-support dependencies 2025-07-09 20:10:32 +08:00
Jieyou Xu e70493d06c Bump run-make-support to Edition 2024 2025-07-09 20:07:09 +08:00
Jieyou Xu ed520af279 Don't attempt to version run-make-support
Purely internal test support library.
2025-07-09 20:05:13 +08:00
Jieyou Xu 8d58d5e800 Remove run-make-support CHANGELOG
Hopelessly outdated, and this support library is purely internal.
2025-07-09 20:02:36 +08:00
Trevor Gross 18a621abe4 Upgrade dependencies in run-make-support
The main purpose of this is to upgrade `object` and `gimli`, which will
allow us to drop outdated versions once backtrace also updates.
The only semver breakage in `object`'s is in `elf::R_RISCV_GNU_*` and
`pe::IMAGE_WEAK_EXTERN_*` constants, as well as Mach-O dyld, which don't
appear to be used here. `gimli` is similar, there is only minor breakage
related to dyld.

These version upgrades were also done in the library.

`bstr`, `similar`, and `regex` are also upgraded to the latest minor
version here to match what the lockfile already uses. The `regex`
comment about `memchr` version hasn't been relevant to this lockfile
since e95d15a115 ("Pin memchr to 2.5.0 in the library rather than
rustc_ast") and is no longer relevant in the library lockfile either.

Object Changelog: https://github.com/gimli-rs/object/blob/master/CHANGELOG.md#0370
Gimli changelog: https://github.com/gimli-rs/gimli/blob/master/CHANGELOG.md#0320
2025-06-30 15:46:36 -05:00
Daniel Paoliello 81a7cb6718 Enable reproducible-build-2 for Windows 2025-06-23 14:34:08 -07:00
Folkert de Vries 0d4abfc7cc forward the bootstrap runner to run-make
The runner was already forwarded to `compiletest`, this just passes it on to `run-make` and uses it in the `run` functions.
2025-06-22 01:37:51 +02:00
Jieyou Xu 49be6f3258 Enable run-make-support auto cross-compilation for rustdoc too 2025-06-18 18:39:28 +08:00
Jakub Beránek a27bdea4b7 Enable automatic cross-compilation in run-make tests 2025-06-18 18:39:25 +08:00
Jieyou Xu d9f513f0da run-make-support: support "ejecting" the underlying std command
In rare cases, the test may need access to the underlying
`std::process::Command` (e.g. for non-trivial process spawning).

Co-authored-by: Jesus Checa Hidalgo <jchecahi@redhat.com>
2025-05-09 19:54:35 +08:00
Jesus Checa Hidalgo cd2dc67ead run-make-support: set rustc dylib path for cargo wrapper
Some run-make tests invoke Cargo via run_make_support::cargo(), but fail to
execute correctly when rustc is built without rpath. In these setups, runtime
loading of rustc’s shared libraries fails unless the appropriate dynamic library
path is set manually.

This commit updates the cargo() wrapper to call set_host_compiler_dylib_path(),
aligning its behavior with the existing rustc() wrapper:
https://github.com/rust-lang/rust/blob/f76c7367c6363d33ddb5a93b5de0d158b2d827f6/src/tools/run-make-support/src/external_deps/rustc.rs#L39

This ensures that Cargo invocations during tests inherit the necessary dylib
paths, avoiding errors related to missing shared libraries in rpath-less builds.

Fixes part of #140738
2025-05-07 16:32:46 +02:00
Jieyou Xu 83af9f57c1 run-make: drop os_pipe workaround now that anonymous_pipe is stable on beta 2025-04-17 23:23:30 +08:00
Jieyou Xu 41931320f8 run-make-support: fix artifact name calculations for target
This was implemented incorrectly during the porting process, where we
relied on std consts. However, `run-make-support` is a host-only
library, which meant that these artifact names were for the *host* and
not the *target*.
2025-04-12 14:48:01 +08:00
Jakub Beránek 6af96f873a Add a helper function for checking if LLD was used to run-make-support 2025-04-03 15:40:23 +02:00
Jieyou Xu b591eb022d Drop aux_build rustc helpers
They provide very little value and makes it more confusing than is
helpful.
2025-04-02 15:39:55 +08:00
Pietro Albini 5fe1e47f80 reintroduce remote-test support in run-make tests
The old Makefile-based infrastructure included support for executing
binaries with remote-test-client if configured, but that didn't get
ported to run_make_support as part of the rmake migration.

This PR re-introduces back that support, with the same implementation
(and limitations) of the original Makefile-based support.
2025-03-18 10:10:50 +01:00
Steven Malis 9278a3ebd6 Don't link against advapi32, except on win7. 2025-03-08 10:55:47 -05:00
许杰友 Jieyou Xu (Joe) d47e5a371b Temporarily depend on os_pipe in run-make-support and re-export it
For `broken-pipe-no-ice` until std `anonymous_pipe` stabilizes.
2025-03-07 19:08:11 +08:00
许杰友 Jieyou Xu (Joe) 65da1ffe41 Rollup merge of #136581 - jieyouxu:makefile-be-gone, r=Kobzol
Retire the legacy `Makefile`-based `run-make` test infra

The final piece of [porting run-make tests to use Rust #121876](https://github.com/rust-lang/rust/issues/121876).
Closes #121876.
Closes #40713.
Closes #81791 (no longer using `wc`).
Closes #56475 (no longer a problem in current form of that test; we don't ignore the test on `aarch64-unknown-linux-gnu`).

### Summary

This PR removes the legacy `Makefile`-based `run-make` test infra which has served us well over the years. The legacy infra is no longer needed since we ported all of `Makefile`-based `run-make` tests to the new `rmake.rs` infra.

Additionally, this PR:

- Removes `tests/run-make/tools.mk` since no more `Makefile`-based tests remain.
- Updates `tests/run-make/README.md` and rustc-dev-guide docs to remove mention about `Makefile`-based `run-make` tests
- Update test suite requirements in rustc-dev-guide on Windows to no longer need MSYS2 (they should also now run successfully on native Windows MSVC).
- Update `triagebot.toml` to stop backlinking to #121876.

**Thanks to everyone who helped in this effort to modernize the `run-make` test infra and test suite!**

r? bootstrap
2025-03-05 21:46:32 +08:00
Jubilee e5ac9f89eb Rollup merge of #137373 - Kobzol:tool-stage0-improve, r=jieyouxu
Compile run-make-support and run-make tests with the bootstrap compiler

It does not seem necessary to have to recompile run-make-support on changes to the local compiler/stdlib. This PR simplifies the implementation of a few tools, then switches rms to stage0 and also makes the handling of environment variables in run-make tests simpler.

Best reviewed commit-by-commit. I can split it into multiple PRs if you want.

Also tested that `COMPILETEST_FORCE_STAGE0=1 ./x test tests/run-make --stage 0` still works. Incredibly, it looks like it even passes more tests than on `master` 😆

r? ``@jieyouxu``
2025-03-04 14:50:39 -08:00