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

fix cppstd compat #16346

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions conans/client/graph/compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def cppstd_compat(conanfile):
cppstd_possible_values = supported_cppstd(conanfile)
if cppstd_possible_values is None:
conanfile.output.warning(f'No cppstd compatibility defined for compiler "{compiler}"')
else:
factors.append([{"compiler.cppstd": v} for v in cppstd_possible_values if v != cppstd])
else: # The current cppst must be included in case there is other factor
factors.append([{"compiler.cppstd": v} for v in cppstd_possible_values])

if compiler == "msvc":
msvc_fallback = {"194": "193"}.get(compiler_version)
Expand Down
7 changes: 7 additions & 0 deletions conans/test/integration/package_id/test_cache_compatibles.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,13 @@ def test_msvc_194_fallback(self):
assert "mylib/1.0: Main binary package 'e340edd75790e7156c595edebd3d98b10a2e091e' missing."\
f"Using compatible package '{package_id1}'"

c.run("install --requires=mylib/1.0@ -s os=Windows -s arch=x86_64 -s build_type=Release "
"-s compiler=msvc "
"-s compiler.version=194 -s compiler.cppstd=17 "
"-s compiler.runtime=dynamic -pr:b=profile_build")
assert "mylib/1.0: Main binary package 'e340edd75790e7156c595edebd3d98b10a2e091e' missing." \
f"Using compatible package '{package_id1}'"


class TestErrorsCompatibility:
""" when the plugin fails, we want a clear message and a helpful trace
Expand Down