bors 3293d22f00 Auto merge of #14326 - Ifropc:5707-lock-path, r=weihanglo
Add `--lockfile-path` flag

This change implements a new `--lockfile-path` proposed in #5707 .

Functionality added:
- Add `--lockfile-path <PATH>` to all commands that support `manifest-path` with exception of:
   - `locate-project` (doesn't use lock file)
   - `verify-project` (is deprecated)
   - `read-manifest` (doesn't use lock file)
- Behind -Zunstable-options and docs
   - The flag's docs / `--help` has (unstable) in them
- `<PATH>` must end with `Cargo.lock`. If specified path doesn't exist (or parent director(ies), create all the parent directories and the lockfile itself

Implementation TLDR: add `requested_lockfile_path` into `Workspace` and set it on `workspace(gctx)` call (setting from the context)
Update `lockfile.lock_root()` to respect `requested_lockfile_path` (if set)
Add test cases covering all affected commands. Tested creating lockfile, reading lockfile, overriding default (`./Cargo.lock`) lockfile, symlink tests. Extra tests for package to make sure pinned versions from path's lockfile are respected (i.e. double check correct lockfile is used)
I doubt this flag will be used for any command that's not read-only, but I tried to cover all the commands.
2024-08-16 14:38:39 +00: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-05-27 21:27:03 -05: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-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-05-27 21:27:03 -05: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-05-27 21:27:03 -05: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-05-27 21:27:03 -05:00
2024-05-27 21:27:03 -05:00
2024-05-27 21:27:03 -05:00