Skip to content

cargo run --package report ambiguous #16218

@fan2nd

Description

@fan2nd

Problem

I created a project named "esp32c6", clicked the run button close to main funtion in zed ide. then it report:

error: There are multiple `esp32c6` packages in your project, and the specification `esp32c6` is ambiguous.
Please re-run this command with one of the following specifications:
  esp32c6@0.1.0
  esp32c6@0.22.0

This ide just run cargo run --package esp32c6 --bin xxx. There is no problem in vscode because vscode run cargo run --package esp32c6:0.1.0 --bin xxx. I found esp32c6@0.22.0 is just a dependence in my project in Cargo.lock. I don't understand why cargo run treat it as a runnable package in my project.

Steps

No response

Possible Solution(s)

cargo run should only treat current project and its subproject as runnable package.

Notes

No response

Version

cargo 1.91.0 (ea2d97820 2025-10-10)
release: 1.91.0
commit-hash: ea2d97820c16195b0ca3fadb4319fe512c199a43
commit-date: 2025-10-10
host: x86_64-pc-windows-msvc
libgit2: 1.9.1 (sys:0.20.2 vendored)
libcurl: 8.15.0-DEV (sys:0.4.83+curl-8.15.0 vendored ssl:Schannel)
os: Windows 10.0.26200 (Windows 11 Professional) [64-bit]

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cliArea: Command-line interface, option parsing, etc.C-bugCategory: bugS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions