Jguer / yay

Yet another Yogurt - An AUR Helper written in Go
GNU General Public License v3.0
11.04k stars 361 forks source link

Explain source of dependency when erroring out #2445

Open xeruf opened 4 months ago

xeruf commented 4 months ago

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

Jguer commented 4 months ago

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

I think this is a good improvement

camilosm commented 3 months ago

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.

Jguer commented 3 months ago

Hey @camilosm , please go ahead

camilosm commented 3 months ago

@xeruf can you describe how to reproduce this behavior?

camilosm commented 2 months ago

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.

Jguer commented 2 months ago

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)