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

Add example test for forwards compat of custom setting #17524

Open
wants to merge 4 commits into
base: develop2
Choose a base branch
from

Conversation

AbrilRBS
Copy link
Member

@AbrilRBS AbrilRBS commented Dec 25, 2024

Changelog: Omit
Docs: Omit

As part of the answer for #17523, I thought that a test that reflects the desired behaviour would be great to have, as a reference point for the future

Update: Now seeing the linked issue, OP was not exactly following this approach, but I think it's still worth it to add something like this

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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the other way round. Packages created with an older libc can be used with the current libc_version. So better <=

test/integration/package_id/compatible_test.py Outdated Show resolved Hide resolved
tc.save({
"dep/conanfile.py": GenConanfile("dep", "1.0")
.with_settings("compiler", "libc_version"),
"conanfile.py": GenConanfile("app", "1.0")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be dropped, and tested with conan install --requires=xxxx

@@ -706,3 +709,83 @@ def validate_build(self):
pkga = liba["packages"][0][pkg_index]
assert pkga["info"]["compatibility_delta"] == {"settings": [["compiler.cppstd", "14"]]}
assert pkga["build_args"] == "--requires=liba/0.1 --build=compatible:liba/0.1"


@pytest.mark.skipif(platform.system() != "Windows", reason="MSVC combination requires Windows profile, but the basic idea works everywhere")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this to show that the combination logic is sound, but for the docs we'll drop the msvc variability

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.

[question] Is it possible to model the glibc forward compatibility?
2 participants