Skip to content

With package selection, --package <non-existent> --workspace doesn't warn or error #12978

@sunshowers

Description

Problem

Originally reported as nextest-rs/nextest#1108.

With Cargo's package selection, this errors out:

$ cargo build --package non-existent
error: package ID specification `non-existent` did not match any packages

However, this does not error out:

$ cargo build --package non-existent --workspace
<build occurs...>

I think this should at least produce a warning and maybe eventually error out.

(I tried searching for issues a bit but I couldn't figure out the right keywords.)

Steps

As above.

Possible Solution(s)

Produce a warning on --workspace and -p <non-existent>. Maybe eventually turn it into an error

Notes

No response

Version

% cargo +nightly version --verbose           
cargo 1.76.0-nightly (6790a5127 2023-11-10)
release: 1.76.0-nightly
commit-hash: 6790a5127895debec95c24aefaeb18e059270df3
commit-date: 2023-11-10
host: x86_64-unknown-linux-gnu
libgit2: 1.7.1 (sys:0.18.1 vendored)
libcurl: 8.4.0-DEV (sys:0.4.68+curl-8.4.0 vendored ssl:OpenSSL/1.1.1u)
ssl: OpenSSL 1.1.1u  30 May 2023
os: Pop!_OS 22.04 (jammy) [64-bit]

Metadata

Assignees

Labels

A-cliArea: Command-line interface, option parsing, etc.C-bugCategory: bugS-needs-mentorStatus: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions