Skip to content

Add a way to construct a Workspace without reading manifests from disk #16290

@secona

Description

@secona

Problem

In cargo-plumbing, we need Workspace information in almost every command. However, the current Workspace implementation has a limitation in which it requires reading the manifest file from disk during construction. This means that every invocation of a plumbing command is forced to re-read the manifest.

Plumbing commands communicate through stdout/stdin. We have a dedicated command, read-manifest, intended to read the manifests once and pass that information to other command invocations via stdin. However, we are currently blocked because Workspace construction requires reading files from disk and does not accept data already on memory.

Proposed Solution

Provide a way to construct a Workspace using in-memory data and not read from disk.

I wonder what data are needed to replicate a manifest disk read to construct a fully-functioning Workspace. A big obstacle from cargo-plumbing's side is that it works with serializable data, which has limitations on what can be represented.

Would it be fine to have an incomplete Workspace for some specific operation that don't need a full complete Workspace? I have a feeling this would be problematic but am open to ideas.

Notes

See crate-ci/cargo-plumbing#82

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cargo-apiArea: cargo-the-library API and internal code issuesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-mentorStatus: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions