Skip to content

Commit badbe4f

Browse files
committed
Auto merge of #14423 - Ifropc:lockfile-doc, r=weihanglo
doc: add lockfile-path unstable doc section Adds lockfile-path into the unstable doc section as part of tracking issue #14421 tasks
2 parents 88957a1 + 9915b80 commit badbe4f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/doc/src/reference/unstable.md

+18
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ Each new feature described below should explain how to use it.
115115
* Other
116116
* [gitoxide](#gitoxide) --- Use `gitoxide` instead of `git2` for a set of operations.
117117
* [script](#script) --- Enable support for single-file `.rs` packages.
118+
* [lockfile-path](#lockfile-path) --- Allows to specify a path to lockfile other than the default path `<workspace_root>/Cargo.lock`.
118119

119120
## allow-features
120121

@@ -1625,6 +1626,23 @@ will prefer the value in the configuration. The allows Cargo to add new built-in
16251626
path bases without compatibility issues (as existing uses will shadow the
16261627
built-in name).
16271628

1629+
## lockfile-path
1630+
* Original Issue: [#5707](https://github.com/rust-lang/cargo/issues/5707)
1631+
* Tracking Issue: [#14421](https://github.com/rust-lang/cargo/issues/14421)
1632+
1633+
This feature allows you to specify the path of lockfile Cargo.lock.
1634+
By default, lockfile is written into `<workspace_root>/Cargo.lock`.
1635+
However, when sources are stored in read-only directory, most of the cargo commands
1636+
would fail, trying to write a lockfile. The `--lockfile-path`
1637+
flag makes it easier to work with readonly sources.
1638+
Note, that currently path must end with `Cargo.lock`. Meaning, if you want to use
1639+
this feature in multiple projects, lockfiles should be stored in different directories.
1640+
Example:
1641+
1642+
```sh
1643+
cargo +nightly metadata --lockfile-path=$LOCKFILES_ROOT/my-project/Cargo.lock -Z unstable-options
1644+
```
1645+
16281646
# Stabilized and removed features
16291647

16301648
## Compile progress

0 commit comments

Comments
 (0)