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] Correct way to conditionally depend on libjpeg-turbo or libjpeg #14951

Closed
HappySeaFox opened this issue Dec 27, 2022 · 2 comments
Closed
Labels
question Further information is requested

Comments

@HappySeaFox
Copy link
Contributor

HappySeaFox commented Dec 27, 2022

What is your question?

Hi. I'm trying to add an option in my recipe to enable JPEG. The option has three possible values: libjpeg-turbo, libjpeg, and False. I tried to implement the similar approach as other recipes (freeimage) do and enabled the libjpeg-turbo value be default in default_options:

    options = {
        ...
        "with_jpeg": ["libjpeg", "libjpeg-turbo", False],
    }
    default_options = {
        ...
        "with_jpeg": "libjpeg-turbo",
    }
    def requirements(self):
        ...
        if self.options.with_jpeg == "libjpeg-turbo":
            self.requires("libjpeg-turbo/2.1.4")
        elif self.options.with_jpeg == "libjpeg":
            self.requires("libjpeg/9e")

But the PR #14926 fails with:

ERROR: At least two recipes provides the same functionality:
 - 'libjpeg' provided by 'libjpeg-turbo/2.1.4', 'libjpeg/9e'

Am I missing anything? Any ideas?

@HappySeaFox HappySeaFox added the question Further information is requested label Dec 27, 2022
@HappySeaFox
Copy link
Contributor Author

It seems that the problem is that if one of my dependencies depends on libjpeg, but I explicitly ask to enable libjpeg-turbo for my recipe, there is a conflict between those two. Like that:

sail -> tiff -> libjpeg
   |
   v
libjpeg-turbo 

Is there a way to workaround that?

@SpaceIm
Copy link
Contributor

SpaceIm commented Dec 27, 2022

Is there a way to workaround that?

yes, change default to libjpeg. It's the current default libjpeg implementation of all CCI recipes. I don't say it's a good default.

Once #14814 will be merged, we'll be able to rely on this virtual recipe and globally delegate libjpeg implementation in this recipe instead of scattering this decision to many recipes with high risk of conflicts. I also propose to change default implementation to libjpeg-turbo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants