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] How to force on build requires of a dependency? #17474

Open
1 task
huysentr opened this issue Dec 16, 2024 · 3 comments
Open
1 task

[question] How to force on build requires of a dependency? #17474

huysentr opened this issue Dec 16, 2024 · 3 comments
Assignees
Labels
responded Responded by Conan team type: question

Comments

@huysentr
Copy link

What is your question?

We have a habit of adding cmake to the profiles building the packages.
(there is some circular dependency issues that is fixed with the "!"

[settings]
os=Linux
arch=x86_64
compiler=gcc
compiler.version=12.1
[tool_requires]
!gcc/*: cmake/3.29.0@redacted
!cmake/*: gcc/12.1.0@redacted

Now a dependency python, has a dependency on zlib, this for some reason affects the build requirements. zlib has build_requires = " cmake/[>=3.22.0]"

this causes the following issue:


Graph root
    conanfile.py...
Requirements
...
    python/3.12.2@redacted
Build requirements
    cmake/3.29.0@redacted
    cmake/3.30.1#6d832cf2d46f6ec969ca5ed5b41f91eb - Cache
    zlib/1.2.13@redacted
Resolved version ranges
    cmake/[>=3.22.0]: cmake/3.30.1

And here the conan process starts hanging indefinitely. A fix would be to overwrite the build_requires = " cmake/[>=3.22.0]" of the zlib package to cmake/3.29.0@redacted. I think atleast, because I'm not sure why it hangs.

Or can I overwrite the tools_requires of the python package instead to use another zlib? At this point I can't rebuild and ship the python package. Any ideas? Also is there more documentation on how to do things using the profile, I read the documentation but its incomplete.

I've also tried [replace_tool_requires] on zlib, but since its a transitive dependency it is not affected. Also using force=true doesn't work in the tools_requires() in the conanfile.py.

I'm out of options here. What can I do?

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@AbrilRBS AbrilRBS self-assigned this Dec 16, 2024
@AbrilRBS
Copy link
Member

Hi @huysentr thanks a lot for taking the time to report your problem

Some more discussion be had about the tool_requires approach, but for now:

I've also tried [replace_tool_requires] on zlib, but since its a transitive dependency it is not affected.

This is unexpected, as it's the basic use-case we implemented this feature for. The main confussion point on this feature is to what profile it might be being applied. As zlib in this case belongs to the build context, this replace_tool_requires should live in the build profile. Could you confirm if this is the case? Thanks!

I think atleast, because I'm not sure why it hangs.

We might want to look into this, as Conan should be able to detect most circular dependency cases and not hang like this, thanks for the heads-up

@memsharded
Copy link
Member

Quick question: does the !gcc/*: cmake/3.29.0@redacted exist in the "host" profile or in the "build" profile. Because this in the "host" profile is no longer necessary. As the tool_requires live in the "build" profile, they do not create circular dependencies.

The circular dependencies will only happen if this is the "build" profile, not the "host" profile. I think some clarification, specifying both the build and host profiles would be good.

@memsharded
Copy link
Member

Hi @huysentr

Any further feedback or comment?

@memsharded memsharded added type: question responded Responded by Conan team labels Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
responded Responded by Conan team type: question
Projects
None yet
Development

No branches or pull requests

3 participants