about summary refs log tree commit diff
path: root/src/tools/run-make-support
AgeCommit message (Collapse)AuthorLines
2025-04-03Add a helper function for checking if LLD was used to `run-make-support`Jakub Beránek-0/+37
2025-04-02Drop `aux_build` rustc helpersJieyou Xu-15/+1
They provide very little value and makes it more confusing than is helpful.
2025-03-18reintroduce remote-test support in run-make testsPietro Albini-1/+14
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-08Don't link against advapi32, except on win7.Steven Malis-10/+14
2025-03-07Temporarily depend on `os_pipe` in `run-make-support` and re-export it许杰友 Jieyou Xu (Joe)-0/+6
For `broken-pipe-no-ice` until std `anonymous_pipe` stabilizes.
2025-03-05Rollup merge of #136581 - jieyouxu:makefile-be-gone, r=Kobzol许杰友 Jieyou Xu (Joe)-108/+0
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-04Rollup merge of #137373 - Kobzol:tool-stage0-improve, r=jieyouxuJubilee-41/+18
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` :laughing: r? ``@jieyouxu``
2025-03-02run-make-support: remove outdated comments许杰友 Jieyou Xu (Joe)-108/+0
2025-03-01Compile run-make recipes using the stage0 compilerJakub Beránek-41/+18
2025-02-26Add new `Rustdoc::emit` method in `run-make-support`Guillaume Gomez-0/+7
2025-02-19Create a generic AVR target: avr-nonePatryk Wychowaniec-0/+7
This commit removes the `avr-unknown-gnu-atmega328` target and replaces it with a more generic `avr-none` variant that must be specialized with the `-C target-cpu` flag (e.g. `-C target-cpu=atmega328p`).
2025-02-13Make `-O` mean `-C opt-level=3`clubby789-1/+1
2025-02-01run-make-support: add some stable `rustc` flag helpers许杰友 Jieyou Xu (Joe)-0/+12
2025-02-01run-make-support: add `shallow_find_directories` helper许杰友 Jieyou Xu (Joe)-5/+22
2025-01-31run-make-support: add `object`-based symbol helpers许杰友 Jieyou Xu (Joe)-9/+25
- `dynamic_symbol_names` - `text_section_global_dynamic_symbol_names` - `global_undefined_dynamic_symbol_names` Also add some missing `#[track_caller]` attributes. Co-authored-by: binarycat <binarycat@envs.net>
2025-01-31run-make-support: add `is_windows_gnu` helper许杰友 Jieyou Xu (Joe)-1/+10
2025-01-31run-make-support: collapse re-export许杰友 Jieyou Xu (Joe)-2/+3
2025-01-31run-make-support: add `-Csymbol-mangling-version` and `-Cprefer-dynamic` ↵许杰友 Jieyou Xu (Joe)-0/+12
helpers to rustc Co-authored-by: binarycat <binarycat@envs.net>
2025-01-29run-make-support: improve docs for `assert_exit_code`许杰友 Jieyou Xu (Joe)-1/+5
2025-01-29run-make-support: add `sysroot` helper许杰友 Jieyou Xu (Joe)-1/+9
Convenience helper for `rustc --print=sysroot`.
2025-01-25Shorten linker output even more when `--verbose` is not presentjyn-1/+7
- Don't show environment variables. Seeing PATH is almost never useful, and it can be extremely long. - For .rlibs in the sysroot, replace crate hashes with a `"-*"` string. This will expand to the full crate name when pasted into the shell. - Move `.rlib` to outside the glob. - Abbreviate the sysroot path to `<sysroot>` wherever it appears in the arguments. This also adds an example of the linker output as a run-make test. Currently it only runs on x86_64-unknown-linux-gnu, because each platform has its own linker arguments. So that it's stable across machines, pass BUILD_ROOT as an argument through compiletest through to run-make tests. - Only use linker-flavor=gnu-cc if we're actually going to compare the output. It doesn't exist on MacOS.
2025-01-22run-make-support: add `set_aux_fd` helper许杰友 Jieyou Xu (Joe)-0/+66
Co-authored-by: Noa <coolreader18@gmail.com> Co-authored-by: Oneirical <manchot@videotron.ca>
2025-01-12Rollup merge of #135411 - Urgau:unreach_pub-run-make, r=jieyouxuGuillaume Gomez-0/+1
run_make_support: add `#![warn(unreachable_pub)]` This PR enables the [`unreachable_pub`](https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#unreachable-pub) lint as warn in the `run_make_support` crate. Related to https://github.com/rust-lang/compiler-team/issues/773 r? ``@jieyouxu``
2025-01-12run_make_support: add `#![warn(unreachable_pub)]`Urgau-0/+1
2025-01-12run-make-support: don't use lossy on `TARGET_RPATH_DIR`许杰友 Jieyou Xu (Joe)-2/+1
2025-01-03run-make-support: tidy up assertion failure dumping许杰友 Jieyou Xu (Joe)-33/+58
Avoid double-dumping or dumping even when assertion is successful.
2025-01-03run-make-support: add basic sanity tests for assertion helpers许杰友 Jieyou Xu (Joe)-0/+103
2025-01-03run-make-support: convert `assertion_helpers` to module许杰友 Jieyou Xu (Joe)-0/+0
2024-12-23run-make-support: re-export `recursive_remove`Jieyou Xu-2/+19
This facade is like other `run_make_support::fs` APIs that panic-on-failure but includes the path that the operation was called on in the panic message.
2024-12-23run_make_support: extract `copy_symlink` helper许杰友 Jieyou Xu (Joe)-26/+44
2024-12-16Rollup merge of #134111 - jyn514:run-make-nocapture, r=jieyouxu许杰友 Jieyou Xu (Joe)-34/+24
Fix `--nocapture` for run-make tests This was confusing because there are three layers of output hiding. 1. libtest shoves all output into a buffer and does not print it unless the test fails or `--nocapture` is passed. 2. compiletest chooses whether to print the output from any given process. 3. run-make-support chooses what output to print. This modifies 2 and 3. - compiletest: Don't require both `--verbose` and `--nocapture` to show the output of run-make tests. - compiletest: Print the output from `rmake` processes if they succeed. Previously this was only printed on failure. - compiletest: Distinguish rustc and rmake stderr by printing the command name (e.g. "--stderr--" to "--rustc stderr--"). - run-make-support: Unconditionally print the needle/haystack being searched. Previously this was only printed on failure. Before: ``` $ x t tests/run-make/linker-warning --force-rerun -- --nocapture running 1 tests . test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 377 filtered out; finished in 281.64ms $ x t tests/run-make/linker-warning --force-rerun -v -- --nocapture 2>&1 | wc -l 1004 $ x t tests/run-make/linker-warning --force-rerun -v -- --nocapture | tail -n40 running 1 tests ------stdout------------------------------ ------stderr------------------------------ warning: unused import: `std::path::Path` --> /home/jyn/src/rust2/tests/run-make/linker-warning/rmake.rs:1:5 | 1 | use std::path::Path; | ^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default warning: unused import: `run_make_support::rfs::remove_file` --> /home/jyn/src/rust2/tests/run-make/linker-warning/rmake.rs:3:5 | 3 | use run_make_support::rfs::remove_file; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: 2 warnings emitted ------------------------------------------ test [run-make] tests/run-make/linker-warning ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 377 filtered out; finished in 285.89ms ``` After: ``` Testing stage1 compiletest suite=run-make mode=run-make (x86_64-unknown-linux-gnu) running 1 tests ------rmake stdout------------------------------ ------rmake stderr------------------------------ assert_contains_regex: === HAYSTACK === error: linking with `./fake-linker` failed: exit status: 1 | = note: LC_ALL="C" PATH="/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin:...:/bin" VSLANG="1033" "./fake-linker" "-m64" "/tmp/rustcYqdAZT/symbols.o" "main.main.d17f5fbe6225cf88-cgu.0.rcgu.o" "main.2uoctswmurc6ir5rvoay0p9ke.rcgu.o" "-Wl,--as-needed" "-Wl,-Bstatic" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-B/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld" "-fuse-ld=lld" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" "-L" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "main" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "run_make_error" = note: error: baz error: aborting due to 1 previous error === NEEDLE === fake-linker.*run_make_error assert_not_contains_regex: === HAYSTACK === === NEEDLE === fake-linker.*run_make_error ------------------------------------------ . test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 377 filtered out; finished in 314.81ms ``` r? `@jieyouxu`
2024-12-14Fix `--nocapture` for run-make testsjyn-34/+24
This was confusing because there are three layers of output hiding. 1. libtest shoves all output into a buffer and does not print it unless the test fails or `--nocapture` is passed. 2. compiletest chooses whether to print the output from any given process. 3. run-make-support chooses what output to print. This modifies 2 and 3. - compiletest: Don't require both `--verbose` and `--nocapture` to show the output of run-make tests. - compiletest: Distinguish rustc and rmake stderr by printing the command name (e.g. "--stderr--" to "--rustc stderr--"). - run-make-support: Unconditionally print the needle/haystack being searched. Previously this was only printed on failure. Before: ``` $ x t tests/run-make/linker-warning --force-rerun -- --nocapture running 1 tests . test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 377 filtered out; finished in 281.64ms $ x t tests/run-make/linker-warning --force-rerun -v -- --nocapture 2>&1 | wc -l 1004 $ x t tests/run-make/linker-warning --force-rerun -v -- --nocapture | tail -n40 running 1 tests ------stdout------------------------------ ------stderr------------------------------ warning: unused import: `std::path::Path` --> /home/jyn/src/rust2/tests/run-make/linker-warning/rmake.rs:1:5 | 1 | use std::path::Path; | ^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default warning: unused import: `run_make_support::rfs::remove_file` --> /home/jyn/src/rust2/tests/run-make/linker-warning/rmake.rs:3:5 | 3 | use run_make_support::rfs::remove_file; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: 2 warnings emitted ------------------------------------------ test [run-make] tests/run-make/linker-warning ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 377 filtered out; finished in 285.89ms ``` After: ``` Testing stage1 compiletest suite=run-make mode=run-make (x86_64-unknown-linux-gnu) running 1 tests ------rmake stdout------------------------------ ------rmake stderr------------------------------ assert_contains_regex: === HAYSTACK === error: linking with `./fake-linker` failed: exit status: 1 | = note: LC_ALL="C" PATH="/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin:...:/bin" VSLANG="1033" "./fake-linker" "-m64" "/tmp/rustcYqdAZT/symbols.o" "main.main.d17f5fbe6225cf88-cgu.0.rcgu.o" "main.2uoctswmurc6ir5rvoay0p9ke.rcgu.o" "-Wl,--as-needed" "-Wl,-Bstatic" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-B/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld" "-fuse-ld=lld" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" "-L" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "main" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "run_make_error" = note: error: baz error: aborting due to 1 previous error === NEEDLE === fake-linker.*run_make_error assert_not_contains_regex: === HAYSTACK === === NEEDLE === fake-linker.*run_make_error ------------------------------------------ . test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 377 filtered out; finished in 314.81ms ```
2024-12-14don't show the full linker args unless `--verbose` is passedjyn-0/+6
the linker arguments can be *very* long, especially for crates with many dependencies. some parts of them are not very useful. unless specifically requested: - omit object files specific to the current invocation - fold rlib files into a single braced argument (in shell expansion format) this shortens the output significantly without removing too much information.
2024-12-10Rollup merge of #134113 - jyn514:run-make-contains, r=jieyouxuLeón Orell Valerian Liehr-1/+1
run-make: Fix `assert_stderr_not_contains_regex` It asserted on **stdout**, not stderr. r? ``@jieyouxu``
2024-12-10run-make: Fix `assert_stderr_not_contains_regex`jyn-1/+1
It asserted on **stdout**, not stderr.
2024-12-01Run `cargo update` and update licensesclubby789-1/+1
2024-11-29Move the `crate-loading` test to use `diff` outputEsteban Küber-0/+6
2024-11-17Auto merge of #132646 - jieyouxu:liberate-aarch64-gnu-debug, r=Kobzolbors-101/+175
Liberate `aarch64-gnu-debug` from the shackles of `--test-args=clang` ### Changes - Drop `--test-args=clang` from `aarch64-gnu-debug` so run-make tests that are `//@ needs-force-clang-based-tests` no longer only run if their test name contains `clang` (which is a very cool footgun). - Reorganize run-make-suport library slightly to accommodate a raw gcc invocation. - Fix `tests/run-make/mte-ffi/rmake.rs` to use `gcc` instead of *a* c compiler. try-job: aarch64-gnu try-job: aarch64-gnu-debug
2024-11-12Rollup merge of #132657 - mustartt:aix-run-make-support, r=jieyouxuMatthias Krüger-12/+19
AIX: add run-make support On AIX, we are required explicit link against `c++` and `c++abi` to support running the run-make test suite.
2024-11-12tests/run-make: update `mte-ffi` to use `gcc` as the c compiler explicitlyJieyou Xu-8/+3
2024-11-12run_make_support: add a `gcc` wrapper commandJieyou Xu-101/+180
2024-11-11move `src/tools/build_helper` into `src/build_helper`onur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-11-10refactor flagsHenry Jiang-11/+9
2024-11-08Add a run-make test for `rustc --help` and similarZalathar-0/+1
2024-11-05fix missing use declHenry Jiang-1/+1
2024-11-05add run-make support for aixHenry Jiang-1/+10
2024-10-27Dynamically link run-make supportclubby789-0/+3
2024-10-22run-make-support: add `llvm-dis` and `llvm-objcopy`许杰友 Jieyou Xu (Joe)-4/+73
2024-10-22run_make_support: allow obtaining raw stdout/stderr许杰友 Jieyou Xu (Joe)-0/+18
And match `stdout/stderr` lossy UTF-8 helpers.
2024-10-12Avoid cross-file glob importZalathar-1/+1