Skip to content

workspace.members that point to a file are silently ignored #16611

@ehuss

Description

@ehuss

Problem

When workspace.members includes a path to a file, that member is silently ignored. I think it should at least be a warning, if not an error. This regressed in #8511 where it was changed to ignore files. But I think the intention there was only in the case of globing (such as when members points to a directory, and that directory contains stray files). It wasn't intended to ignore entries in members that pointed directly to a file.

Steps

Create a workspace:

[workspace]
members = [".", "./foo"]
[package]
name = "x"

Create an empty file "foo".
Create src/lib.rs.

Run cargo metadata. Note that it complete ignores "foo".

Possible Solution(s)

I think this should at least be a warning, but should probably be an error.

Notes

No response

Version

cargo 1.95.0-nightly (fe2f314ae 2026-01-30)
release: 1.95.0-nightly
commit-hash: fe2f314aef06e688a9517da1ac0577bb1854d01f
commit-date: 2026-01-30
host: aarch64-apple-darwin
libgit2: 1.9.2 (sys:0.20.3 vendored)
libcurl: 8.7.1 (sys:0.4.83+curl-8.15.0 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 3.5.4 30 Sep 2025
os: Mac OS 26.2.0 [64-bit]

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-workspacesArea: workspacesC-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