-
Notifications
You must be signed in to change notification settings - Fork 716
TargetSelector: Include a hint in the error message for internal error #8628
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
Conversation
looks like the ghc 9.4.2 CI is broken unrelated to this |
Indeed, CI was broken. Let me rebase to include the fix. |
@mergify rebase |
✅ Branch has been successfully rebased |
Success! |
Hi, thanks for the pr. I agree this is not optimal and it does not scale if we have to list all possible causes of the error. Having only one of the possible causes will make users check it in first place for the rest of cases. |
For what it's worth, I just ran into this error, and the hint given here would have resolved my problem. |
Hah, so we have divergent opinions. @jneira: any cheap constructive suggestion from you? E.g., adding a disclaimer to the hint that it's only one of possible causes? Any other opinions, ideas, anybody? |
yeah such disclaimer would be fine, good idea |
I like the current state. What I'm afraid of is that the output is already very mouthful. I'm not sure many people will get to the hint. Even less so — to the disclaimer. I'd invite people to think whether we could shrink the preexisted text. Anyway, I think this should be merged in some form; e.g. just adding a disclaimer to the current wording in the patch would work for me. |
So perhaps let's start with a short version of the hint and elaborate afterwards? @lf-: your take? we'd better merge ASAP for cabal 3.10. |
Thoughts on the following attempt? I can get it into code later today.
|
several edits later, i think my rewrite of the message is at least more legible and concise. any thoughts? did i remove any info that needed to be there? |
@dmwit: you are the positive force here: would that one be helpful to you still? |
Looks like a good improvement to me, thank you!
Well, our failure to do the latter (provide a more specific error) is a bug, but the former (resolve the target) may be not. So, this phrase is a little confusing to me. |
My understanding of this error is that this error is saying "we screwed up and couldn't come up with an unambiguous qualified name for the target", which is always a bug. There's two cases:
|
Maybe I'm wrong but I think that this failure can come from the fact that the user underspecified the target. Imagine there's an executable and a test with the same name |
Nope, this is specifically a "we screwed up" error. That error is as follows, today:
|
Alright, it looks like so:
|
The updated error+hint looks quite approachable to me. The target name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say, let's ship it.
@lf-: please kindly set the merge_me label once you are ready. |
I cannot do this because I don't have the relevant github role, but go ahead and merge :) |
Oh, you have not accepted the invite? Whatever you prefer... |
ah my mistake, didn't see the email. done |
Splendid. Thank you. In 2 days, it should auto-merge, unless the PR changes. |
This is a mediocre solution, and really should generate a different error entirely at an earlier stage, but I'm not familiar enough with how to achieve that.
To get the future behavior now, you can configure Or you can create a dedicated github account for squash and rebase operations, and use it in different |
f071c9d
to
58bc9c7
Compare
This is a mediocre solution, and really should generate a different error entirely at an earlier stage, but I'm not familiar enough with how to achieve that and I don't think I have time at the moment.
Fixes #8484.
Please include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!