Skip to content
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

Opt-in flag for absolute paths in diagnostics #770

Closed
1 of 3 tasks
pnkfelix opened this issue Aug 9, 2024 · 2 comments
Closed
1 of 3 tasks

Opt-in flag for absolute paths in diagnostics #770

pnkfelix opened this issue Aug 9, 2024 · 2 comments
Labels
major-change A proposal to make a major change to rustc T-compiler Add this label so rfcbot knows to poll the compiler team

Comments

@pnkfelix
Copy link
Member

pnkfelix commented Aug 9, 2024

Proposal

rustc should offer a way for users to request absolute paths in its diagnostic output as an opt-in (e.g. env var and/or command line flag, e.g. --error-format=human,absolute-paths)

We know from experience (rust-lang/rust#47355, rust-lang/rust#47669, rust-lang/rust#128726, rust-lang/cargo#4998, rust-lang/cargo#9887) that some tools have difficulty dealing with the relative paths that rustc emits.

(This problem was somewhat exacerbated by rust-lang/cargo#4788; there were some changes make in the wake of that PR that addressed some of the problems above, but not all of them.)

There is general interest on the cargo side to have some way to opt-into generation of absolute paths, see e.g.: rust-lang/cargo#5450

My suggestion is that we get the basic functionality here put into rustc.

In speaking with @estebank , they mentioned that there's a wealth of options here.

  • E.g. the json diagnostic format could include both a relative path and an absolute path, and let the tool decide which one to present. I'm sure there's many options along those lines; I just want to get the ball rolling on having some way for the user to say "I want my diagnostics to use absolute paths, thank you."
  • Also, there was some effort back in 2018 to try to give rustc a way to say "print your diagnostics relative to location X instead of what you think is the current working directory"; you can see discussion of that over on Add a compiler option for a 'pseudo-cwd' for rustc errors rust#47939, but the summary is that the work fizzled out because the team decided the feature was to hacky for us to adopt.

Mentors or Reviewers

@estebank is my current "obvious" choice for mentorship/review.

Process

The main points of the Major Change Process are as follows:

  • File an issue describing the proposal.
  • A compiler team member or contributor who is knowledgeable in the area can second by writing @rustbot second.
    • Finding a "second" suffices for internal changes. If however, you are proposing a new public-facing feature, such as a -C flag, then full team check-off is required.
    • Compiler team members can initiate a check-off via @rfcbot fcp merge on either the MCP or the PR.
  • Once an MCP is seconded, the Final Comment Period begins. If no objections are raised after 10 days, the MCP is considered approved.

You can read more about Major Change Proposals on forge.

Comments

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

@pnkfelix pnkfelix added T-compiler Add this label so rfcbot knows to poll the compiler team major-change A proposal to make a major change to rustc labels Aug 9, 2024
@rustbot
Copy link
Collaborator

rustbot commented Aug 9, 2024

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

Concerns or objections to the proposal should be discussed on Zulip and formally registered here by adding a comment with the following syntax:

@rustbot concern reason-for-concern 
<description of the concern> 

Concerns can be lifted with:

@rustbot resolve reason-for-concern 

See documentation at https://forge.rust-lang.org

cc @rust-lang/compiler @rust-lang/compiler-contributors

@rustbot rustbot added the to-announce Announce this issue on triage meeting label Aug 9, 2024
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Aug 15, 2024
@pnkfelix
Copy link
Member Author

Closing due to lack of interest from other team members

@RalfJung RalfJung closed this as not planned Won't fix, can't repro, duplicate, stale Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major-change A proposal to make a major change to rustc T-compiler Add this label so rfcbot knows to poll the compiler team
Projects
None yet
Development

No branches or pull requests

4 participants