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

fix printing of SKIP binaries #13778

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions conan/cli/printers/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,15 @@ def print_graph_packages(graph):
if node.recipe in (RECIPE_CONSUMER, RECIPE_VIRTUAL):
continue
if node.context == CONTEXT_BUILD:
build_requires[node.pref] = node.binary, node.binary_remote
existing = build_requires.setdefault(node.pref, [node.binary, node.binary_remote])
else:
if node.test:
test_requires[node.pref] = node.binary, node.binary_remote
existing = test_requires.setdefault(node.pref, [node.binary, node.binary_remote])
else:
requires[node.pref] = node.binary, node.binary_remote
existing = requires.setdefault(node.pref, [node.binary, node.binary_remote])
# TO avoid showing as "skip" something that is used in other node of the graph
if existing[0] == BINARY_SKIP:
existing[0] = node.binary

def _format_requires(title, reqs_to_print):
if not reqs_to_print:
Expand Down
19 changes: 19 additions & 0 deletions conans/test/integration/graph/test_skip_binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,22 @@ def test_build_scripts_no_skip():
c.run("install app")
c.assert_listed_binary({"script/0.1": ("da39a3ee5e6b4b0d3255bfef95601890afd80709", "Cache")},
build=True)


def test_list_skip_printing():
""" make sure that when a package is required in the graph, it is not marked as SKIP, just
because some other part of the graph is skipping it. In this case, a tool_require might be
necessary for some packages building from soures, but not for others
"""
c = TestClient()
c.save({"tool/conanfile.py": GenConanfile("tool", "0.1"),
"pkga/conanfile.py": GenConanfile("pkga", "0.1").with_tool_requires("tool/0.1"),
"pkgb/conanfile.py": GenConanfile("pkgb", "0.1").with_requires("pkga/0.1")
.with_tool_requires("tool/0.1"),
"app/conanfile.py": GenConanfile().with_requires("pkgb/0.1")})
c.run("create tool")
c.run("create pkga")
c.run("export pkgb")
c.run("install app --build=missing")
c.assert_listed_binary({"tool/0.1": ("da39a3ee5e6b4b0d3255bfef95601890afd80709", "Cache")},
build=True)
franramirez688 marked this conversation as resolved.
Show resolved Hide resolved