about summary refs log tree commit diff
path: root/src/tools/run-make-support
AgeCommit message (Collapse)AuthorLines
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
2024-10-12Flatten redundant test module `run_make_support::diff::tests::tests`Zalathar-36/+30
2024-10-07Migrate `emit-to-stdout` to new run-makeclubby789-3/+3
Co-authored-by: Oneirical <manchot@videotron.ca> Co-authored-by: Chris Denton <chris@chrisdenton.dev>
2024-10-07Add stdio configuring to run-make Rustcclubby789-0/+24
2024-09-24Fix `run-make-support` to respect per-stage cargo许杰友 Jieyou Xu (Joe)-2/+3
2024-09-16run_make_support: rectify symlink handling许杰友 Jieyou Xu (Joe)-50/+130
Avoid confusing Unix symlinks and Windows symlinks, and since their semantics are quite different we should avoid trying to make it to automagic in how symlinks are created and deleted. Notably, the tests should reflect what type of symlinks are to be created to match what std does to make it less surprising for test readers.
2024-09-12Rollup merge of #130156 - nebulark:test_buildinfo, r=jieyouxuStuart Cook-0/+6
Add test for S_OBJNAME & update test for LF_BUILDINFO cl and cmd Update the unit test for checking cl and cmd in LF_BUILDINFO. With llvm-pdbutil we can now more specifically check if the string appears at the right location instead of just checking whether the string exists at all. Context: https://github.com/rust-lang/rust/issues/96475
2024-09-10Add test for S_OBJNAME and update test for LF_BUILDINFO cl and cmd forFlorian Schmiderer-0/+6
pdb files.
2024-09-09Rollup merge of #129529 - lqd:stable-new-solver, r=KobzolJubilee-3/+16
Add test to build crates used by r-a on stable r? ````````@Kobzol```````` I've opened other PRs for this one to work and they've landed already. I cherry-picked your commit, and added the last remaining pieces we needed I think.
2024-09-09Rollup merge of #130068 - madsmtm:deployment-target-test, r=jieyouxuJubilee-1/+19
Test codegen when setting deployment target Test our codegen in different scenarios when setting the deployment target. There are many places here where this is still incorrect, these will be fixed in https://github.com/rust-lang/rust/pull/129342, https://github.com/rust-lang/rust/pull/129367 and https://github.com/rust-lang/rust/pull/129369. See https://github.com/rust-lang/rust/issues/129432 for the bigger picture. Tested locally using: ```console ./x test tests/run-make/apple-deployment-target --target="aarch64-apple-darwin,aarch64-apple-ios,aarch64-apple-ios-macabi,aarch64-apple-ios-sim,aarch64-apple-tvos,aarch64-apple-tvos-sim,aarch64-apple-visionos,aarch64-apple-visionos-sim,aarch64-apple-watchos,aarch64-apple-watchos-sim,arm64_32-apple-watchos,armv7s-apple-ios,i386-apple-ios,x86_64-apple-darwin,x86_64-apple-ios,x86_64-apple-ios-macabi,x86_64-apple-tvos,x86_64-apple-watchos-sim,x86_64h-apple-darwin" ``` The only Apple targets that aren't tested by the above command are: - `arm64e-apple-darwin`, failed to build, see https://github.com/rust-lang/cc-rs/issues/1205. - `armv7k-apple-watchos`, failed to link, see https://github.com/rust-lang/rust/issues/130071. - `arm64e-apple-ios`, failed to link, see https://github.com/rust-lang/rust/issues/130085. - `i686-apple-darwin`, requires a bit of setup and an older machine, see [the docs](https://doc.rust-lang.org/nightly/rustc/platform-support/i686-apple-darwin.html). - `i386-apple-ios` requires you to set `IPHONEOS_DEPLOYMENT_TARGET=10.0` for the test helpers to work, will be fixed by https://github.com/rust-lang/cc-rs/issues/1030. But all of this is as it was before this PR. Fixes https://github.com/rust-lang/rust/issues/47825, since we now have a test that compiles a `dylib` for `aarch64-apple-ios`. Split out from https://github.com/rust-lang/rust/pull/129342, see that for a little bit of the review that this has gone through already. r? petrochenkov ```@rustbot``` label O-apple
2024-09-08run-make-support: Add llvm-pdbutilFlorian Schmiderer-0/+24
2024-09-07Test codegen when setting deployment targetMads Marquart-1/+19
2024-09-05run_make_support: make each command invocation only-run-once许杰友 Jieyou Xu (Joe)-1/+16
2024-09-05run_make_support: rename `Command::stdin` to `stdin_buf` and add ↵许杰友 Jieyou Xu (Joe)-22/+67
`std{in,out,err}` config helpers Previously `Command::stdin` was actually just a stdin buffer helper, but this is different from `std::process::Command::stdin`. This is needlessly confusing, and blocks support to add `std{in,out,err}` config that tests may want to use to e.g. redirect to `/dev/ptmx`.
2024-08-29Update the `wasm-component-ld` binary dependencyAlex Crichton-1/+1
This keeps it up-to-date by moving from 0.5.6 to 0.5.7. While here I've additionally updated some other wasm-related dependencies in the workspace to keep them up-to-date and try to avoid duplicate versions as well.
2024-08-26Add a run-make test for checking that certain `rustc_` crates build on stableJakub Beránek-3/+16
2024-08-23Auto merge of #128507 - Oneirical:testart-from-scratch, r=jieyouxubors-0/+2
Migrate `libtest-thread-limit` `run-make` test 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). Please try, but **only if normal CI is green**: // try-job: armhf-gnu // <- failed on this try-job: aarch64-gnu
2024-08-23rewrite libtest-thread-limit to rmakeOneirical-0/+2
2024-08-23Rollup merge of #129433 - GrigorenkoPV:run-make-support-path-rustdoc, r=jieyouxuMatthias Krüger-0/+1
Fix a missing import in a doc in run-make-support