Add workspace root to metadata command.#4940
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
Yep, adding workspace root to metadata definitely seems useful! |
|
Just to clarify, we use workspace dir and not the package did here because otherwise all packages will have src/lib.rs in debuginfo, and that would be ambiguous? |
|
📌 Commit cc37b90 has been approved by |
Add workspace root to metadata command. Fixes #4933 Merge of #4938 for rust 1.24 beta. @alexcrichton I'm uncertain about the process for merging in beta. I'm guessing after this I just need to open a PR on the rust beta branch to update the cargo submodule?
I don't think that was the original motivation, but you an Alex went back and forth about this in #4788 that introduced this change. I just discovered that backtraces displayed on Windows are relative to the CWD when the panic happens (unless you have |
|
☀️ Test successful - status-appveyor, status-travis |
Update cargo on beta. This brings in rust-lang/cargo#4940 which adds `"workspace_root"` to `cargo metadata` so that tools can resolve the new relative paths in symbols and compiler messages.
[beta] Update cargo on beta. This brings in rust-lang/cargo#4940 which adds `"workspace_root"` to `cargo metadata` so that tools can resolve the new relative paths in symbols and compiler messages.
cbindgen currently assumes that the `Cargo.lock` is in directly in the crate directory as a sibling to `Cargo.toml`; however that is usually not the case inside a workspace. Instead, this PR extracts the workspace root from the output of `cargo metadata` [1] (already used to get a list of packages) and uses the `Cargo.lock` from there. 1. This is available since Rust 1.24; see rust-lang/cargo#4940
cbindgen currently assumes that the `Cargo.lock` is in directly in the crate directory as a sibling to `Cargo.toml`; however that is usually not the case inside a workspace. Instead, this PR extracts the workspace root from the output of `cargo metadata` [1] (already used to get a list of packages) and uses the `Cargo.lock` from there. 1. This is available since Rust 1.24; see rust-lang/cargo#4940
cbindgen currently assumes that the `Cargo.lock` is in directly in the crate directory as a sibling to `Cargo.toml`; however that is usually not the case inside a workspace. Instead, this PR extracts the workspace root from the output of `cargo metadata` [1] (already used to get a list of packages) and uses the `Cargo.lock` from there. 1. This is available since Rust 1.24; see rust-lang/cargo#4940
cbindgen currently assumes that the `Cargo.lock` is in directly in the crate directory as a sibling to `Cargo.toml`; however that is usually not the case inside a workspace. Instead, this PR extracts the workspace root from the output of `cargo metadata` [1] (already used to get a list of packages) and uses the `Cargo.lock` from there. 1. This is available since Rust 1.24; see rust-lang/cargo#4940
Fixes #4933
Merge of #4938 for rust 1.24 beta.
@alexcrichton I'm uncertain about the process for merging in beta. I'm guessing after this I just need to open a PR on the rust beta branch to update the cargo submodule?