Skip to content

Commit

Permalink
fix cppstd compat (#16346)
Browse files Browse the repository at this point in the history
  • Loading branch information
memsharded authored May 28, 2024
1 parent 54c1c08 commit 5e42ca5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
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

0 comments on commit 5e42ca5

Please sign in to comment.