Problem
When executed within the directory of a member package, cargo metadata returns a workspace_default_members array that only contains the member package itself, as opposed to the full list of resolved members as specified by the workspace manifest.
Steps
- Create a minimal virtual manifest:
[workspace]
resolver = "2"
cargo new package1
cargo new package2
cd package1
cargo metadata --format-version 1 | jq '.workspace_default_members' (Using jq for readability)
[
"path+file:///.../package1#0.1.0"
] // expected both packages
Possible Solution(s)
No response
Notes
No response
Version
cargo 1.94.0 (85eff7c80 2026-01-15)
release: 1.94.0
commit-hash: 85eff7c80277b57f78b11e28d14154ab12fcf643
commit-date: 2026-01-15
host: aarch64-apple-darwin
libgit2: 1.9.2 (sys:0.20.3 vendored)
libcurl: 8.7.1 (sys:0.4.84+curl-8.17.0 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 3.5.4 30 Sep 2025
os: Mac OS 15.7.5 [64-bit]
Problem
When executed within the directory of a member package,
cargo metadatareturns aworkspace_default_membersarray that only contains the member package itself, as opposed to the full list of resolved members as specified by the workspace manifest.Steps
cargo new package1cargo new package2cd package1cargo metadata --format-version 1 | jq '.workspace_default_members'(Usingjqfor readability)Possible Solution(s)
No response
Notes
No response
Version