Skip to content
This repository has been archived by the owner on May 31, 2018. It is now read-only.

improve cyclic dependency error message output #739

Open
rmarquis opened this issue Jul 27, 2017 · 3 comments
Open

improve cyclic dependency error message output #739

rmarquis opened this issue Jul 27, 2017 · 3 comments

Comments

@rmarquis
Copy link
Owner

rmarquis commented Jul 27, 2017

Cyclic dependencies are correctly detected (see f.e. #734), but knowing which target is responsible for it isn't straightforward.

:: Package pdftk not found in repositories, trying AUR...                                                                                
:: resolving dependencies...                                                                                                             
tsort: -: input contains a loop:                                                                                                         
tsort: gcc-gcj-ecj                                                                                                                       
tsort: gcc63-gcj                                                                                                                         
tsort: gcc63                                                                                                                             
tsort: -: input contains a loop:                                                                                                         
tsort: gcc-gcj-ecj                                                                                                                       
tsort: gcc63-gcj                                                                                                                         
:: dependency cycle detected 

This isn't an issue when explictly installing a specific package, but can be when updating as it might be difficult to know which target is responsible for the issue. Modify the error message to display the target, similarly as done in #173.

:: dependency cycle detected (target -> dep1 -> dep2 -> dep1)

This might not be straightforward to do with tsort, but might be easier done in conjunction with the solver provided by auracle (see #720).

@rmarquis rmarquis added the todo label Jul 27, 2017
@rmarquis rmarquis added this to the 4.8.x - new features milestone Jul 27, 2017
@AladW
Copy link
Contributor

AladW commented Jul 27, 2017

OpenBSD probably has the best tsort implementation on this regard:

http://man.openbsd.org/tsort

That said, I'd agree to have auracle do the heavy lifting. Perhaps open a new issue to expand on falconindy/auracle#7 (comment)

@rmarquis
Copy link
Owner Author

Yeah, another proof that BSD > Linux >:)

I've spammed the auracle tracker enough for now, I'll wait for some more improvements before opening new tickets. And familiarize myself with the code in the meantime (sadly, my cpp is near inexistant).

@ismaelgv
Copy link
Contributor

ismaelgv commented Jul 29, 2017

And familiarize myself with the code in the meantime (sadly, my cpp is near inexistant).

I've taken a look to the code and it seems that there is a mix of C++ and C. Part of the C++ code is written following C style that are not usually found in actual C++. I am used to work with C++ and some fragments of code looks pretty weird a not C++ idiomatic to me. Maybe it is just my perception, I am not a C++ guru anyways.

Edit: I have looked again the code and I was wrong, there is only C++ code.

Edit 2: It seems that he has reused some old parts in the transition from cower. I suppose this is the reason of C-like code and structures. There are other many parts pure C++ idiomatic. It is a bit hard to follow the code in some parts since there is not much comments/documentation yet but it is a really interesting project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants