Skip to content

[question] Why am I getting a different python_requires package version when resolving a test_package dependency graph? #19340

@Alex-Riley

Description

@Alex-Riley

What is your question?

In our CI setup we recently saw a test_package build failing due to missing dependencies. This was unexpected as our CI setup is running an in-house tool that effectively does the following: conan install -> manually run cmake && cmake build -> conan export-pkg. The tool ensures that the conan export-pkg command runs with the same profile, config and setting arguments that were used for the conan install command but errors if any packages are missing from the local cache (rather than downloading or building these), under the assumption that all dependencies needed for the test_package build will have been provided by running conan install already.

When investigating the issue I found that the failing build (for package foo) wanted a dependency (bar) to be built with version 1.7.x of an internal python_requires package that we use (conan-utils) but the conan install command for foo had built bar with conan-utils 1.8.x (we had recently released v1.8.0 of conan-utils).

The test_package graph looking for a build of bar with conan-utils 1.7.x was initially surprising to me as the bar recipe specifies that is uses >=1.0.0 <2.0.0 in its requirement for conan-utils. Additionally, we did not notice this behaviour in other packages, despite conan-utils being used throughout our setup.

On closer examination of foo's recipe, I noticed that its version requirement for conan-utils was explicitly 1.7.1 and that changing it to >=1.0.0 <2.0.0 caused the test_package to now accept the bar build with conan-utils v1.8.0. This all fits with the information in the docs about how ranges are resolved if there's already a requirement specified for a given package.

So my question is why didn't we see conan-utils 1.7.1 get picked when we ran the conan install command for the foo package but it did then get picked when we ran the test_package build?

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions