Skip to content

po4yka/rust-skills / skills/rust-crate-release

rust-crate-release

Verified

Use when preparing to publish a Rust crate or a Rust binary release, or recovering from a bad one - deciding a SemVer bump or MSRV change, checking cargo package and cargo publish output, ordering a workspace publish, setting up crates.io trusted publishing, deciding whether to yank a crate version, building a release archive with a release checksum, release SBOM, and attestation, or using cosign to sign release artifacts.

references/package-inspection.md

View on GitHub
# Package inspection

Read this when you review the `cargo package --list` output, inspect the `.crate`, or test the
packaged source.

Contents:

- Archive location
- Review the file list
- Test the packaged source
- Triage
- Official references

## Archive location

Read `target_directory` from the `cargo metadata` output. `cargo package` writes the archive to
`<target_directory>/package/`, which is not `./target` when `CARGO_TARGET_DIR` or
`build.target-dir` is set. Inspect the `.crate` there; `cargo publish` does not keep one since
Cargo 1.93. crates.io rejects a compressed `.crate` over 10 MB.

## Review the file list

Review the complete `cargo package --locked -p <package> --registry <registry> --list` output.
Look for missing source, generated files, README, license, and build inputs. Look for secrets,
credentials, private keys, internal notes, large fixtures, and repository-only files. Use
`include` or `exclude` only when the default set is wrong; `include` overrides `exclude`.

## Test the packaged source

`cargo package` verifies only that the library and binaries build. Test the packaged source when
tests, examples, build scripts, or generated files can differ from the workspace:

```bash
release_tmp="$(mktemp -d)"
tar -xzf "<target_directory>/package/<package>-<version>.crate" -C "$release_tmp"
(
  cd "$release_tmp/<package>-<version>"
  cargo test --locked --all-targets
  RUSTDOCFLAGS="-D warnings" cargo doc --locked --no-deps
)
```

Cargo removes a path dev-dependency that has no `version` from the published manifest. Tests that
use it pass in the workspace and fail from the archive with E0432 (a `use` import) or E0433 (a
path such as `helper::f()`). Keep the directory until diagnosis ends.

## Triage

| Symptom | Likely cause | Fix |
|---|---|---|
| `cargo package --list` misses a file | `include`, `exclude`, or a VCS ignore rule removes it | Fix the manifest and list again |
| Archive tests fail with E0432 or E0433 on a test helper crate | A path-only dev-dependency is removed from the published manifest | Give it a published `version`, or keep those tests out of the archive and document it |
| Package verifies in the workspace but not from the archive | Hidden path, generated file, or undeclared build input | Include the input or generate it in `OUT_DIR` |

## Official references

- [`cargo package`](https://doc.rust-lang.org/cargo/commands/cargo-package.html)
- [Cargo changelog](https://doc.rust-lang.org/nightly/cargo/CHANGELOG.html)
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall