Skip to content

Redis plus plus: coroutines option #26408

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aligirayhanozbay
Copy link

Summary

Changes to recipe: redis-plus-plus

Motivation

Enables coroutines support for redis-plus-plus which requires -DREDIS_PLUS_PLUS_BUILD_CORO=ON

Details

Adds a coroutines option to the conanfile. When turned on, it passes the REDIS_PLUS_PLUS_BUILD_CORO cache variable with the value ON.


@aligirayhanozbay aligirayhanozbay changed the title add redis plus plus coroutines Redis plus plus: coroutines option Jan 17, 2025
@uilianries
Copy link
Member

@aligirayhanozbay Hello 👋 Thank you for your suggestion of adding a new option for coroutines in redis-plus-plus 😄

Checking the upstream, that project has even more options, like REDIS_PLUS_PLUS_ASYNC_FUTURE, which could use boost as a dependency.

Still, in ConanCenterIndex we try to be conservative when adding a new option, as a new option affects the package ID, resulting in a new update for any user and package consuming it. Sometimes, we need to rebuild packages internally to update the dependency graph in Conan Center.

The CI will not test this new option as well, so we will need to check it locally, building a matrix, and pushing the build log. As your new option has a relation to the async option, it requires an extra combination of builds to check. The result is an exponential number of builds for each new option.

On the other hand, you can use Conan config to extend CMakeToolchain definition, build the package without changing the recipe, much cheaper and simpler than changing the recipe. For your specific case, you can follow:

conan install -r conancenter --requires=redis-plus-plus/1.3.13 -o "&:build_async=True" -c tools.cmake.cmaketoolchain:extra_variables='{"REDIS_PLUS_PLUS_BUILD_CORO": "ON"}' --build=missing

To keep this configuration persistent, you can pass this configuration to your Conan profile as well:

# ~/.conan2/profiles/redis-plus-plus
...
[conf]
redis-plus-plus/*: tools.cmake.cmaketoolchain:extra_variables={"REDIS_PLUS_PLUS_BUILD_CORO": "ON"}

This profile will activate this configuration only for the redis-plus-plus package.

The configuration will work for your build, but will not affect your package ID. In case you want to have a distinct package ID for this configuration, you can use Conan configuration tools.info.package_id:confs, which can be added to your profile as well:

tools.info.package_id:confs=["tools.cmake.cmaketoolchain:extra_variables"]

I hope this solution fits in your current scenario. Regards!

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

Successfully merging this pull request may close these issues.

2 participants