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 add dynamically option to recipe #7874

Closed
madebr opened this issue Oct 13, 2020 · 3 comments
Closed

[question] How to add dynamically option to recipe #7874

madebr opened this issue Oct 13, 2020 · 3 comments

Comments

@madebr
Copy link
Contributor

madebr commented Oct 13, 2020

Hello,

In conan-io/conan-center-index#2097, I'm attempting to add components support to boost, using extracted data from the boost sources (using yamls).

This means that the options of the boost recipe depend on the contents of a yml.
The yml depends on the version.

This recipe works fine when using as conan create . boost/1.74.0@,
but fails when used with conan-package-tools: conan-io/conan-center-index#3159 (comment)
c3i/conan-package-tools fails because it cannot find the yml:
No such file or directory: '/home/conan/w/cci_PR-2097/recipes/boost/all/dependencies/dependencies-None.yml'

So my question is how to dynamically add options to recipes (in this case extracted from the yml) instead of adding all possible options and removing the ones that are not supported.

@danimtb
Copy link
Member

danimtb commented Oct 22, 2020

So, looking at the code, the only thing missing is the version of the dependency to be able to format the yaml file name?
https://github.com/conan-io/conan-center-index/pull/2097/files#diff-cc14160728d1ad321c1444ffad82615139181e681f4acb7dfd045a005cc8bd66R123

@madebr
Copy link
Contributor Author

madebr commented Oct 22, 2020

It's the version of the package itself that is being initialized too late. The options depend on the version.

I find my approach to adding dynamic options rather hacks (conan package tools don't support it). I was wondering whether there's a better way.

@danimtb
Copy link
Member

danimtb commented Sep 5, 2023

Closing this issue as it seems to be working fine and we didn't found a better way of doing so. If conan-package-tools support is still required, please open a new issue there. Thanks!

@danimtb danimtb closed this as completed Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants