-
Notifications
You must be signed in to change notification settings - Fork 991
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] Is it possible to model the glibc forward compatibility? #17523
Comments
Hi @leha-bot thanks a lot for your question.
from glibc_compat import glibc_compat
def compatibility(conanfile):
configs = cppstd_compat(conanfile)
# TODO: Append more configurations for your custom compatibility rules
libc_versions = glibc_compat(conanfile)
# This is where you would need to do extra work for the crossproduct of cppstd and libc compats
# For now it just adds them
configs.extend(libc_versions)
return configs And your from conan.tools.scm import Version
def glibc_compat(conanfile):
# Do we have the setting?
libc_version = conanfile.settings.get_safe("libc_version")
if libc_version is None:
return []
available_libc_versions = conanfile.settings.libc_version.possible_values()
ret = []
for possible_libc_version in available_libc_versions:
if Version(possible_libc_version) >= Version(libc_version):
ret.append({"settings": [("libc_version", possible_libc_version)]})
return ret Some notes:
Additionally, I've submitted a test in #17524 to reflect this suggestion and ensure we can use it as a reference point in the future Let me know if this helps :) |
Big thanks, it worked when I swapped the version comparison sign here: if Version(possible_libc_version) >= Version(libc_version): I also used the dotted values for glibc version in settings_user.yml ("os.libc.version") Debug log for conan install --requires=fmt/11.0.0
|
What is your question?
I had added the glibc.version (as was suggested in #3972 (comment) )
and I'm stuck with the issue: how could I mark the packages as compatible with any
libc.version
greater or equal current.Example:
conanfile.py
? I thought also aboutcompatibility.py
, but don't understand, is it suitable for thisAccording to https://docs.conan.io/2/reference/conanfile/methods/compatibility.html , I should check the current libc.version with some prebuilt version, if I understood correctly, but how can I get it from first step?
Sorry for potentially vague question, feel free to ask, if I wrote something weird.
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: