Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcpkg] update CMake to 3.27.1 #31931

Merged
merged 22 commits into from
Jul 31, 2023
Merged

Conversation

Neumann-A
Copy link
Contributor

@Neumann-A Neumann-A commented Jun 10, 2023

Upstream issue:
https://gitlab.kitware.com/cmake/cmake/-/issues/24991 fixed in rc2
https://gitlab.kitware.com/cmake/cmake/-/issues/25002
There is also an issue update OpenSSL but that is not solved in 3.27.0

Note to self:
jmcnamara/libxlsxwriter#402 fixed by another PR
dcmtk regression is baseline (also another PR)

Remove https://github.com/eclipse/paho.mqtt.c/blob/7db21329301b1f527c925dff789442db3ca3c1e7/src/CMakeLists.txt#L190-L191 from paho-mqtt; also unset any variable effecting openssl lookup in vcpkg-cmake-wrapper.cmake CMake will also fix it in a newer release

@JonLiu1993 JonLiu1993 added the category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly label Jun 12, 2023
@JonLiu1993 JonLiu1993 changed the title WIIP: Update CMake to 3.27 [vcpkg] update CMake to 3.27 Jun 12, 2023
@dg0yt
Copy link
Contributor

dg0yt commented Jun 12, 2023

CMake Warning (dev) at D:/downloads/tools/cmake-3.27.0-rc1-windows/cmake-3.27.0-rc1-windows-i386/share/cmake-3.27/Modules/FindZLIB.cmake:88 (message):
  ZLIB does not provide any COMPONENTS.  Calling

    find_package(ZLIB COMPONENTS ...)

  will always fail.

This already appeared in another issue recently, with CMake 3.26. They seem to have broken something around version arguments.

@Neumann-A
Copy link
Contributor Author

@dg0yt If you want to chase it down feel free to do so https://gitlab.kitware.com/cmake/cmake/-/issues/24991#note_1375365 / https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7767 . I am probably just going to patch the few failing ports since that seems less work.

@xavier2k6
Copy link
Contributor

@Neumann-A CMake 3.27 RC2 is out now for testing with, BTW the freebsd link no longer works for 3.20.4

@Neumann-A
Copy link
Contributor Author

Hmm a lot of android failures.

@Neumann-A
Copy link
Contributor Author

Neumann-A commented Jul 20, 2023

This one is new:

CMake Error at D:/installed/x64-windows/share/directxtex/DirectXTex-targets.cmake:60 (set_target_properties):
  The link interface of target "Microsoft::DirectXTex" contains:

    Microsoft::DirectX-Headers

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  D:/installed/x64-windows/share/directxtex/directxtex-config.cmake:27 (include)
  C:/a/1/s/scripts/buildsystems/vcpkg.cmake:855 (_find_package)
  src/CMakeLists.txt:109 (find_package)

I am not able to reproduce that locally directxtex-config.cmake has everything needed just the order is a bit messed up which CMake shouldn't complain about. @walbourn If this issue persist you probably want to move the find_dependency stuff before the targets include(); Also why is that port switching between find_dependency and find_package in the config.cmake? (That doesn't make sense to me)

@Neumann-A Neumann-A marked this pull request as ready for review July 20, 2023 21:32
@walbourn
Copy link
Member

I am not able to reproduce that locally directxtex-config.cmake has everything needed just the order is a bit messed up which CMake shouldn't complain about. @walbourn If this issue persist you probably want to move the find_dependency stuff before the targets include(); Also why is that port switching between find_dependency and find_package in the config.cmake? (That doesn't make sense to me)

if(MINGW OR (NOT WIN32))
    find_dependency(directx-headers)
    find_dependency(directxmath)
else()
    find_package(directx-headers CONFIG QUIET)
    find_package(directxmath CONFIG QUIET)
endif()

This is because with non-MinGW scenarios on Windows, the use of directx-headers and/or direcxtmath package is purely optional. If it can't find them, it just doesn't care and sticks with the Windows SDK headers.

In the case of MinGW, however, the "Windows headers" there are, um, a mess. It has Direct3D 11 headers with some quirks, the DirectXMath headers exist but their contents is basically empty, and there's no DIrectX 12 headers. Therefore, in those cases it needs these packages but I wanted it to pass along the parameters from the including cmake.

In the case of Linux, both packages are also required.

@walbourn
Copy link
Member

@Neumann-A Please review microsoft/DirectXTex#380

@Neumann-A
Copy link
Contributor Author

@walbourn I used

if(VCPKG_TARGET_IS_WINDOWS AND NOT (VCPKG_TARGET_IS_XBOX OR VCPKG_TARGET_IS_MINGW) AND NOT "dx12" IN_LIST FEATURES)
  list(APPEND FEATURE_OPTIONS "-DCMAKE_DISABLE_FIND_PACKAGE_directx-headers=TRUE")
endif()

to fix the problem since this controls the dependency explicitly in vcpkg.

The problem is you can run into a situation where you build directxtex with directx-headers being found but when you consume them directx-headers is not found leading to the error observed.

For the config you probably want something like:

if(@directx-headers_FOUND@)
    find_dependency(directx-headers)
endif()
if(@directxmath_FOUND@)
    find_dependency(directxmath)
endif()

instead since finding the deps is not going to be optional on Windows if the headers were found when building directxtex you will depend on the headers target.

Moving the include() is not necessary.

@walbourn
Copy link
Member

if(@directx-headers_FOUND@)
    find_dependency(directx-headers)
endif()
if(@directxmath_FOUND@)
    find_dependency(directxmath)
endif()

Ends up if(0) no matter what.

@Neumann-A
Copy link
Contributor Author

Ends up if(0) no matter what.

Configure log? Did you see the message from https://github.com/microsoft/DirectXTex/blob/4d9d7a8ceba6d6a121cd1aae160a0b856ef03d89/CMakeLists.txt#L206 ?
If not it should be 0. That is the plan here.

@dg0yt
Copy link
Contributor

dg0yt commented Jul 22, 2023

Moving the include() is not necessary.

IMO it is necessary: If the included files create imported targets, it shouldn't happen if a find_dependency failed.

However I do agree that the find_package must be turned into guarded find_dependency. Either it is a dependency due to build time configuration, or the side effects are not desired.

JonLiu1993
JonLiu1993 previously approved these changes Jul 26, 2023
@JonLiu1993 JonLiu1993 added the info:reviewed Pull Request changes follow basic guidelines label Jul 26, 2023
@Neumann-A
Copy link
Contributor Author

Hmm should I update to 3.27.1 or just let this be merged ?

@JonLiu1993
Copy link
Member

Hmm should I update to 3.27.1 or just let this be merged ?

Thanks very much for your contribution, updating to latest is best for users.

@JonLiu1993 JonLiu1993 removed the info:reviewed Pull Request changes follow basic guidelines label Jul 26, 2023
@JonLiu1993 JonLiu1993 changed the title [vcpkg] update CMake to 3.27 [vcpkg] update CMake to 3.27.1 Jul 27, 2023
@Neumann-A
Copy link
Contributor Author

Somebody want to fix the baseline regression of starlink-ast? For me that look like a optional dependency which is only found for release builds.

@JonLiu1993
Copy link
Member

Somebody want to fix the baseline regression of starlink-ast? For me that look like a optional dependency which is only found for release builds.

The latest ci baseline does not appear starlink-ast:arm64-windows error. https://dev.azure.com/vcpkg/public/_build/results?buildId=92175&view=results

@dg0yt
Copy link
Contributor

dg0yt commented Jul 28, 2023

Hm, Mismatched binaries is a recurring pattern with starlink-ast.

warning: Mismatching number of debug and release binaries.
Found 12 debug binaries:

    D:\packages\starlink-ast_arm64-windows\debug\lib\libast.lib
    D:\packages\starlink-ast_arm64-windows\debug\lib\libast_drama.lib
    D:\packages\starlink-ast_arm64-windows\debug\lib\libast_ems.lib
    D:\packages\starlink-ast_arm64-windows\debug\lib\libast_err.lib
    D:\packages\starlink-ast_arm64-windows\debug\lib\libast_grf3d.lib
    D:\packages\starlink-ast_arm64-windows\debug\lib\libast_grf_2.0.lib
    D:\packages\starlink-ast_arm64-windows\debug\lib\libast_grf_3.2.lib
    D:\packages\starlink-ast_arm64-windows\debug\lib\libast_grf_5.6.lib
    D:\packages\starlink-ast_arm64-windows\debug\lib\libast_pal.lib
    D:\packages\starlink-ast_arm64-windows\debug\lib\libast_pass2.lib
    D:\packages\starlink-ast_arm64-windows\debug\lib\libast_pgplot.lib
    D:\packages\starlink-ast_arm64-windows\debug\lib\libast_pgplot3d.lib

Found 8 release binaries:

    D:\packages\starlink-ast_arm64-windows\lib\libast.lib
    D:\packages\starlink-ast_arm64-windows\lib\libast_drama.lib
    D:\packages\starlink-ast_arm64-windows\lib\libast_ems.lib
    D:\packages\starlink-ast_arm64-windows\lib\libast_err.lib
    D:\packages\starlink-ast_arm64-windows\lib\libast_grf3d.lib
    D:\packages\starlink-ast_arm64-windows\lib\libast_grf_2.0.lib
    D:\packages\starlink-ast_arm64-windows\lib\libast_pal.lib
    D:\packages\starlink-ast_arm64-windows\lib\libast_pass2.lib

libast_grf_3.2.lib, libast_grf_5.6.lib, libast_pgplot.lib, libast_pgplot3d.lib were present for release in the successful vcpkg.ci run.

@dg0yt
Copy link
Contributor

dg0yt commented Jul 28, 2023

I fail to spot significant differences in starlink config logs. I still feel nervous about

 cl : Command line warning D9002 : ignoring unknown option '-Xcompiler'
 LINK : warning LNK4044: unrecognized option '/Xlinker'; ignored
-LINK : warning LNK4044: unrecognized option '/LD:/installed/arm64-windows/debug/lib'; ignored
+LINK : warning LNK4044: unrecognized option '/LD:/installed/arm64-windows/lib'; ignored

but I have no interest to spend more time before the vcm fixes from #31228.

@Neumann-A
Copy link
Contributor Author

@JonLiu1993: arm64-windows CI is now green that is why starlink-ast is a baseline regression

@JonLiu1993 JonLiu1993 added the info:reviewed Pull Request changes follow basic guidelines label Jul 31, 2023
@walbourn
Copy link
Member

Why wouldn't the same issue apply to say directxmesh?

@Neumann-A
Copy link
Contributor Author

Why wouldn't the same issue apply to say directxmesh?

@walbourn If it has the same logic it has the same problem. I only checked the previous ci failing ports.

@JavierMatosD JavierMatosD merged commit 6ced774 into microsoft:master Jul 31, 2023
16 checks passed
@Neumann-A Neumann-A deleted the cmake_3.27.0 branch July 31, 2023 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[directxtex] does not fully control its optional dependencies
6 participants