Skip to content

Commit 5cd4198

Browse files
committed
Auto merge of #13512 - LuuuXXX:issue-5805, r=weihanglo
[docs]: Clarify vendored sources as read-only and way to modify What does this PR try to resolve? To document that vendored sources are not intended to be modified, and `[patch]` or a `path` dependency is the correct way to modify a vendored crate. #5805 (comment)
2 parents 3bb0697 + 13e72b9 commit 5cd4198

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

src/doc/man/cargo-vendor.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ stdout after `cargo vendor` completes the vendoring process.
2121
You will need to add or redirect it to your Cargo configuration file,
2222
which is usually `.cargo/config.toml` locally for the current package.
2323

24+
Cargo treats vendored sources as read-only as it does to registry and git sources.
25+
If you intend to modify a crate from a remote source,
26+
use `[patch]` or a `path` dependency pointing to a local copy of that crate.
27+
Cargo will then correctly handle the crate on incremental rebuilds,
28+
as it knowns that it is no longer a read-only dependency.
29+
2430
## OPTIONS
2531

2632
### Vendor Options

src/doc/man/generated_txt/cargo-vendor.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ DESCRIPTION
1818
need to add or redirect it to your Cargo configuration file, which is
1919
usually .cargo/config.toml locally for the current package.
2020

21+
Cargo treats vendored sources as read-only as it does to registry and
22+
git sources. If you intend to modify a crate from a remote source, use
23+
[patch] or a path dependency pointing to a local copy of that crate.
24+
Cargo will then correctly handle the crate on incremental rebuilds, as
25+
it knowns that it is no longer a read-only dependency.
26+
2127
OPTIONS
2228
Vendor Options
2329
-s manifest, --sync manifest

src/doc/src/commands/cargo-vendor.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ stdout after `cargo vendor` completes the vendoring process.
2121
You will need to add or redirect it to your Cargo configuration file,
2222
which is usually `.cargo/config.toml` locally for the current package.
2323

24+
Cargo treats vendored sources as read-only as it does to registry and git sources.
25+
If you intend to modify a crate from a remote source,
26+
use `[patch]` or a `path` dependency pointing to a local copy of that crate.
27+
Cargo will then correctly handle the crate on incremental rebuilds,
28+
as it knowns that it is no longer a read-only dependency.
29+
2430
## OPTIONS
2531

2632
### Vendor Options

src/etc/man/cargo-vendor.1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ The configuration necessary to use the vendored sources would be printed to
1818
stdout after \fBcargo vendor\fR completes the vendoring process.
1919
You will need to add or redirect it to your Cargo configuration file,
2020
which is usually \fB\&.cargo/config.toml\fR locally for the current package.
21+
.sp
22+
Cargo treats vendored sources as read\-only as it does to registry and git sources.
23+
If you intend to modify a crate from a remote source,
24+
use \fB[patch]\fR or a \fBpath\fR dependency pointing to a local copy of that crate.
25+
Cargo will then correctly handle the crate on incremental rebuilds,
26+
as it knowns that it is no longer a read\-only dependency.
2127
.SH "OPTIONS"
2228
.SS "Vendor Options"
2329
.sp

0 commit comments

Comments
 (0)