Skip to content

How to detect workspace root? #4933

Closed
@ehuss

Description

@ehuss

A recent change (#4788) changed it so that when you run cargo from within a workspace member, the paths in messages are now relative to the workspace root instead of the member package. I work on the Sublime integration, and the tool needs to know how to resolve the relative paths so that you can jump to the appropriate file when there is an error/warning. Currently it uses a simple logic of basing paths off the package's root. However, now it needs to know the workspace root, but I am uncertain how to find that. cargo metadata doesn't seem to offer any help. Is there some heuristic I can use?

Note: Currently the build tool doesn't know whether or not it is in a workspace. It blindly runs cargo build in the directory of the package.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions