Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add lockfile-path unstable doc section #14423

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/doc/src/reference/unstable.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<workspace_root>/Cargo.lock`.

## allow-features

Expand Down Expand Up @@ -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 `<workspace_root>/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
Expand Down