Env var configuration errors may contain duplicate error messages #7782
Labels
A-configuration
Area: cargo config files and env vars
A-diagnostics
Area: Error and warning messages generated by Cargo itself.
S-needs-mentor
Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.
Playing around a bit today, I saw:
Here the "could not load key..." is duplicated in the error message, but probably shouldn't be! Doing some debugging this is related to
ConfigError::with_key_context
and it's called twice on the stack both from this location --cargo/src/cargo/util/config/de.rs
Line 472 in 6dd57b2
(line numbers relative to https://github.com/rust-lang/cargo/tree/6dd57b2045f37fc8172176e333d0fcd3e07cdea1)
I wanted to write this down but I'm honestly not sure there's much we can do about this. This is extremely specific I believe and crops up because there's two layered
Value<T>
instances being deserialized. One is the outerOptValue
type and one is inside thePathAndArgs
type. I don't think that the outer type knows that the context was already attached, so it ends up getting attached twice.This looks like it's pretty local to this one specific key, so it's probably fine if we don't prioritize this too much.
The text was updated successfully, but these errors were encountered: