question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] Bad explanation on error message for unmatched dependency.

See original GitHub issue

I have looked at the bug reports for this and i found https://github.com/conan-io/conan/issues/7864 , but I was unable to understand what to do.

I have a fairly small conanfile (excerpt from a bigger project):

from conans import ConanFile, CMake

class DiagramServerConan(ConanFile):
    settings = "os", "compiler", "build_type", "arch"

    generators = (
        "cmake_find_package",
        "cmake_paths",
    )

    requires = (
        "flex/2.6.4",
        "bison/3.7.6",
    )

this (correctly) tells me that I have an unmatched dependency;

ERROR: Conflict in bison/3.7.6:
    'bison/3.7.6' requires 'm4/1.4.19' while 'flex/2.6.4' requires 'm4/1.4.18'.
    To fix this conflict you need to override the package 'm4' in your root package.

So I add m4 in my root package:

from conans import ConanFile, CMake

class DiagramServerConan(ConanFile):
    settings = "os", "compiler", "build_type", "arch"

    generators = (
        "cmake_find_package",
        "cmake_paths",
    )

    requires = (
        "flex/2.6.4",
        "bison/3.7.6",
        "m4/1.4.19",
    )

and now I have a different error:

WARN: flex/2.6.4: requirement m4/1.4.18 overridden by your conanfile to m4/1.4.19 
ERROR: Conflict in flex/2.6.4:
    'flex/2.6.4' requires 'm4/1.4.18' while 'bison/3.7.6' requires 'm4/1.4.19'.
    To fix this conflict you need to override the package 'm4' in your root package.
➜  testconan2 

the wording on the error is strange, as adding the m4 to my requires is adding to my root package (if I’m not mistaken). I also tried to add on build_requires, to the same issue.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tarcisiofischercommented, Jun 17, 2022

Well, to be fair, Conan could try pointing a little more information in the error message, hoping to get the user in the right direction.

To be more specific, let’s go back to the original error:

ERROR: Conflict in flex/2.6.4:
    'flex/2.6.4' requires 'm4/1.4.18' while 'flex/2.6.4' requires 'm4/1.4.19'.
    To fix this conflict you need to override the package 'm4' in your root package.

It is impossible to know from which flex Conan is talking about due to the lack of context. I guess it assumes ‘conancenter’, but that’s just the common case - If the user tries to go to conancenter like I did, he won’t find anything useful. It’s just misleading… Or it assumes the user will know it, but it’s always good to double check than relying on my memory 😃

So I propose the error message could be something like this:

ERROR: Conflict in flex/2.6.4:
    'flex/2.6.4:HASH' (from 'local build') requires 'm4/1.4.18' while 'flex/2.6.4:HASH' (from 'conancenter') requires 'm4/1.4.19'.
    To fix this conflict you need to override the package 'm4' in your root package.

    If the cached package is unwanted, you can try removing it from the cache using
    $ conan remove flex/2.6.4:123456789ABC

There’s no need to fetch anything from the server to print this info, I believe. But I don’t know if I’m being too narrowed by this specific case. What do you think, @memsharded ?

0reactions
memshardedcommented, Jun 16, 2022

The message error should be improved, then. There was no mention about cache issues, just a bit of nonsense about impossible dependency graphs.

But this is not a cache issue. You can install packages in a blank cache, directly from the server, and still have conflicts. These conflicts happen because of diamonds in the graph:

  • You create zlib/1.2.11 and zlib/1.2.12 packages, upload to the server
  • You create boost/1.67 that depends on zlib/1.2.11, works great, upload to the server
  • You create poco/1.11 that depends on zlib/1.2.12 works great, upload to the server
  • In a blank client, with a blank cache, you setup a project that depends on boost/1.67 and poco/1.11. That will download the different things to the cache, evaluate the graph and trigger a version conflict between zlib/1.2.11 and zlib/1.2.12

That is not a cache issue at all. It is an impossible, conflicted graph, but it is not a failure about the cache.

Just in case, Conan commands will not go and check the servers on every command, if they can find things locally in the cache. This is a very desired and requested behavior by tons of users, because of performance. Users can opt-in to check latest things from the server with --update, and if that happens, Conan might download new versions or revisions of packages.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I resolve unmet dependencies after adding a PPA?
If the error shows something like this: · One possible cause of unmet dependencies could be corrupted package database, and/or some packages weren't...
Read more >
Dependency tree for Bug 67491
... 71125: [concepts] Spurious 'invalid reference to function concept error' issued when overloads are not all declared with the concept specifier [NEW; ...
Read more >
SML/NJ Error Messages
This document contains lists of error and warning messages produced by the SML/NJ Version 110 compiler, sorted alphabetically, with short explanations and ...
Read more >
How do I resolve `The following packages have unmet ...
So when I tried to install NPM again, I got this error. ... This is a bug in the npm package regarding dependencies...
Read more >
Issues
Issue types · Bug: A coding mistake that can lead to an error or unexpected behavior at runtime. · Vulnerability: A point in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found