-
Notifications
You must be signed in to change notification settings - Fork 992
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
base: develop2
Are you sure you want to change the base?
Conversation
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): |
There was a problem hiding this comment.
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 <=
tc.save({ | ||
"dep/conanfile.py": GenConanfile("dep", "1.0") | ||
.with_settings("compiler", "libc_version"), | ||
"conanfile.py": GenConanfile("app", "1.0") |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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
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