Skip to content

vcpkg claims that libxml2 2.11.9 is not compatible with 2.7.4 #42315

@szhorvat

Description

@szhorvat

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:

https://github.com/igraph/igraph/blob/e940ab737938dfdd4518164c866b2599af40856f/etc/cmake/dependencies.cmake#L74

With debug output:

https://github.com/igraph/igraph/blob/9036af6b96b266bb72fa9b41f52e8e124b44d58b/etc/cmake/dependencies.cmake#L76-L77

Link to CI test issue:

https://dev.azure.com/igraph-team/igraph/_build/results?buildId=8240&view=logs&j=dc2fa7f2-c2a5-5af8-ba1c-9621505790a7&t=dcba228e-5c56-53e5-8cff-603ef5cc76bd&l=323

Environment

  • OS: Windows

  • Compiler: VS 2022 v17.12.0, current windows-latest on 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

Metadata

Metadata

Assignees

Labels

category:port-featureThe issue is with a library, which is requesting new capabilities that didn’t exist

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions