yay icon indicating copy to clipboard operation
yay copied to clipboard

Explain source of dependency when erroring out

Open xeruf opened this issue 9 months ago • 6 comments

Is your feature request related to a problem? Please describe.

I see the message "No AUR package found for ..." when running an update. Yay refuses to upgrade my system. I have to manually investigate which package causes the trouble. If I do not find time for that debugging, my system might end up in a case of update debt creating bigger issues.

Describe the solution you'd like

Show the dependee, maybe simply in parentheses after the message.

Describe alternatives you've considered

Manual digging

xeruf avatar May 13 '24 04:05 xeruf

Similar to https://github.com/Jguer/yay/issues/2290

I think this is a good improvement

Jguer avatar May 13 '24 08:05 Jguer

Hi! Is this still open? If yes, is anyone working on this? I'd like to take my shot at it if it's still up for grabs.

camilosm avatar Jul 04 '24 21:07 camilosm

Hey @camilosm , please go ahead

Jguer avatar Jul 05 '24 08:07 Jguer

@xeruf can you describe how to reproduce this behavior?

camilosm avatar Jul 05 '24 20:07 camilosm

Searching the codebase, the mentioned error message ("No AUR package found for") only appears twice: https://github.com/Jguer/yay/blob/836fc5922a3221ed1edbdaf5f1b642696f622cdf/pkg/dep/dep_graph.go#L442 in this instance, the message is followed by target, which comes from iterating over targets. However, if targets is empty, the function returns prematurely before reaching the message log point, therefore the log message should always print a target.

https://github.com/Jguer/yay/blob/836fc5922a3221ed1edbdaf5f1b642696f622cdf/pkg/dep/dep_graph.go#L548 this time, depString should be on the message, and it comes from iterating over the deps set as a slice. However, if the deps has cardinality zero, that is, if the set is empty, then this function also returns prematurely before reaching the log, and therefore the log message should also always print a dependency.

So in both instances, after analyzing the code, I can't find a scenario where the log message is not followed by the package that caused the error.

Maybe I'm missing something, as it's my first time contributing. So if anyone has an idea of how to reproduce the problem, or any other hints, please point me in the right direction.

camilosm avatar Jul 11 '24 21:07 camilosm

This checks out @camilosm , I believe what is missing is for example: depString was not found. but what required depString in the first place.

Example desired output: No AUR package found for lib32-nvidia-utils-beta (required by: nvidia-beta)

Jguer avatar Aug 01 '24 08:08 Jguer