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

docs: More information on what is and isn't included by cargo package #14684

Merged
merged 4 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions src/doc/man/cargo-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ stored in the `target/package` directory. This performs the following steps:
- A `.cargo_vcs_info.json` file is included that contains information
about the current VCS checkout hash if available, as well as a flag if the
worktree is dirty.
- Symlinks are flattened to their target files.
- Files and directories are included or excluded based on rules mentioned in
[the `[include]` and `[exclude]` fields](../reference/manifest.html#the-exclude-and-include-fields).

3. Extract the `.crate` file and build it to verify it can build.
- This will rebuild your package from scratch to ensure that it can be
built from a pristine state. The `--no-verify` flag can be used to skip
Expand Down
9 changes: 9 additions & 0 deletions src/doc/man/generated_txt/cargo-package.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ DESCRIPTION
following steps:

1. Load and check the current workspace, performing some basic checks.

o Path dependencies are not allowed unless they have a version key.
Cargo will ignore the path key for dependencies in published
packages. dev-dependencies do not have this restriction.

2. Create the compressed .crate file.

o The original Cargo.toml file is rewritten and normalized.

o [patch], [replace], and [workspace] sections are removed from the
Expand All @@ -32,7 +34,14 @@ DESCRIPTION
about the current VCS checkout hash if available, as well as a
flag if the worktree is dirty.

o Symlinks are flattened to their target files.

o Files and directories are included or excluded based on rules
mentioned in the [include] and [exclude] fields
<https://doc.rust-lang.org/cargo/reference/manifest.html#the-exclude-and-include-fields>.

3. Extract the .crate file and build it to verify it can build.

o This will rebuild your package from scratch to ensure that it can
be built from a pristine state. The --no-verify flag can be used
to skip this step.
Expand Down
4 changes: 4 additions & 0 deletions src/doc/src/commands/cargo-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ stored in the `target/package` directory. This performs the following steps:
- A `.cargo_vcs_info.json` file is included that contains information
about the current VCS checkout hash if available, as well as a flag if the
worktree is dirty.
- Symlinks are flattened to their target files.
- Files and directories are included or excluded based on rules mentioned in
[the `[include]` and `[exclude]` fields](../reference/manifest.html#the-exclude-and-include-fields).

3. Extract the `.crate` file and build it to verify it can build.
- This will rebuild your package from scratch to ensure that it can be
built from a pristine state. The `--no-verify` flag can be used to skip
Expand Down
9 changes: 9 additions & 0 deletions src/etc/man/cargo-package.1
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ packaged lock file if the \fB\-\-locked\fR flag is used.
about the current VCS checkout hash if available, as well as a flag if the
worktree is dirty.
.RE
.sp
.RS 4
\h'-04'\(bu\h'+02'Symlinks are flattened to their target files.
.RE
.sp
.RS 4
\h'-04'\(bu\h'+02'Files and directories are included or excluded based on rules mentioned in
\fIthe \f(BI[include]\fI and \f(BI[exclude]\fI fields\fR <https://doc.rust\-lang.org/cargo/reference/manifest.html#the\-exclude\-and\-include\-fields>\&.
.RE
.RE
.sp
.RS 4
Expand Down