I am trying to install expat/2.5.0
using the command python -m conans.conan install expat/2.5.0@ -pr <profile>
where my profile is identical in both cases but only using, compiler.version=193
and compiler.version=194
. This is primarily for msvc
in a Windows environment.
When performing the install I receive
expat/2.5.0: Main binary package 'bb496eac3d86e85e9282f15fbff7e4d38fef491e' missing. Using compatible package '8e589e066a19f700666be77ed94ff8e8bc88ee10'
and
expat/2.5.0: Main binary package '35008919e57d73db0c4e0b6ee1736abd51fe0f4f' missing. Using compatible package '8e589e066a19f700666be77ed94ff8e8bc88ee10'
However, after reading the documentation for ABI compatibility and then reading the conanfile.py for expat, I could not fine any code that suggests that 194 and 193 are binary compatible. Could anyone explain to me how these are evaluated to get the same packageID for differing compiler versions? I was expecting lines as explained in the documentation such as,
from conans import ConanFile
class Pkg(ConanFile):
settings = "os", "compiler", "arch", "build_type"
def package_id(self):
if self.settings.compiler == "gcc" and self.settings.compiler.version == "4.9":
for version in ("4.8", "4.7"):
compatible_pkg = self.info.clone()
compatible_pkg.settings.compiler.version = version
self.compatible_packages.append(compatible_pkg)
however, I see nothing like this in the expat
conanfile.py
The fallback from msvc
compiler.version=194 to compiler.version=193 is only implemented in Conan 2, not Conan 1.
The relevant functionality is in the compatibility.py
plugin, check this page
if compiler == "msvc":
msvc_fallback = {"194": "193"}.get(compiler_version)
if msvc_fallback:
factors.append([{"compiler.version": msvc_fallback}])
This plugin is designed to be user customizable, so you can removed those lines from the plugin. Recall to remove also the first line comments:
# This file was generated by Conan. Remove this comment if you edit this file or Conan
# will destroy your changes.
Or otherwise the next Conan update might replace your changes with a clean default file.
Recall that the compatibility.py
plugin can be shared and distributed (together with other files) with the conan config install/install-pkg
commands.