-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[bug] ERROR: Build-require 'xxx' cannot be found in lockfile (but it's there) #10544
Comments
@memsharded any ideas what could be wrong here? |
I have had a look. I have checked that if: diff --git a/recipes/libtool/all/conanfile.py b/recipes/libtool/all/conanfile.py
index b20875b66..7e254a242 100644
--- a/recipes/libtool/all/conanfile.py
+++ b/recipes/libtool/all/conanfile.py
@@ -43,15 +43,15 @@ class LibtoolConan(ConanFile):
del self.settings.compiler.libcxx
del self.settings.compiler.cppstd
- def requirements(self):
- self.requires("automake/1.16.4")
-
@property
def _settings_build(self):
return getattr(self, "settings_build", self.settings) It seems to work past that error (and still fail in a similar one with I will try to keep investigating why this happen (seems complex to solve, as it is internal to the graph resolution algorithm), I suggest trying to simplify that part of the recipes if possible. |
thanks for taking a look! AFAIK, |
libtool can be used in 2 forms:
automake is needed as a build requirement when building automake ==> added to When libtool is used as a build_requirement, it also needs automake (and autoconf) added as a build requirement. ==> added to |
This issue looks similar to #10345 |
to conclude, it's fine if |
We are having the same issue. This means we can't use lock files. It's |
Similar issue here with cmake. It is not linked, just a
|
I'm observing the same issue. In my case it's Is there any known workaround? Removing the |
When a tool-requires is missing in a lockfile, the general approach is to make sure that |
Actually the tool is listed in the lockfile even if I do not add Let's suppose that tool requirement is |
The only workaround I found is installing some random tools like cmake, autoconf etc, and at some point ther problem was gone. But this I can not do in CI |
hi all, the only pattern I see is, that a dependency of mine needs the same package as a build requirement, with a package graph setup similar to this: A:
requires: B
tool_requires: C
B:
tool_requires: C
C: ... you get a lock file like this: 1:
ref: A
context: host
requires: 2
tool_requires: 3
2:
ref: B
context: host
tool_requires: 4
3:
ref: C
context: build
4: # duplicate of 3
ref: C
context: build building this constellation without a locked dependency graph works fine by the way. |
Hey @memsharded, from what I've read here, Conan V2 will have entirely new lockfiles. Do you expect this problem will go away once we make the switch? |
Another workaround which seem to be working: first create lock file without |
Yes, absolutely, the new 2.0 lockfiles will not have these issues. I'd strongly recommend giving 2.0 lockfiles a try, with some toy recipes (it is easy to do graphs with |
I'm not sure, but I think I found at least one cause for this issue: The problems seems to be that the equality/inequality/hash operators of As a consequence, edges for build requirements are not added if there is already an edge that represents a regular (non-build) requirement for the same I think this could be easily fixed by including conan/conans/client/graph/graph.py Lines 226 to 247 in a82ae09
Does this make sense? Then I could create a patch for this. |
Hi @harendt Thanks for your investigation and the offer. I am afraid that this could be a high risk change. The problem is that private do not automatically mean they should not conflict (they conflict when they are equal), they mean they do not aim to be propagated down. But having a transitive dependency to zlib and adding a private dependency to zlib shouldn't necessarily result in 2 different nodes in the graph and 2 different dependencies in all cases. So changing the equality might easily break existing usage, we are not at a stage when we could introduce this instability in Conan 1.X. If you still want to do the patch we could further discuss and have a look, but at first look, it is unlikely that we would be able to move it forward. |
If including the I just mentioned |
Actually both can be problematic, because in Conan 1.X without using the 2 profiles approach there is little difference between build-requires and regular requires, they both live in the same context and are treated as equal. But feel free to try it and we will think about it. |
This referred to old Conan 1.X lockfiles. Lockfiles have been fully revamped in Conan 2.0, I am closing this ticket as outdated, please create new tickets referring to the new lockfiles for any further question or issue. Thanks! |
Environment Details (include every applicable attribute)
conanio/gcc11
Steps to reproduce (Include if Applicable)
run
conanio/gcc11
image. execute the following command to create a lockfile:(two profiles are optional, it reproduces in single profile mode as well)
run the command to install:
it will say:
but it's clearly there:
(also the full lockfile is attached below)
Logs (Executed commands with output) (Include/Attach if Applicable)
conan.lock.txt
The text was updated successfully, but these errors were encountered: