bors
17edacef07
Auto merge of #113026 - jieyouxu:run-make-v2, r=bjorn3
...
Introduce `run-make` V2 infrastructure, a `run_make_support` library and port over 2 tests as example
## Preface
See [issue #40713 : Switch run-make tests from Makefiles to rust](https://github.com/rust-lang/rust/issues/40713 ) for more context.
## Basic Description of `run-make` V2
`run-make` V2 aims to eliminate the dependency on `make` and `Makefile`s for building `run-make`-style tests. Makefiles are replaced by *recipes* (`rmake.rs`). The current implementation runs `run-make` V2 tests in 3 steps:
1. We build the support library `run_make_support` which the `rmake.rs` recipes depend on as a tool lib.
2. We build the recipe `rmake.rs` and link in the support library.
3. We run the recipe to build and run the tests.
`rmake.rs` is basically a replacement for `Makefile`, and allows running arbitrary Rust code. The support library is built using cargo, and so can depend on external crates if desired.
The infrastructure implemented by this PR is very barebones, and is the minimally required infrastructure needed to build, run and pass the two example `run-make` tests ported over to the new infrastructure.
### Example `run-make` V2 test
```rs
// ignore-tidy-linelength
extern crate run_make_support;
use std::path::PathBuf;
use run_make_support::{aux_build, rustc};
fn main() {
aux_build()
.arg("--emit=metadata")
.arg("stable.rs")
.run();
let mut stable_path = PathBuf::from(env!("TMPDIR"));
stable_path.push("libstable.rmeta");
let output = rustc()
.arg("--emit=metadata")
.arg("--extern")
.arg(&format!("stable={}", &stable_path.to_string_lossy()))
.arg("main.rs")
.run();
let stderr = String::from_utf8_lossy(&output.stderr);
let version = include_str!(concat!(env!("S"), "/src/version"));
let expected_string = format!("stable since {}", version.trim());
assert!(stderr.contains(&expected_string));
}
```
## Follow Up Work
- [ ] Adjust rustc-dev-guide docs
2024-03-01 16:43:57 +00:00
..
2024-02-29 16:30:38 +00:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-06-19 17:31:54 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-05-05 18:32:20 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-05-02 12:07:55 +00:00
2023-05-02 12:07:55 +00:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-07-21 22:01:50 +02:00
2023-03-30 08:46:31 -05:00
2023-04-02 17:54:24 -04:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-11-21 22:40:16 +01:00
2024-02-22 16:04:04 +00:00
2023-04-21 16:14:44 +00:00
2023-03-30 07:34:55 -05:00
2023-04-24 01:56:37 +02:00
2023-03-30 07:34:55 -05:00
2023-11-02 18:41:33 +11:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2024-02-29 16:30:38 +00:00
2023-05-02 12:07:55 +00:00
2023-05-17 11:39:11 +02:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-06-17 17:20:02 -07:00
2023-06-17 17:20:02 -07:00
2023-10-17 17:31:47 +00:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-09-10 15:50:48 +00:00
2023-03-30 07:58:50 -05:00
2023-10-17 19:53:51 -04:00
2023-11-24 19:15:52 +01:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-07-19 14:10:07 +00:00
2024-02-22 16:04:04 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-07-19 14:47:05 +00:00
2023-03-30 07:34:55 -05:00
2023-07-14 16:22:29 -04:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-07-10 19:19:38 -04:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-04-03 01:34:05 +00:00
2023-05-07 12:38:47 +01:00
2023-05-02 12:07:55 +00:00
2023-05-02 12:07:55 +00:00
2023-05-02 12:07:55 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:34:55 -05:00
2023-04-28 16:11:45 +02:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-09-20 18:50:40 +02:00
2023-03-30 07:58:50 -05:00
2023-05-19 11:02:16 +02:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-10-17 19:53:51 -04:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2024-02-22 16:04:04 +00:00
2023-04-25 00:08:35 +02:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-04-25 00:08:35 +02:00
2023-05-23 07:37:16 +00:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-09-20 22:09:48 -07:00
2023-03-30 08:46:31 -05:00
2023-04-17 18:53:52 +02:00
2023-05-03 15:52:31 -07:00
2023-12-08 09:50:28 +08:00
2023-03-30 08:46:31 -05:00
2023-07-29 11:42:50 +02:00
2023-07-29 11:42:50 +02:00
2023-12-07 19:24:58 +01:00
2023-04-03 01:34:05 +00:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-07-21 22:01:50 +02:00
2023-03-30 07:58:50 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-09-10 15:50:48 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-09-11 22:01:55 +08:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-09-23 19:14:25 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:34:55 -05:00
2023-10-07 08:30:40 +02:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-07-19 14:47:05 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-05-11 14:47:56 +00:00
2023-07-18 22:15:47 +08:00
2024-01-12 18:23:04 +08:00
2023-07-19 14:47:05 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-07-02 13:41:36 +02:00
2023-08-18 09:41:08 +02:00
2023-03-30 07:34:55 -05:00
2023-09-10 15:50:48 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-11-24 19:15:52 +01:00
2023-08-18 13:51:42 +01:00
2023-03-30 07:58:50 -05:00
2023-11-30 08:26:13 -08:00
2023-11-30 08:26:13 -08:00
2023-11-30 08:26:13 -08:00
2023-03-30 08:46:31 -05:00
2023-09-08 00:28:40 +02:00
2023-08-30 13:45:57 +02:00
2023-08-30 13:45:57 +02:00
2023-08-30 13:45:57 +02:00
2023-03-30 07:34:55 -05:00
2023-08-30 13:45:57 +02:00
2023-08-30 13:45:57 +02:00
2023-08-30 13:45:57 +02:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:34:55 -05:00
2023-08-04 20:13:40 +02:00
2023-03-30 07:58:50 -05:00
2023-09-07 15:07:30 +02:00
2023-07-12 20:04:30 +02:00
2023-03-30 07:34:55 -05:00
2023-08-30 13:45:57 +02:00
2023-03-30 08:46:31 -05:00
2023-10-07 08:30:40 +02:00
2024-01-06 18:46:35 +03:00
2023-04-18 11:01:07 -07:00
2023-04-18 11:01:07 -07:00
2023-10-07 08:30:40 +02:00
2024-01-06 18:46:35 +03:00
2024-01-06 18:46:35 +03:00
2023-10-07 08:30:40 +02:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-10-17 10:11:31 +02:00
2023-10-17 10:11:31 +02:00
2023-03-30 07:58:50 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-08-15 15:51:18 -05:00
2023-07-19 14:47:06 +00:00
2023-06-30 21:13:24 +00:00
2024-01-31 15:15:59 +01:00
2023-12-11 09:19:09 +11:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-06-16 20:56:01 -04:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-04-12 05:34:21 -05:00
2024-01-31 15:15:59 +01:00
2023-09-15 07:40:17 -07:00
2023-04-13 21:58:35 +02:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2024-01-03 10:00:15 -08:00
2024-01-03 10:00:15 -08:00
2024-01-03 10:00:15 -08:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-07-20 14:31:56 +02:00
2023-10-07 08:30:40 +02:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2024-01-23 11:07:48 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-04-03 10:23:08 +02:00
2023-05-02 12:07:55 +00:00
2023-03-30 07:34:55 -05:00
2023-04-27 18:22:06 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2024-01-26 12:39:03 +08:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-06-16 20:56:01 -04:00
2023-03-30 07:34:55 -05:00
2024-01-31 15:15:59 +01:00
2023-03-30 07:34:55 -05:00
2023-05-02 12:07:55 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-04-19 00:39:20 -05:00
2023-03-30 07:34:55 -05:00
2023-11-24 19:15:52 +01:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-11-30 17:28:29 +11:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2024-02-26 11:10:18 +01:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-10-09 11:42:23 +09:00
2023-03-30 07:58:50 -05:00
2024-01-12 18:23:04 +08:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-04-25 00:08:35 +02:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:34:55 -05:00
2023-03-30 07:34:55 -05:00
2023-10-24 13:42:28 -07:00
2023-03-30 07:34:55 -05:00
2023-03-30 08:46:31 -05:00
2023-06-05 17:33:26 +02:00
2024-02-25 22:28:30 -03:00