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

self.tool_requires with visible attribute set to True #17560

Closed
1 task done
maitrey opened this issue Jan 10, 2025 · 2 comments
Closed
1 task done

self.tool_requires with visible attribute set to True #17560

maitrey opened this issue Jan 10, 2025 · 2 comments
Assignees

Comments

@maitrey
Copy link
Contributor

maitrey commented Jan 10, 2025

What is your question?

Dear Conan Folks,

We were using conan-2.0.11, Python-3.12 in Windows context.
We are upgrading to Conan-2.11.0, Python-3.12.4 in Windows context.
I had this issue with conan-2.0.11 , when setting tool_requires of a package with visible attribute set to True, I had to additionally set in the generate method:

 deps.build_context_activated = ["tools_pkg"]
deps.build_context_build_modules = ["tools_pkg"]

But with conan-2.11.0 this seems not to be necessary.
I looked into the code and seem to find the lines that resolve it:
https://github.com/conan-io/conan/blob/2.11.0/conans/model/requires.py#L289.

But did not find information about it in the Changelog.
Is my assumption correct?

Thank You for helping!
Br
Maitrey

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@memsharded memsharded self-assigned this Jan 10, 2025
@memsharded
Copy link
Member

Hi @maitrey

I had this issue with conan-2.0.11 , when setting tool_requires of a package with visible attribute set to True, I had to additionally set in the generate method:

Please note that in general the visible=True trait for tool_requires is discouraged, experimental at best. It did learned some capabilities in previous releases, but still should be considered as not the most recommended approach.

But there were indeed some changes and improvements to better support the visible=True case for tool_requires since Conan 2.0.11, see:

  • Bugfix: Avoid the propagation of transitive dependencies of tool_requires to generators information even if they are marked as visible=True. #16077
  • Feature: Propagate run trait requirement information in the “build” context downstream when visible trait is True. #16849 . Docs here
  • Bugfix: Fix visible trait propagation with build=True trait. #15357

So it is definitely possible that something that required more explicit management now has improved.

@maitrey
Copy link
Contributor Author

maitrey commented Jan 10, 2025

The use case for us is some code generators and this should be same across packages and therefore we need the visibility attribute set to True.

Thanks for your explanation.
Issue can be closed!

@maitrey maitrey closed this as completed Jan 10, 2025
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