IssueRaiser

Environment variable for Cargo Workspace for finding workspace-wide assets

T-cargo notes: Potential use cases: - Accessing workspace-wide assets (this issue) - Looking up `file!` at test runtime, see #15885 - Finding a binary's path, see - [`CARGO_BIN_EXE_<name>`](https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates) - #9661 - Looking up the lockfile, this would be insufficient because the lockfile path can be overridden. A new issue for this would be needed. - Dependencies looking up information in your workspace: side-banned communication like this is rejected by the cargo team Updates - https://github.com/rust-lang/cargo/issues/3946#issuecomment-1402464796 - https://github.com/rust-lang/cargo/issues/3946#issuecomment-3224923131 --- Hi, while working on using workspace in html5ever, I've ran into issue of needing the `CARGO_WORKSPACE` directory, and being unable, to find it. What I resorted to is essentially, `&Path(cargo_manifest).join("..")` which feels hacky. Could `CARGO_WORKSPACE` be added as environment variable? I'm not sure what it should be when there is no workspace defined, I assume it should either return `Err` or default it to `CARGO_MANIFEST_DIR`. Sidenote I'm willing to work on this issue, if I could get quick pointers, to what I need to do. <!-- TRIAGEBOT_START --> <!-- TRIAGEBOT_ASSIGN_START --> <!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"yerke"}$$TRIAGEBOT_ASSIGN_DATA_END --> <!-- TRIAGEBOT_ASSIGN_END --> <!-- TRIAGEBOT_END -->

Posted by Ygg01 on Apr 24, 2017, 9:45 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments

github (Software)

Environment variable for Cargo Workspace for finding workspace-wide assets

Ygg01Apr 24, 2017, 9:45 AM

T-cargo notes: Potential use cases: - Accessing workspace-wide assets (this issue) - Looking up `file!` at test runtime, see #15885 - Finding a binary's path, see - [`CARGO_BIN_EXE_<name>`](https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates) - #9661 - Looking up the lockfile, this would be insufficient because the lockfile path can be overridden. A new issue for this would be needed. - Dependencies looking up information in your workspace: side-banned communication like this is rejected by the cargo team Updates - https://github.com/rust-lang/cargo/issues/3946#issuecomment-1402464796 - https://github.com/rust-lang/cargo/issues/3946#issuecomment-3224923131 --- Hi, while working on using workspace in html5ever, I've ran into issue of needing the `CARGO_WORKSPACE` directory, and being unable, to find it. What I resorted to is essentially, `&Path(cargo_manifest).join("..")` which feels hacky. Could `CARGO_WORKSPACE` be added as environment variable? I'm not sure what it should be when there is no workspace defined, I assume it should either return `Err` or default it to `CARGO_MANIFEST_DIR`. Sidenote I'm willing to work on this issue, if I could get quick pointers, to what I need to do. <!-- TRIAGEBOT_START --> <!-- TRIAGEBOT_ASSIGN_START --> <!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"yerke"}$$TRIAGEBOT_ASSIGN_DATA_END --> <!-- TRIAGEBOT_ASSIGN_END --> <!-- TRIAGEBOT_END -->

Comments (0)

No comments yet. Start the discussion.

Comment on this issue