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

Do not skip dependencies marked as skipped by other node in the graph #5547

Merged
merged 4 commits into from
Jul 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 9 additions & 2 deletions conans/client/graph/graph_binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def _evaluate_node(self, node, build_mode, update, evaluated_nodes, remotes):
return

ref, conanfile = node.ref, node.conanfile
pref = node.pref
# If it has lock
locked = node.graph_lock_node
if locked and locked.pref.id == node.package_id:
Expand All @@ -53,7 +52,13 @@ def _evaluate_node(self, node, build_mode, update, evaluated_nodes, remotes):
if previous_nodes:
previous_nodes.append(node)
previous_node = previous_nodes[0]
node.binary = previous_node.binary
# The previous node might have been skipped, but current one not necessarily
# keep the original node.binary value (before being skipped), and if it will be
# defined as SKIP again by self._handle_private(node) if it is really private
if previous_node.binary == BINARY_SKIP:
node.binary = previous_node.binary_non_skip
else:
node.binary = previous_node.binary
node.binary_remote = previous_node.binary_remote
node.prev = previous_node.prev
return
Expand Down Expand Up @@ -229,6 +234,8 @@ def _handle_private(self, node):
# Current closure contains own node to be skipped
for n in neigh.public_closure.values():
if n.private:
# store the binary origin before being overwritten by SKIP
n.binary_non_skip = n.binary
n.binary = BINARY_SKIP
self._handle_private(n)

Expand Down
23 changes: 23 additions & 0 deletions conans/test/functional/build_requires/build_requires_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,29 @@ def build_requirements(self):


class BuildRequiresTest(unittest.TestCase):

def test_consumer(self):
# https://github.com/conan-io/conan/issues/5425
t = TestClient()
t.save({"conanfile.py": str(TestConanFile("catch", "0.1", info=True))})
t.run("create . catch/0.1@user/testing")
t.save({"conanfile.py": str(TestConanFile("LibA", "0.1",
private_requires=["catch/0.1@user/testing"]))})
t.run("create . LibA/0.1@user/testing")
t.save({"conanfile.py": str(TestConanFile("LibC", "0.1",
requires=["LibA/0.1@user/testing"],
build_requires=["catch/0.1@user/testing"]))})
t.run("install .")
self.assertIn("catch/0.1@user/testing from local cache", t.out)
self.assertIn("catch/0.1@user/testing:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Skip",
t.out)
self.assertIn("catch/0.1@user/testing:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache",
t.out)
conanbuildinfo = load(os.path.join(t.current_folder, "conanbuildinfo.txt"))
self.assertIn('MYENV=["myenvcatch0.1env"]', conanbuildinfo)
self.assertIn('[libs_catch]', conanbuildinfo)
self.assertIn("mylibcatch0.1lib", conanbuildinfo)

def test_build_requires_diamond(self):
t = TestClient()
t.save({"conanfile.py": str(TestConanFile("libA", "0.1"))})
Expand Down