config errors with alias may not be reported #11013
Labels
A-aliases
Area: command aliases
A-configuration
Area: cargo config files and env vars
A-diagnostics
Area: Error and warning messages generated by Cargo itself.
C-bug
Category: bug
Problem
If there is a syntax error in a
.cargo/config
file, and the user tries to run an alias command, there is no indication of why it failed to find the alias.Steps
Create a
.cargo/config
:Notice the missing comma.
Run
cargo foo
Observe the output:
At this point, it isn't immediately clear what went wrong.
Possible Solution(s)
If there is an error loading the config, and cargo is unable to find the command to run, then it should probably relay the config error to the user.
There may be other situations where it might be useful to relay the config error. For example, if I have an alias like
clippy
, and the config fails to load, cargo will go ahead and runclippy
without the aliased arguments.I'm not sure when and how it would be best to relay the information about the malformed config. It also may be difficult to plumb the error up to the alias-handling code.
Notes
No response
Version
The text was updated successfully, but these errors were encountered: