-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
cli: new recipe #22673
cli: new recipe #22673
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
NOTES:
|
Hi @rob-baily, thanks a lot for your contribution! We appreciate it, as I'm sure upstream does :) Regarding your comment:
No worries at all, it's more important to clearly communicate what was and wasn't tested than being able to test every possible configuration - that's what the CI is ultimately for. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your contribution! Some comments, but the recipe looks great overall :)
"clang": "6", | ||
"Visual Studio": "16", | ||
"msvc": "192", | ||
"apple-clang": "14", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's stick with this. It only affects Conan v1 which are on our way to deprecate from CCI, so I don't want to spend much energy on it :)
recipes/cli/all/conanfile.py
Outdated
deps = CMakeDeps(self) | ||
deps.generate() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the recipe does not declare any requirements, this can be safely skipped.
Nevertheless, I see in the upstream CMakeLists that it has some options for using asio
that were skipped here. Any insight into why you decided to omit them? I don't oppose it if it makes contributing the recipe easier, it can be left as an exercise for the next PR if someone needs it, but happy to hear your thoughts :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a header only library it is left to the user of the library if they want to include the CLI_UseBoostAsio flag when compiling their project. If we added it as an option here then we would need to ensure this flag was used in any consuming code for the option to make sense. I am not familiar with how that would work but if you have an example we can give it a try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RubenRBS Let me know if you think this should be changed or if you have any comments based on my comment. I believe everything else is addressed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @rob-baily Looking into https://github.com/daniele77/cli/blob/master/CMakeLists.txt#L70 it seems like you have both Boost and asio as requirement. I'll send you a PR with a suggestion to include them as requirements.
recipes/cli/all/conanfile.py
Outdated
self.cpp_info.set_property("cmake_file_name", "CLI") | ||
self.cpp_info.set_property("cmake_target_name", "CLI::CLI") | ||
self.cpp_info.set_property("pkg_config_name", "CLI") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the rename here? I see that upstream examples use lowercase for their find_package
, but maybe I'm missing something!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was following what CLI11 did originally and did not pay enough attention to the examples in the main repo. I have changed it to lower case.
Co-authored-by: Rubén Rincón Blanco <[email protected]>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hi @rob-baily Please take a look in https://github.com/Xcelerator-Group/conan-center-index/pull/1. That PR adds support to asio. @RubenRBS This project is a bit odd. Usually, header-only projects use |
Signed-off-by: Uilian Ries <[email protected]>
This comment has been minimized.
This comment has been minimized.
@uilianries I merged your suggestions into the PR as they seem fine. With that I was trying to see if it was possible to have a way to test the different with_asio options in the test_package. Is that supported and if so is there an example to follow? I've been looking today and haven't seen anything that helps with this. I was also trying to make the preprocessor_definitions dynamic for the test package based on the cli options but I could not get it to work. If I run this |
@uilianries Awesome, thanks! I pushed a new commit with a copy of https://github.com/daniele77/cli/blob/master/examples/complete.cpp that is used in the main repo as an example of how to compile withe options. Now I can run On a semi-related note I see that Conan 1 has information about |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
https://docs.conan.io/2/reference/conanfile/methods/requirements.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it could be reduced, but I'm fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it could be reduced, but I'm fine.
As the author of the library, I'd like to clarify a few points regarding its usage and dependencies. The cli library offers flexibility in its usage, accommodating various scenarios such as integration with boost-asio, standalone-asio, or functioning without any external library, depending on the required features. This is explained in detail in the "Dependencies" section of the README.md:
To integrate the library into your application, simply instantiate the appropriate scheduler and include the corresponding header file. We provide options for boost-asio, standalone asio, and versions with no dependencies. Therefore, there's no need to define any macros in your code or CMake configuration. The options In summary, determining the dependencies of the cli library can be somewhat nuanced, as it largely depends on the requirements of the client code. It can function with no dependencies or may require either boost-asio or standalone-asio, depending on the specific needs of the application incorporating it. I hope this clarifies any confusion regarding the library's usage and dependencies. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rechecking after @daniele77 comments, thanks a lot for your insights :)
@RubenRBS I see you requested changes but don't know what you are asking for. @uilianries requested the change to add Boost and standalone Asio as requirements based on configurations. That seemed reasonable to me as it should make it easier for users of the library to get the right dependencies if they plan to use the functions that require them. I don't think this goes against what @daniele77 said. Can you please clarify what changes you are requesting? |
Hi @rob-baily sorry for the confussion, I just requested changes so the bot would not auto merge until we have a chance to review it again :) |
@daniele77 Thank you so much for giving us a detailed explanation. So we should be good by distributing the package without these dependencies, and when someone wants boost, for instance, will need to add as extra requirement. It's not first case using optional backend CCI, they are just not common here. @rob-baily I'll send you a PR to simplify everything. Sorry the delay. |
@rob-baily I created a second PR https://github.com/Xcelerator-Group/conan-center-index/pull/2 which reduces this PR by a lot, almost the same thing that you committed at first try. /cc @RubenRBS |
Signed-off-by: Uilian Ries <[email protected]>
Conan v1 pipeline ✔️All green in build 14 (
Conan v2 pipeline ✔️
All green in build 14 (
|
I merged it in and the pipeline checks look clean. |
Specify library name and version: cli/2.1.0
Addresses #22564
I am not the author of the library but am a fan of it and want to help it be available to more folks. There is some discussion at daniele77/cli#113 if you are interested to follow.