Skip to content

Allow Cargo Targets in Virtual Workspaces #16949

@daxpedda

Description

@daxpedda

Problem

I want to add tests and examples to my virtual workspace, not in one of its member crates.
Cargo v1.95 simply ignores any tests and examples in the default folders of the virtual workspace.
This does make sense because there is no auto discovery without a package.

Proposed Solution

I want to be able to add tests and examples even without a workspace root package, ergo a virtual workspace. Ergo adding auto* fields to [workspace].

To make this work effectively it would also require adding Cargo targets in a virtual workspace, e.g. [[test]] and [[example]]. [dev-dependencies] and [lints] would also be great.

Notes

The current workaround is to add a placeholder package to make it a non-virtual workspace:

[package]
name = "placeholder"
publish = false

This does also not require a placeholder library or binary, so its a very minimal workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-workspacesArea: workspacesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-testS-triageStatus: This issue is waiting on initial triage.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions