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

[feature] Improve version conflict ERROR message #13420

Closed
1 task done
SpaceIm opened this issue Mar 12, 2023 · 7 comments
Closed
1 task done

[feature] Improve version conflict ERROR message #13420

SpaceIm opened this issue Mar 12, 2023 · 7 comments
Labels
complex: medium component: ux No changes to core business logic
Milestone

Comments

@SpaceIm
Copy link
Contributor

SpaceIm commented Mar 12, 2023

What is your suggestion?

In libvips recipe (not yet in conancenter, see conan-io/conan-center-index#16339) there is currently a version conflict while using conan v2 client because glib still depends on pcre2/10.40 while libselinux (a dependency of glib when OS is Linux) has been updated to depend on pcre2/10.42.

Error message is:

Requirements
    bzip2/1.0.8#23cc41191fd58460207c5db046033507 - Downloaded (conan-center)
    expat/2.5.0#98829cfd97ab55bceed0911eb7825a72 - Downloaded (conan-center)
    glib/2.76.0#4ee3d71731f46b4e05ed319c69446acf - Downloaded (conan-center)
    libelf/0.8.13#2a27c51d562810af629795ac4aa85666 - Downloaded (conan-center)
    libffi/3.4.3#ab23056d668dc13482a811f215f7be3e - Downloaded (conan-center)
    libmount/2.36.2#a5c932e8f220bde1f375be0db7ed5800 - Downloaded (conan-center)
    libselinux/3.3#1bb9670b14ef607941dd43bf155ce7e3 - Downloaded (conan-center)
    libvips/8.14.1#2dd2cfc288fffbf20c74ea6309ded9db - Cache
    pcre2/10.40#58467e19b38a61f5c3f065006fb684f6 - Downloaded (conan-center)
    zlib/1.2.13#13c96f538b52e1600c40b88994de240f - Downloaded (conan-center)
Build requirements
    autoconf/2.71#f4e2bd681d49b4b80761aa587bde94d5 - Downloaded (conan-center)
    gnu-config/cci.20210814#eb941b98dbf40f3eb1753f6b1f05861f - Downloaded (conan-center)
    m4/1.4.19#c1c4b1ee919e34630bb9b50046253d3c - Cache
Graph error
    Version conflict: libselinux/3.3->pcre2/10.42, None->pcre2/10.40.
ERROR: Version conflict: libselinux/3.3->pcre2/10.42, None->pcre2/10.40.

This None->pcre2/10.40 message is not helpful, would it be possible to list the correct recipes having conflicting dependencies versions? Here it should be something like ERROR: Version conflict: libselinux/3.3->pcre2/10.42, glib/2.76.0->pcre2/10.40..

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@AbrilRBS AbrilRBS self-assigned this Mar 13, 2023
@AbrilRBS
Copy link
Member

Hi! Thanks for the report. After looking at it for a bit, I've come to the conclusion that this would not be trivial to solve. That "None" represents in this case the virtual node for the graph when running conan create. Although we could get the node it "represents" and show that one, it would not be giving wrong info when the base of the diamond is not the first recipe, but something upstream.

Maybe we can look into this at a later date when more pressing things are past us and we can focus on improving the UX with issues such as this one :)

@AbrilRBS AbrilRBS added complex: medium component: ux No changes to core business logic labels Mar 13, 2023
@AbrilRBS AbrilRBS removed their assignment Mar 13, 2023
@alLiucb
Copy link

alLiucb commented Apr 9, 2023

Did you solve this problem?

@fourbft
Copy link

fourbft commented May 10, 2023

I would like to support this issue!
I just stumbled across this problem in your tutorials about Dependencies conflicts and also wanted to report it.

In the output of the first conan install game command there the error message printed by conan is:

Graph error
    Version conflict: intro/1.0->matrix/1.1, game/1.0->matrix/1.0.

(I could locally reproduce that message with conan version 2.0.4)
But in that example, game/1.0 does not depend on matrix/1.0 directly, but on engine/1.0which in turn depends on matrix/1.0. So there, too, I would expect the message to be:

Graph error
    Version conflict: intro/1.0->matrix/1.1, engine/1.0->matrix/1.0.

At least that would be much more helpful.
I know, it seems like a trivial matter in these simple scenarios, but in our real-life world with deep dependency trees often involving dozens of components, we frequently have to deal with these kinds of version conflicts. And a detailed error message pointing you at the correct places right away can make a huge difference!

@memsharded
Copy link
Member

For complicated cases, the solution would not be printing anything way smarter to terminal, but instead producing a better html graph representation that highlights the conflict and allow to visualize the graph branches that cause the conflict

@fourbft
Copy link

fourbft commented May 11, 2023

Absolutely true, @memsharded , that would be the best solution. Especially because such a version conflict could be caused by several upstreams simultaneously. E. g. two upstreams requiring version 1.0 of a package, three others requiring 1.1 and another four requiring version 2.0. Would be pretty hard to squeeze that kind of information into a concise error message. - Whereas, maybe not impossible (with a nice ascii list/table).

With the html-graph feature, the conflict error message could/should then point the user to it. E. g.: "There are version conflicts in the upstream graph. Use 'conan graph ...' to generate an html overview which will show the conflicting dependencies."

But what the error message should not do is give the user "wrong" or at least confusing information, like it currently does. Maybe a quick fix would be not to print (in the tutorial example) game/1.0->matrix/1.0 but something like game/1.0 (or some other upstream)->matrix/1.0. Because I know my people. What they'll do in the current state is look up game's conanfile, see that there is no dependency on matrix/1.0 and they'll be lost and/or say: bug in conan!

@memsharded
Copy link
Member

with the html-graph feature, the conflict error message could/should then point the user to it. E. g.: "There are version conflicts in the upstream graph. Use 'conan graph ...' to generate an html overview which will show the conflicting dependencies."

Yes, totally agree

But what the error message should not do is give the user "wrong" or at least confusing information, like it currently does. Maybe a quick fix would be not to print (in the tutorial example) game/1.0->matrix/1.0 but something like game/1.0 (or some other upstream)->matrix/1.0. Because I know my people. What they'll do in the current state is look up game's conanfile, see that there is no dependency on matrix/1.0 and they'll be lost and/or say: bug in conan!

Sure, lets try to improve the message. In any case, I think improving the html graph with colors shouldn't be too complicated, lets try to do it at once.

@memsharded memsharded added this to the 2.0.6 milestone May 11, 2023
@memsharded memsharded modified the milestones: 2.0.6, 2.0.7 May 24, 2023
@AbrilRBS
Copy link
Member

Closed by #13946 which improves the error message a bit, but more importantly makes the html output able to highlight conflicting nodes for better debugability

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complex: medium component: ux No changes to core business logic
Projects
None yet
Development

No branches or pull requests

5 participants