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] Compatible cached packages not resolved correctly

See original GitHub issue

Environment Details (include every applicable attribute)

  • Operating System+version: Windows 10 64
  • Compiler+version: VS 2019 16
  • Conan version: 1.41.0
  • Python version: 3.8.8
  • Revisions enabled: True

Steps to reproduce (Include if Applicable)

  • Assume packages A, B, C, D and two build settings Settings1 and Settings2 resulting in different package ids.
  • B requires A
  • C requires A
  • D requires both B and C
  • A, B and C have been built with Settings1 and each override package_id to provide a compatible package for Settings2.
  • D needs to be built with Settings2

If you call conan install on D with Settings2 we observer the following:

  • A, B and C are reported as missing but a compatible package has been found: A/1.0@user/channel: Main binary package 'f278b6f5a018dfdaf3f1aaf111c91b35b8dbeec5' missing. Using compatible package 'f85619e3f4a4d53fb5b48d3c40437fc2f08c69e6' B/1.0@user/channel: Main binary package 'f278b6f5a018dfdaf3f1aaf111c91b35b8dbeec5' missing. Using compatible package 'f85619e3f4a4d53fb5b48d3c40437fc2f08c69e6' C/1.0@user/channel: Main binary package 'f278b6f5a018dfdaf3f1aaf111c91b35b8dbeec5' missing. Using compatible package 'f85619e3f4a4d53fb5b48d3c40437fc2f08c69e6'
  • A might end up multiple times within the self.info.requires dict used in the package_id methods of B and C due to different package ids which leads to wrong hashes being created.
  • If we workaround the previous issue by throwing out the multiple occurrances of the same package requires within package_id, the wrong package binary is finally used for A: File "c:\programdata\anaconda3\lib\site-packages\conans\client\installer.py", line 560, in _handle_node_cache assert os.path.isdir(package_folder), ("Package '%s' folder must exist: %s\n" AssertionError: Package 'A/1.0@user/channel:f278b6f5a018dfdaf3f1aaf111c91b35b8dbeec5' folder must exist: C:\.conan\3785e5\1

Perhaps this might be related to #9446

Possible Fix ?

  • From debugging we found that there exist two nodes in the conan graph for package A, which originally point to the same package id.
  • For the first node A _evalute_node from file graph_binaries.py is called and compatible packages are computed. Then, the _package_id of that node is set to the compatible package id f85619... and the node.binary is set to cached mode.
  • For the second node A _evaluate_is_cached in the same file encounters the first node A (previous_nodes) and sets its binary also cached as well. However, the _package_id is not modified.

If we set the _package_id to the previous_node everything works fine but we are not sure if this has any unwanted side effects: node._package_id = previous_node._package_id

I hope that this helps in resolving the bug.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
burgerkiller79commented, Jan 4, 2022

I’m glad I was able to contribute something. I don’t necessarily have to submit the PR, especially since you already did it, but thanks for the offer.

0reactions
memshardedcommented, Jan 3, 2022

Great, I have been able to reproduce with your test changes too.

Also reviewed your fix, it is indeed looking good, exactly in the spot, great job. Thanks for all the work. I have submitted PR #10266 for 1.45, but if you want to submit it yourself to become official contributor, you totally deserve it, just let me know and I will close my PR.

This will be naturally merged to develop2 branch too, lets try to make sure that this continue to work in 2.0 (except a new way to define visibility will be introduced).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug listing with status RESOLVED with resolution FIXED as at ...
... Bug:180 - "baselayout package is updated during installation. when unmerging the older version /boot gets deleted if not mounted" status:RESOLVED ...
Read more >
Problem: Unable to resolve dependencies of NuGet packages
The cause for this error is that NuGet cache conflicts with the build of the site. Solution. To resolve the problem, perform the...
Read more >
[bug] Compatible package failure if a package and its ... - GitHub
1 , but lists both packages in the build plan, and then complains of a missing folder.
Read more >
Xcode 13 "Missing package product"… - Apple Developer
Clearing the package cache, derived data, or restarting the application does not resolve the issue. Only Swift Packages that are remotely loaded from...
Read more >
Troubleshooting NuGet Package Restore in Visual Studio
This error occurs when you attempt to build a project that contains references to one or more NuGet packages, but those packages are...
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