Skip to content

Commit

Permalink
Auto merge of #13512 - LuuuXXX:issue-5805, r=weihanglo
Browse files Browse the repository at this point in the history
[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)
  • Loading branch information
bors committed Mar 1, 2024
2 parents 3bb0697 + 13e72b9 commit 5cd4198
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/doc/man/cargo-vendor.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ stdout after `cargo vendor` completes the vendoring process.
You will need to add or redirect it to your Cargo configuration file,
which is usually `.cargo/config.toml` locally for the current package.

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

## OPTIONS

### Vendor Options
Expand Down
6 changes: 6 additions & 0 deletions src/doc/man/generated_txt/cargo-vendor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ DESCRIPTION
need to add or redirect it to your Cargo configuration file, which is
usually .cargo/config.toml locally for the current package.

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

OPTIONS
Vendor Options
-s manifest, --sync manifest
Expand Down
6 changes: 6 additions & 0 deletions src/doc/src/commands/cargo-vendor.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ stdout after `cargo vendor` completes the vendoring process.
You will need to add or redirect it to your Cargo configuration file,
which is usually `.cargo/config.toml` locally for the current package.

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

## OPTIONS

### Vendor Options
Expand Down
6 changes: 6 additions & 0 deletions src/etc/man/cargo-vendor.1
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ The configuration necessary to use the vendored sources would be printed to
stdout after \fBcargo vendor\fR completes the vendoring process.
You will need to add or redirect it to your Cargo configuration file,
which is usually \fB\&.cargo/config.toml\fR locally for the current package.
.sp
Cargo treats vendored sources as read\-only as it does to registry and git sources.
If you intend to modify a crate from a remote source,
use \fB[patch]\fR or a \fBpath\fR dependency pointing to a local copy of that crate.
Cargo will then correctly handle the crate on incremental rebuilds,
as it knowns that it is no longer a read\-only dependency.
.SH "OPTIONS"
.SS "Vendor Options"
.sp
Expand Down

0 comments on commit 5cd4198

Please sign in to comment.