[bug] Bad explanation on error message for unmatched dependency.
See original GitHub issueI 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:
- Created a year ago
- Comments:11 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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:
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:
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 ?
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:
boost/1.67
andpoco/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.12That 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.