Stream: general

Topic: cargo-workspace-root-env

csmoe (Jul 03 2019 at 11:10, on Zulip):

for a workspace:

workspace -
   - Cargo.toml
   - crate_a
      - Cargo.toml
   - crate_b

@matklad is there any method for crate_a/ to get the workspace's root path with env variable? CARGO_MANIFEST_DIR can only return the path of crate_a.

matklad (Jul 03 2019 at 11:17, on Zulip):

IIRC, that's not possible in a good. I remember facing the same issue with insta. The workaround is to call cargo metadata from

csmoe (Jul 03 2019 at 11:18, on Zulip):

@matklad thanks :slight_smile:
is it suitable to post a feature request to cargo repo?

matklad (Jul 03 2019 at 11:21, on Zulip):

Yeah, I think CARGO_WORKSPACE_MANIFEST_DIR is a reasonable thing to add to Cargo. The insta issue was

Last update: Jun 04 2020 at 17:45UTC