-
Notifications
You must be signed in to change notification settings - Fork 993
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
Overriding requirements and their default options #5530
Comments
Hi, Morwenn! /cc @ericLemanissier |
Indeed, doing something like: self.options['glib'].with_pcre = True In a recipe is the equivalent to hardcoding it. It cannot be undone or overwritten from downstream. Only |
Qt recipe uses |
Default options value that do not apply are just discarded, so it is safe to say |
It seems to work when I comment the line in the Qt recipe :) In the grand scheme of things, does that mean that if two of my dependencies require the same dependency with incompatible options there's basically no way out? |
@Morwenn On my side I could not compile the recipe successfully without |
@ericLemanissier Sure, here is the log (I replaced references to my home directory by
|
I sorted my issues out in private emails with @ericLemanissier, and it turns out that the issues where indeed on the side of my understanding: I didn't know that default options and options explicitly passed in the recipe were considered differently, which explains some of my attempts and of my later misunderstanding. I'm closing this issue, I suppose that you don't need more noise :) |
In a project of mine I am trying to use two libraries that require the same version of
glib
(probably not relevant here but the libraries are harfbuzz/2.4.0 and qt/5.13.0), but configured differently: one useswith_pcre=True
and the other onewith_pcre=False
. This naturally leads to an issue, namely the following error message:Considering that they both needed different versions of glib, it's not surprising. To avoid that, I tried to explicitly override the glib dependency in my
conanfile.py
'srequirements()
function as follows:Since one of the libraries requires a PCRE-augmented glib, I decided to force both to
True
, but the error message didn't disappear. It does disappear when I try to forceself.options['glib'].with_pcre = False
, but I am not sure that it is what I want since one of the libraries is fine with PCRE. I'm not sure.The default value for
with_pcre
isTrue
, so I guess that the override only works properly when we force it to a value different from the default one?I'm not sure what is the most sensible thing to do in such a case, and it feels like a general Conan knowledge issue on my side more than a lib-specific issue, but if I'm wrong I will ask on bincrafters instead.
Any help in understanding why it behaves like it does and what is the most idiomatic way to fix this kind of issue is very welcome :)
To help us debug your issue please explain:
The text was updated successfully, but these errors were encountered: