microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.88k stars 6.31k forks source link

[poco] build failure with mariadb #27975

Closed yuntong613 closed 1 year ago

yuntong613 commented 1 year ago

Host Environment

Installing 1/3 poco:x86-windows... Building poco[core,mariadb,netssl]:x86-windows... -- Using cached pocoproject-poco-1211613642269b7d53bea58b02de7fcd25ece3b9.tar.gz. -- Cleaning sources at C:/vcpkg/buildtrees/poco/src/cd25ece3b9-a8fdd8b2f5.clean. Use --editable to skip cleaning for the packages you specify. -- Extracting source C:/vcpkg/downloads/pocoproject-poco-1211613642269b7d53bea58b02de7fcd25ece3b9.tar.gz -- Applying patch 0001-static-pcre.patch -- Applying patch 0002-arm64-pcre.patch -- Applying patch 0003-fix-dependency.patch -- Applying patch 0004-fix-feature-sqlite3.patch -- Applying patch 0005-fix-error-c3861.patch -- Applying patch 0006-fix-install-data-mysql.patch -- Applying patch 0007-find-pcre2.patch -- Using source at C:/vcpkg/buildtrees/poco/src/cd25ece3b9-a8fdd8b2f5.clean -- Found external ninja('1.10.2'). -- Configuring x86-windows CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:96 (message): Command failed: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" -v Working Directory: C:/vcpkg/buildtrees/poco/x86-windows-rel/vcpkg-parallel-configure Error code: 1 See logs for more information: C:\vcpkg\buildtrees\poco\config-x86-windows-CMakeCache.txt.log C:\vcpkg\buildtrees\poco\config-x86-windows-CMakeCache.txt.log C:\vcpkg\buildtrees\poco\config-x86-windows-out.log

Call Stack (most recent call first): installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_configure.cmake:247 (vcpkg_execute_required_process) ports/poco/portfile.cmake:68 (vcpkg_cmake_configure) scripts/ports.cmake:147 (include) config-x86-windows-out.log

yuntong613 commented 1 year ago

The new dependency patch seem to remove all config in orignal file below

-if(ENABLE_DATA_MYSQL)
-   find_package(MySQL REQUIRED)
-else()
-   find_package(MySQL)
-endif()

but now

 if(ENABLE_DATA_MYSQL)
    find_package(MySQL REQUIRED)
-else()
-   find_package(MySQL)
 endif()
FrankXie05 commented 1 year ago

@yuntong613 Libmysql does not support windwos. https://github.com/microsoft/vcpkg/blob/35cff4f5b0391da99dfe47823f115c2187abcf0a/ports/libmysql/vcpkg.json#L8

dg0yt commented 1 year ago

It clearly does support x64 windows and arm64 windows. In vcpkg CI, it is skipped in order to cover libmariadb. The patch looks really strange with regard to all mysql changes.

Thomas1664 commented 1 year ago

This is in fact a port bug because we enable mysql even if mariadb is used and mysql is not supported on Windows x86:

https://github.com/microsoft/vcpkg/blob/35cff4f5b0391da99dfe47823f115c2187abcf0a/ports/poco/portfile.cmake#L52-L56

and

https://github.com/microsoft/vcpkg/blob/35cff4f5b0391da99dfe47823f115c2187abcf0a/ports/poco/portfile.cmake#L87

Since the patch makes finding mysql required this will result in an error

yuntong613 commented 1 year ago

last poco version 1.11 compiled in x86-windows with mariadb works well

yuntong613 commented 1 year ago

@yuntong613 Libmysql does not support windwos. https://github.com/microsoft/vcpkg/blob/35cff4f5b0391da99dfe47823f115c2187abcf0a/ports/libmysql/vcpkg.json#L8

try using libmariadb not libmysql,libmariadb supported x86 well

Thomas1664 commented 1 year ago

This is in fact a port bug because we enable mysql even if mariadb is used and mysql is not supported on Windows x86:

The root cause is the wrong patch (the first code below is correct):

The new dependency patch seem to remove all config in orignal file below

-if(ENABLE_DATA_MYSQL)
- find_package(MySQL REQUIRED)
-else()
- find_package(MySQL)
-endif()

but now

 if(ENABLE_DATA_MYSQL)
  find_package(MySQL REQUIRED)
-else()
- find_package(MySQL)
 endif()
FrankXie05 commented 1 year ago

I will revert the patch.

dg0yt commented 1 year ago

I will revert the patch.

Do not just blindly revert. Please revise the mysql/mariadb patching in general.