-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Description
Describe the bug
vcpkg claims that libxml2 2.11.9 is not compatible with 2.7.4, which is incorrect. find_package(LibXml2 2.7.4) results in the following output:
Could not find a configuration file for package "LibXml2" that is
compatible with requested version "2.7.4".
The following configuration files were considered but not accepted:
C:/vcpkg/installed/x64-windows-static-md/share/libxml2/libxml2-config.cmake, version: 2.11.9
I noticed this issue in the igraph CI tests. This is how igraph looks for libxml2:
With debug output:
Link to CI test issue:
Environment
-
OS: Windows
-
Compiler: VS 2022 v17.12.0, current
windows-lateston Azure -
OS: macOS 14.7
-
Compiler: Apple Clang 16.0
CMake 3.31 on both.
To Reproduce
I cannot reproduce this issue with a libxml2 that is installed separately from vcpkg.
On macOS, here's a small project file to reproduce:
# CMakeLists.txt
cmake_minimum_required(VERSION 3.31)
project(Foo)
find_package(LibXml2 2.7.4)Then use
mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=.../vcpkg/scripts/buildsystems/vcpkg.cmake
I am not able to test on Windows directly.
Expected behavior
I expect version 2.11.x to be accepted when looking for version 2.7.4. But in fact it fails when looking for any version that is not of the form 2.11.x (this includes 2.10.0 or 2.12.0).
This is what I expect, and what I see with a libxml2 that is not installed with vcpkg:
Found LibXml2: /opt/local/lib/libxml2.dylib (found suitable version "2.13.5", minimum required is "2.7.4")
Failure logs
—
Additional context
—
CC @ntamas