xmake icon indicating copy to clipboard operation
xmake copied to clipboard

compiler.version not set for conan package with MSVC

Open richard-sim opened this issue 4 months ago • 3 comments

Xmake Version

2.9.5

Operating System Version and Architecture

Windows 11

Describe Bug

The conan profile is not setting compiler.version in xmake 2.9.5 for MSVC 2022. I'm running Conan 2.7.1, and vcvars.bat has been called so MSVC is in the PATH.

Trying the example from the docs:

add_requires("conan::zlib/1.2.11", {alias = "zlib"})

Results in:

zlib/1.2.11: Invalid: 'settings.compiler.version' value not defined

Explicitly specifying compiler.version works:

add_requires("conan::zlib/1.2.11", {
    alias = "zlib",
    configs = {
        settings = {
            "compiler.version=194"
        }
    }
})

Expected Behavior

XMake should be setting compiler.version.

Project Configuration

add_requires("conan::zlib/1.2.11", {alias = "zlib"})

target("deps", function ()
    set_kind("phony")
    add_packages("zlib")
end)

Additional Information and Error Logs

Failure output (directly from the docs):

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=static
compiler.runtime_type=Release
os=Windows

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=static
compiler.runtime_type=Release
os=Windows


======== Computing dependency graph ========
zlib/1.2.11: Not found in local cache, looking in remotes...
zlib/1.2.11: Checking remote: conancenter
zlib/1.2.11: Downloaded recipe revision fca992a7d96a1b92bd956caa8a97d18f
Graph root
    conanfile.txt: D:\dev\build-sys-eval\foobar\src\build\.conan\zlib\1.2.11\conanfile.txt
Requirements
    zlib/1.2.11#fca992a7d96a1b92bd956caa8a97d18f - Downloaded (conancenter)

======== Computing necessary packages ========
Requirements
    zlib/1.2.11#fca992a7d96a1b92bd956caa8a97d18f:9477f26cffb0bf802e63e917b7e915e0dae68b91 - Invalid
ERROR: There are invalid packages:
zlib/1.2.11: Invalid: 'settings.compiler.version' value not defined
error: execv(conan install . -g XmakeGenerator --profile:build=profile_build.txt --profile:host=profile_host.txt --build=missing) failed(6)
  => install conan::zlib/1.2.11 latest .. failed
error: install failed!

Successful output (manually specifying compiler.version):

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=static
compiler.runtime_type=Release
compiler.version=194
os=Windows

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=static
compiler.runtime_type=Release
os=Windows


======== Computing dependency graph ========
Graph root
    conanfile.txt: D:\dev\build-sys-eval\foobar\src\build\.conan\zlib\1.2.11\conanfile.txt
Requirements
    zlib/1.2.11#fca992a7d96a1b92bd956caa8a97d18f - Cache

======== Computing necessary packages ========
zlib/1.2.11: Main binary package '805d40acaa2400bcd79bfb1b96f313f2713000a5' missing
zlib/1.2.11: Checking 1 compatible configurations
zlib/1.2.11: Compatible configurations not found in cache, checking servers
zlib/1.2.11: '04a6c37bc15f9f5fab59d7085ff6c17c75bc552d': compiler.version=193
Requirements
    zlib/1.2.11#fca992a7d96a1b92bd956caa8a97d18f:805d40acaa2400bcd79bfb1b96f313f2713000a5 - Build

richard-sim avatar Sep 25 '24 05:09 richard-sim