From 9915b8075e80c6ce43a541d5b8fc6ff814a99923 Mon Sep 17 00:00:00 2001 From: Ifropc Date: Sun, 18 Aug 2024 10:37:57 -0700 Subject: [PATCH] doc: add lockfile-path unstable doc section --- src/doc/src/reference/unstable.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/doc/src/reference/unstable.md b/src/doc/src/reference/unstable.md index 339fd99f42a..ce7f2cb6dd2 100644 --- a/src/doc/src/reference/unstable.md +++ b/src/doc/src/reference/unstable.md @@ -115,6 +115,7 @@ Each new feature described below should explain how to use it. * Other * [gitoxide](#gitoxide) --- Use `gitoxide` instead of `git2` for a set of operations. * [script](#script) --- Enable support for single-file `.rs` packages. + * [lockfile-path](#lockfile-path) --- Allows to specify a path to lockfile other than the default path `/Cargo.lock`. ## allow-features @@ -1625,6 +1626,23 @@ will prefer the value in the configuration. The allows Cargo to add new built-in path bases without compatibility issues (as existing uses will shadow the built-in name). +## lockfile-path +* Original Issue: [#5707](https://github.com/rust-lang/cargo/issues/5707) +* Tracking Issue: [#14421](https://github.com/rust-lang/cargo/issues/14421) + +This feature allows you to specify the path of lockfile Cargo.lock. +By default, lockfile is written into `/Cargo.lock`. +However, when sources are stored in read-only directory, most of the cargo commands +would fail, trying to write a lockfile. The `--lockfile-path` +flag makes it easier to work with readonly sources. +Note, that currently path must end with `Cargo.lock`. Meaning, if you want to use +this feature in multiple projects, lockfiles should be stored in different directories. +Example: + +```sh +cargo +nightly metadata --lockfile-path=$LOCKFILES_ROOT/my-project/Cargo.lock -Z unstable-options +``` + # Stabilized and removed features ## Compile progress