Skip to content

When looking for worksapce root, don't step over CARGO_HOME #4765

@matklad

Description

@matklad

See the description of the problem in #4764 (comment).

The gist is that if you invoke cargo inside CARGO_HOME, which is inside a workspace, Cargo should not think that it is inside workspace.

This is the function where I think the fix should be applied:

fn find_root(&mut self, manifest_path: &Path)

Relevant tests are here: https://github.com/rust-lang/cargo/blob/806e487c0e3b6af6203ef8bebf5d6f49faf8909d/tests/workspaces.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions