bors
d7bffc302e
Auto merge of #14280 - Flowrey:dry-run-install, r=weihanglo
...
Add a `--dry-run` flag to the `install` command
### What does this PR try to resolve?
This PR add the `--dry-run` flag to the `cargo install` command (see #11123 ).
I've tried to do the bare minimal for this flag to work without changing anything in the output.
In my opinion, the `--dry-run` flag should mimic as close as possible the behavior of the normal command to avoid missing potential issue in the normal execution. ~~Currently we're missing information about where the binary will be installed.~~
Unlike #13598 this PR:
- Include as much of the compilation process as possible without actually compiling
- use the information provided by `BuildContext` instead of `InstallablePackage::new`
- in the same way as `unit_graph`, it add a `dry_run` to the `CompileOptions` and return a `Compilation::new` from the function `compile_ws` without actually compiling.
- keeps the output the same rather than adding status messages indicating which very broad actions would be performed
- ~~remove some warning not relevant in the case of a `--dry-run`~~
Like #13598 , the version check and crate downloads still occur.
### How should we test and review this PR?
The first commit include a unit tests to ensure that no binary is actually installed after the dry run.
There is also a snapshot test that show the diff output of the `--help` flag.
### Additional information
Tests and documentation done in #13598 , may be cherry picked into this PR if needed.
2024-09-21 00:35:19 +00:00
..
2024-07-24 16:36:30 +07:00
2024-09-06 10:01:49 -07:00
2024-08-03 16:40:10 -07:00
2024-08-03 16:40:10 -07:00
2024-08-03 16:40:10 -07:00
2024-08-03 16:40:10 -07:00
2024-07-24 10:42:50 -05:00
2024-08-03 16:40:10 -07:00
2024-08-03 16:40:10 -07:00
2024-08-03 16:40:10 -07:00
2024-08-03 16:40:10 -07:00
2024-05-27 21:27:03 -05:00
2024-05-27 21:27:03 -05:00
2024-09-17 23:53:39 +08:00
2024-07-18 20:52:22 -05:00
2024-09-21 01:10:19 +02:00
2024-05-27 21:27:03 -05:00
2024-05-27 21:27:03 -05:00
2024-05-27 21:27:03 -05:00
2024-08-03 16:40:10 -07:00
2024-09-06 09:45:19 -05:00
2024-05-27 21:27:03 -05:00
2024-08-03 16:40:10 -07:00
2024-08-03 16:40:10 -07:00
2024-08-03 16:40:10 -07:00
2024-05-27 21:27:03 -05:00
2024-08-03 16:40:10 -07:00
2024-05-27 21:27:03 -05:00
2024-08-03 16:40:10 -07:00
2024-08-03 16:40:10 -07:00
2024-08-03 16:40:10 -07:00
2024-05-27 21:27:03 -05:00
2024-08-03 16:40:10 -07:00
2024-08-03 16:40:10 -07:00
2024-05-27 21:27:03 -05:00
2024-08-03 16:40:10 -07:00
2024-08-03 16:40:10 -07:00
2024-05-27 21:27:03 -05:00
2024-05-27 21:27:03 -05:00
2024-05-27 21:27:03 -05:00
2024-09-02 15:18:01 -07:00
2024-08-05 23:35:29 -04:00
2024-07-12 15:57:00 -05:00
2024-08-22 16:57:06 -05:00
2024-08-22 16:57:06 -05:00
2024-07-12 15:57:00 -05:00
2024-08-22 16:57:06 -05:00
2024-07-24 10:42:51 -05:00
2024-08-22 16:57:06 -05:00
2024-07-24 10:42:51 -05:00
2024-07-24 10:42:50 -05:00
2024-07-12 15:57:00 -05:00
2024-08-22 16:57:06 -05:00
2024-08-22 16:57:06 -05:00
2024-08-22 16:57:06 -05:00
2024-07-18 15:22:29 -05:00
2024-08-22 16:57:06 -05:00
2024-07-12 15:57:00 -05:00
2024-07-18 15:22:29 -05:00
2024-07-12 15:57:00 -05:00
2024-08-22 16:57:06 -05:00
2024-07-12 15:57:00 -05:00
2024-08-30 09:26:56 -05:00
2024-09-19 15:52:49 +02:00
2024-08-22 16:57:06 -05:00
2024-07-18 15:22:29 -05:00
2024-08-30 09:26:56 -05:00
2024-07-19 10:50:42 -05:00
2024-07-12 15:57:00 -05:00
2024-07-12 15:57:00 -05:00
2024-07-12 15:57:00 -05:00
2024-07-12 15:57:00 -05:00
2024-09-06 13:25:55 -05:00
2024-08-22 16:57:06 -05:00
2024-07-12 15:57:00 -05:00
2024-07-12 15:57:00 -05:00
2024-07-12 15:57:00 -05:00
2024-07-18 15:22:29 -05:00
2024-07-12 15:57:00 -05:00
2024-08-30 09:26:56 -05:00
2024-08-30 09:26:56 -05:00
2024-08-22 16:57:06 -05:00
2024-08-22 16:57:06 -05:00
2024-07-12 15:57:00 -05:00
2024-07-12 15:57:00 -05:00
2024-08-22 16:57:06 -05:00
2024-08-22 16:57:06 -05:00
2024-08-22 16:57:06 -05:00
2024-07-14 04:07:54 +08:00
2024-07-12 15:57:00 -05:00
2024-08-22 16:57:06 -05:00
2024-08-22 16:57:06 -05:00
2024-07-12 15:57:00 -05:00
2024-08-22 16:57:06 -05:00
2024-07-12 15:57:00 -05:00
2024-07-12 15:57:00 -05:00
2024-07-12 15:57:00 -05:00
2024-08-22 16:57:06 -05:00
2024-07-06 11:28:13 +08:00
2024-08-22 16:57:06 -05:00
2024-07-12 15:57:00 -05:00
2024-08-22 16:57:06 -05:00
2024-08-22 16:57:06 -05:00
2024-07-19 10:50:42 -05:00
2024-09-21 00:35:19 +00:00
2024-07-30 17:30:36 +08:00
2024-08-22 16:57:06 -05:00
2024-07-14 04:09:34 +08:00
2024-08-22 16:57:06 -05:00
2024-07-24 10:42:50 -05:00
2024-08-22 16:57:06 -05:00
2024-08-18 10:50:27 -07:00
2024-07-18 15:22:29 -05:00
2024-07-18 15:22:29 -05:00
2024-08-22 16:57:06 -05:00
2024-09-09 23:39:21 +08:00
2024-07-19 10:50:42 -05:00
2024-07-19 10:50:42 -05:00
2024-07-12 15:57:00 -05:00
2024-07-26 23:26:48 +08:00
2024-08-14 16:16:11 -05:00
2024-09-07 07:28:28 +01:00
2024-08-30 09:26:56 -05:00
2024-07-09 08:03:09 +08:00
2024-07-12 15:57:00 -05:00
2024-07-12 15:57:00 -05:00
2024-08-22 16:57:06 -05:00
2024-08-15 16:56:49 -05:00
2024-08-28 10:35:16 -05:00
2024-07-18 15:22:29 -05:00
2024-08-26 22:16:00 +00:00
2024-08-30 10:10:46 +07:00
2024-08-30 09:26:56 -05:00
2024-08-22 16:57:06 -05:00
2024-09-19 11:42:33 -05:00
2024-07-24 10:42:51 -05:00
2024-08-22 10:19:06 +08:00
2024-08-22 16:57:06 -05:00
2024-08-22 16:57:06 -05:00
2024-08-22 16:57:06 -05:00
2024-08-22 16:57:06 -05:00
2024-08-22 16:57:06 -05:00
2024-08-22 16:57:06 -05:00
2024-08-22 16:57:06 -05:00
2024-07-09 15:38:44 -05:00
2024-09-06 14:49:43 -05:00
2024-08-22 16:57:06 -05:00
2024-09-06 13:25:55 -05:00
2024-07-24 10:42:50 -05:00
2024-09-06 13:25:55 -05:00
2024-08-30 09:26:56 -05:00
2024-08-22 16:57:06 -05:00
2024-08-22 16:57:06 -05:00
2024-08-30 09:26:56 -05:00
2024-08-22 16:57:06 -05:00
2024-08-22 16:57:06 -05:00
2024-08-30 09:40:54 -05:00
2024-07-18 15:22:29 -05:00
2024-09-05 09:58:08 +02:00
2024-07-12 15:57:00 -05:00
2024-08-22 16:57:06 -05:00
2024-07-12 15:57:00 -05:00
2024-08-22 16:57:06 -05:00
2024-07-18 15:22:29 -05:00
2024-08-22 16:57:06 -05:00
2024-09-17 23:51:57 +08:00
2024-09-14 11:53:00 -07:00
2024-07-12 15:57:00 -05:00
2024-08-22 16:57:06 -05:00
2024-08-22 16:57:06 -05:00
2024-08-08 01:04:42 -04:00
2024-08-22 16:57:06 -05:00
2024-08-22 16:57:06 -05:00
2024-07-12 15:57:00 -05:00
2024-07-12 15:57:00 -05:00
2024-08-30 09:26:56 -05:00
2024-07-24 10:42:50 -05:00
2024-09-19 11:42:33 -05:00
2024-09-12 09:10:30 +02:00
2024-07-12 15:57:00 -05:00
2024-07-12 15:57:00 -05:00
2024-08-22 16:57:06 -05:00
2024-08-22 16:57:06 -05:00
2024-08-30 09:26:56 -05:00
2024-07-18 15:22:29 -05:00