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

custom generator in conan2 #3192

Closed
xiaoliangwu opened this issue May 5, 2023 · 2 comments
Closed

custom generator in conan2 #3192

xiaoliangwu opened this issue May 5, 2023 · 2 comments
Assignees
Milestone

Comments

@xiaoliangwu
Copy link

Hi,
Do we still have custom generator in conan2?

https://docs.conan.io/1/reference/generators/custom.html#custom-generator

I check the https://docs.conan.io/1/conan_v2.html#conan2-migration-guide , but not sure which feature is the replacement

thanks

@czoido
Copy link
Contributor

czoido commented May 5, 2023

Hi @xiaoliangwu,

Thanks for the question. I'm pasting here the answer to a similar question in the Conan repository. This is something that we definitely need to improve in the Conan docs:

There are 2 things that replace the 1.X previous custom generators packages, depending on the use case:

  • For the general case, explicit python_requires are recommended, that instantiate a helper explicitly in the consumers generate(). That means that the consumers should be conanfile.py with a generate() method. This method is good for many reasons:
    • Independent, private versioned dependencies: so every package can evolve at their pace, and doing a breaking change to the generator doesn't break all consumers at all
    • python_requires affect package_id of the consumers, so correct versioning can be used to trigger re-builds or to not trigger to save CI time
  • Global generators, installable in the cache with conan config install will be added in 2.0.5: custom global generators in cache extensions/generators folder conan#13718

@czoido czoido self-assigned this May 5, 2023
@czoido czoido added this to the 2.0.5 milestone May 5, 2023
@memsharded
Copy link
Member

Closed by #3213

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

3 participants