Skip to content

Commit

Permalink
runtime error conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
memsharded committed Feb 13, 2025
1 parent 90ff3a4 commit fef7b71
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 5 additions & 2 deletions conans/client/graph/graph_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,8 @@ def __init__(self, node, conflicting_node):
self.conflicting_node = conflicting_node

def __str__(self):
return f"Runtime Error: Could not process '{self.node.ref}' with " \
f"'{self.conflicting_node.ref}'."
return f"Runtime Conflict Error: There is a conflict between packages that will happen " \
f"at runtime (but not at compile time), like different versions of the same shared " \
f"library that would end in the path. Please check the 'application' and " \
f"'shared-library' package types and requirements with 'run=True' trait in your " \
f"graph: '{self.node.ref}' with '{self.conflicting_node.ref}'."
9 changes: 7 additions & 2 deletions test/integration/graph/core/test_build_requires.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,17 @@ def test_build_require_transitive_shared(self):
self._cache_recipe("zlib/0.2", GenConanfile().with_shared_option(True))
self._cache_recipe("cmake/0.1", GenConanfile().with_require("zlib/0.1"))
self._cache_recipe("mingw/0.1", GenConanfile().with_require("zlib/0.2"))
self._cache_recipe("lib/0.1", GenConanfile().with_tool_requires("cmake/0.1",
"mingw/0.1"))
self._cache_recipe("lib/0.1", GenConanfile().with_tool_requires("cmake/0.1", "mingw/0.1"))
deps_graph = self.build_graph(GenConanfile("app", "0.1").with_require("lib/0.1"),
install=False)

assert type(deps_graph.error) == GraphRuntimeError
expected = "Runtime Conflict Error: There is a conflict between packages that will happen " \
"at runtime (but not at compile time), like different versions of the same " \
"shared library that would end in the path. Please check the 'application' " \
"and 'shared-library' package types and requirements with 'run=True' " \
"trait in your graph: 'mingw/0.1' with 'zlib/0.2'."
assert str(deps_graph.error) == expected

self.assertEqual(6, len(deps_graph.nodes))
app = deps_graph.root
Expand Down

0 comments on commit fef7b71

Please sign in to comment.