Skip to content

Commit ec347d9

Browse files
committed
doc: add lockfile-path unstable doc section
1 parent ba8b394 commit ec347d9

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/doc/src/reference/unstable.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ Each new feature described below should explain how to use it.
112112
* Registries
113113
* [publish-timeout](#publish-timeout) --- Controls the timeout between uploading the crate and being available in the index
114114
* [asymmetric-token](#asymmetric-token) --- Adds support for authentication tokens using asymmetric cryptography (`cargo:paseto` provider).
115+
* Mafinest and lockfile
116+
* [lockfile-path](#lockfile-path) --- Allows to specify a path to lockfile other than the default path `<workspace_root>/Cargo.lock`.
115117
* Other
116118
* [gitoxide](#gitoxide) --- Use `gitoxide` instead of `git2` for a set of operations.
117119
* [script](#script) --- Enable support for single-file `.rs` packages.
@@ -1625,6 +1627,23 @@ will prefer the value in the configuration. The allows Cargo to add new built-in
16251627
path bases without compatibility issues (as existing uses will shadow the
16261628
built-in name).
16271629

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

16301649
## Compile progress

0 commit comments

Comments
 (0)