Skip to content

cargo package --package includes all packages if no match is found #13719

@paolobarbolini

Description

@paolobarbolini

Problem

cargo package --package PACKAGE_NAME packages all workspace members if PACKAGE_NAME matches no package. cargo publish --dry-run --package PACKAGE_NAME throws an error instead if no package is found.

Steps

  1. git clone https://github.com/RustCrypto/traits.git
  2. cd traits
  3. git checkout dadaf3591795ba0820080ca45d0feaabd5303ded
  4. cargo package --package doesnt-exist: see how it builds all packages
  5. cargo publish --dry-run --package doesnt-exist: see how it throws an error

Possible Solution(s)

Make cargo package behave the same as cargo publish --dry-run

Notes

No response

Version

cargo 1.79.0-nightly (0637083df 2024-04-02)
release: 1.79.0-nightly
commit-hash: 0637083df5bbdcc951845f0d2eff6999cdb6d30a
commit-date: 2024-04-02
host: x86_64-unknown-linux-gnu
libgit2: 1.7.2 (sys:0.18.3 vendored)
libcurl: 8.6.0-DEV (sys:0.4.72+curl-8.6.0 vendored ssl:OpenSSL/3.2.1)
ssl: OpenSSL 3.2.1 30 Jan 2024
os: EndeavourOS Rolling Release (rolling) [64-bit]

Metadata

Metadata

Assignees

Labels

C-bugCategory: bugCommand-packageS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions