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

[question] Howto avoid "Requirement 'x' not in lockfile 'requires'" with input from conan graph build-order #17363

Open
1 task done
marlamb opened this issue Nov 21, 2024 · 1 comment
Assignees

Comments

@marlamb
Copy link
Contributor

marlamb commented Nov 21, 2024

Hi,
I am using conan graph build-order to determine the build order for the complete dependency tree of our central project given a central lockfile. Then I use the result to build the dependencies one by one, again using the central lockfile, to ensure consistency. Now it turns out that in some situations the central lockfile does not have a requirement in the correct section (requires vs build-requires). E.g. I have a requirement to libcurl, which in turn has a build requirement to libtool, which in turn has a requirement to automake. In my lockfile libtool and automake are part of the build-requires, which makes sense. But when I do the conan create <path_to_libtool_recipe> --lockfile=<central_lockfile> <settings_and_options_parsed_from_conan_build_order_json> it fails with

ERROR: Requirement automake/... not in lockfile 'requires'

I also saw the problem the exact other way around (often also in test packages).
I read about --lockfile-partial, which (if I understand it correctly) is also not what I want, as it would loosen almost everything, but in general I of course want that the exact libs/recipe revisions from the lockfile are used.

My question is: is there a way to avoid the error while still ensuring that only defined versions/recipe revs are used? Note that using conan install would not be ideal for me, as I would like to execute also the test packages (recipes might change along and I want to ensure that they still work as intended).

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@memsharded memsharded self-assigned this Nov 22, 2024
@memsharded
Copy link
Member

Hi @marlamb

Thanks for your question.

I'd say it is very likely that the lockfile or conan graph build-order capture might be missing something.
These commands must be executed with the same arguments as the expected posterior create/install commands. Same profiles, settings, etc. But most importantly the same --build=missing or similar policy.

If you don't use --build=missing when capturing the lockfile or the build-order, then they might be missing some of the tool-requires or their transitive dependencies.

Could you please try to check this?

If this is not then:

E.g. I have a requirement to libcurl, which in turn has a build requirement to libtool, which in turn has a requirement to automake. In my lockfile libtool and automake are part of the build-requires, which makes sense. But when I do the conan create <path_to_libtool_recipe> --lockfile=<central_lockfile> <settings_and_options_parsed_from_conan_build_order_json> it fails with

We would like to have a bit more of details to reproduce this. If you can share the exact commands you are using to capture this lockfile, that would help to reproduce and understand. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants