Skip to content

For member under [workspace], Glob pattern doesn’t work for paths whose parent is excluded #11362

Open
@rinarakaki

Description

@rinarakaki

Problem

I want to group my related packages managed in the same repository under a directory, for example, libs/group-1 which you can think of as a sub-workspace but not a crate itself (there’s no Cargo.toml for it):


(Project Root)
├── Cargo.toml ([workspace])
├── libs
│   ├── group-1
│   │   ├── lib-1
│   │   │   └── Cargo.toml
│   │   └── lib-2
│   │       └── Cargo.toml
│   ├── lib-3
│   …
│   └── lib-n
…

I want to exclude only the path to it lib/group-1 from members — so Cargo won’t try to find its non-existent Cargo.toml based on the rule libs/* — but still include everything under the directory (libs/group-1/*), hence:

[workspace]
member = [
    "libs/*",
    "libs/group-1/*",
    "libs/group-1/lib-1"  # [1]
]
exclude = [
    "libs/group-1"
]

The problem is this doesn’t work, for example, for lib-2 located at libs/group-1/lib-2.

[1] Here I have added libs/group-1/lib-1 to explain where the intuition comes from, because this config is still valid and does work forlib-1.

Steps

No response

Possible Solution(s)

No response

Notes

No response

Version

No response

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