-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cargo prints warnings with full paths #694
Comments
This is somewhat at odds with #209 and I'm not sure that there's really any great solution here. If we print I suppose the story is a little different with dependencies vs the local package though, and perhaps we could just use absolute paths for all dependencies and relative paths for the local package. |
Personally, I use the paths to quickly navigate to the compile error/warning. I assume that the cases where I would fix most usually are my own code (under My expectations (warning/error on my own project):
My expectations (warning/error on a dependency):
Another solution would be to use something like what ruby does for dependencies:
I am sorry for only providing expectations and not solutions but I am quite new to Rust and cargo's code seems to me like a beast to navigate. |
@vrinek that sounds like a good system to me! |
I'm trying to help out on a Sublime Text linter and so far the biggest challenge for me is figuring out which file is which based on relative paths. From a tooling perspective, getting the full filename is definitely the easiest. |
Current cargo (492bc86) does this, which is very confusing:
Those warnings all come from different libs and it's completely unclear which ones... So there's gotta be a happy medium in here somewhere |
Please let the user have the choice. You can have cargo build --rel-path and cargo build --full-path and have one of them by default, but you will never find one that fit everyone ! I absolutely need absolute path for integration in some IDE, but some might not need it. Command line parameter is the key. |
I agreed with @stibbons. For now we just need the command line option and either of them as a default. |
All paths printed will now be absolute paths unless the path is a descendant of the current directory. This should keep error messages and warnings of a reasonable length when working with the local project while still allowing errors in registry/git dependencies to be tracked down. Special care is taken in these situations to ensure that the error message from the compiler prints a reasonable path. Closes rust-lang#209 Closes rust-lang#694
All paths printed will now be absolute paths unless the path is a descendant of the current directory. This should keep error messages and warnings of a reasonable length when working with the local project while still allowing errors in registry/git dependencies to be tracked down. Special care is taken in these situations to ensure that the error message from the compiler prints a reasonable path. Closes #209 Closes #694
I would also like to have the option of having a |
@emoon I think we could definitely do that, want to open a separate issue to track that? |
Awesome! Will do :) Thanks. Added here #5450 |
cargo build
prints compile time warnings using full file paths. This results in very long lines making it either wrap on a moderately widened terminal window and/or hard to follow.Sample cargo output:
For comparison:
Versions:
The text was updated successfully, but these errors were encountered: