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-scripts] Update to CMake 4.0.0-rc4 #44273

Open
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

Neumann-A
Copy link
Contributor

@Neumann-A Neumann-A commented Mar 9, 2025

Fixes #43816

@Neumann-A
Copy link
Contributor Author

@BillyONeal Is it intended that CI is not printing the actual download failure due to the hash mismatch (since the hash has only be updated for windows & amd64)?

@jimwang118 jimwang118 self-assigned this Mar 10, 2025
@jimwang118 jimwang118 added the category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly label Mar 10, 2025
@BillyONeal
Copy link
Member

@BillyONeal Is it intended that CI is not printing the actual download failure due to the hash mismatch (since the hash has only be updated for windows & amd64)?

I'm not sure I understand the question. It won't report failures to download things it never attempts to download.

@Neumann-A
Copy link
Contributor Author

I'm not sure I understand the question. It won't report failures to download things it never attempts to download.

I updated the version to 4.0.0-rc3 so shouldn't it always attempt to download that version? However, it just gives an error that it cannot find cmake where it expects it to find it. I expected it to print a hash mismatch error instead. Ah maybe that is the same issue as everywhere that it does not download it if there is a hash match because i didn't set it to 0.

@Neumann-A Neumann-A mentioned this pull request Mar 13, 2025
7 tasks
@autoantwort
Copy link
Contributor

It first tries to download the thing through the asset cache via the given sha, if this fails it tries to download from the original url.

@Neumann-A
Copy link
Contributor Author

@autoantwort I tend to forget that fact sometimes. However, can you take a look at the osx failure. I assume something is wrong with the download path for some reason? (The SHA is now changed so it should download the new version)

@Neumann-A
Copy link
Contributor Author

Remaining:

SUMMARY FOR x64-windows-release
  SUCCEEDED: 705
  BUILD_FAILED: 4
  CASCADED_DUE_TO_MISSING_DEPENDENCIES: 4
REGRESSIONS:
REGRESSION: liblas:x64-windows-release failed with BUILD_FAILED. If expected, add liblas:x64-windows-release=fail to D:\a\_work\1\s\scripts\azure-pipelines/../ci.baseline.txt.
REGRESSION: ned14-internal-quickcpplib:x64-windows-release failed with BUILD_FAILED. If expected, add ned14-internal-quickcpplib:x64-windows-release=fail to D:\a\_work\1\s\scripts\azure-pipelines/../ci.baseline.txt.
REGRESSION: torch-th:x64-windows-release failed with BUILD_FAILED. If expected, add torch-th:x64-windows-release=fail to D:\a\_work\1\s\scripts\azure-pipelines/../ci.baseline.txt.
REGRESSION: vcpkg-from-git-test:x64-windows-release failed with BUILD_FAILED. If expected, add vcpkg-from-git-test:x64-windows-release=fail to D:\a\_work\1\s\scripts\azure-pipelines/../ci.baseline.txt.
SUMMARY FOR x64-linux
  SUCCEEDED: 412
  BUILD_FAILED: 7
  CASCADED_DUE_TO_MISSING_DEPENDENCIES: 4
REGRESSIONS:
REGRESSION: libevhtp:x64-linux failed with BUILD_FAILED. If expected, add libevhtp:x64-linux=fail to /mnt/vss/_work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: liblas:x64-linux failed with BUILD_FAILED. If expected, add liblas:x64-linux=fail to /mnt/vss/_work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: ned14-internal-quickcpplib:x64-linux failed with BUILD_FAILED. If expected, add ned14-internal-quickcpplib:x64-linux=fail to /mnt/vss/_work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: ois:x64-linux failed with BUILD_FAILED. If expected, add ois:x64-linux=fail to /mnt/vss/_work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: physx:x64-linux failed with BUILD_FAILED. If expected, add physx:x64-linux=fail to /mnt/vss/_work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: torch-th:x64-linux failed with BUILD_FAILED. If expected, add torch-th:x64-linux=fail to /mnt/vss/_work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: zkpp:x64-linux failed with BUILD_FAILED. If expected, add zkpp:x64-linux=fail to /mnt/vss/_work/1/s/scripts/azure-pipelines/../ci.baseline.txt.

SUMMARY FOR x64-osx
  SUCCEEDED: 607
  BUILD_FAILED: 65
  CASCADED_DUE_TO_MISSING_DEPENDENCIES: 606
REGRESSIONS:
REGRESSION: openssl:x64-osx failed with BUILD_FAILED. If expected, add openssl:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: openmpi:x64-osx failed with BUILD_FAILED. If expected, add openmpi:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: libffi:x64-osx failed with BUILD_FAILED. If expected, add libffi:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: libsodium:x64-osx failed with BUILD_FAILED. If expected, add libsodium:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: gsasl:x64-osx failed with BUILD_FAILED. If expected, add gsasl:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: krb5:x64-osx failed with BUILD_FAILED. If expected, add krb5:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: gmp:x64-osx failed with BUILD_FAILED. If expected, add gmp:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: libunistring:x64-osx failed with BUILD_FAILED. If expected, add libunistring:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: libtasn1:x64-osx failed with BUILD_FAILED. If expected, add libtasn1:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: gettext:x64-osx failed with BUILD_FAILED. If expected, add gettext:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: apr:x64-osx failed with BUILD_FAILED. If expected, add apr:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: libusb:x64-osx failed with BUILD_FAILED. If expected, add libusb:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: libbacktrace:x64-osx failed with BUILD_FAILED. If expected, add libbacktrace:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: libdvdcss:x64-osx failed with BUILD_FAILED. If expected, add libdvdcss:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: mp3lame:x64-osx failed with BUILD_FAILED. If expected, add mp3lame:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: speex:x64-osx failed with BUILD_FAILED. If expected, add speex:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: botan:x64-osx failed with BUILD_FAILED. If expected, add botan:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: freexl:x64-osx failed with BUILD_FAILED. If expected, add freexl:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: librttopo:x64-osx failed with BUILD_FAILED. If expected, add librttopo:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: clockutils:x64-osx failed with BUILD_FAILED. If expected, add clockutils:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: ncurses:x64-osx failed with BUILD_FAILED. If expected, add ncurses:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: cmake:x64-osx cascaded, but it is required to pass. (/Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt).
REGRESSION: cmake-user:x64-osx cascaded, but it is required to pass. (/Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt).
REGRESSION: coinutils:x64-osx failed with BUILD_FAILED. If expected, add coinutils:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: cppunit:x64-osx failed with BUILD_FAILED. If expected, add cppunit:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: llvm:x64-osx failed with BUILD_FAILED. If expected, add llvm:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: farmhash:x64-osx failed with BUILD_FAILED. If expected, add farmhash:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: fastcgi:x64-osx failed with BUILD_FAILED. If expected, add fastcgi:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: glpk:x64-osx failed with BUILD_FAILED. If expected, add glpk:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: libgpg-error:x64-osx failed with BUILD_FAILED. If expected, add libgpg-error:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: libsass:x64-osx failed with BUILD_FAILED. If expected, add libsass:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: gtk:x64-osx cascaded, but it is required to pass. (/Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt).
REGRESSION: hashids:x64-osx failed with BUILD_FAILED. If expected, add hashids:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: hwloc:x64-osx failed with BUILD_FAILED. If expected, add hwloc:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: htscodecs:x64-osx failed with BUILD_FAILED. If expected, add htscodecs:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: hunspell:x64-osx failed with BUILD_FAILED. If expected, add hunspell:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.
REGRESSION: isal:x64-osx failed with BUILD_FAILED. If expected, add isal:x64-osx=fail to /Users/vcpkg/Data/work/1/s/scripts/azure-pipelines/../ci.baseline.txt.

mac really doesnt like cmake 4

@Neumann-A Neumann-A changed the title [vcpkg-scripts] Update to CMake 4.0.0-rc3 [vcpkg-scripts] Update to CMake 4.0.0-rc4 Mar 21, 2025
@Neumann-A
Copy link
Contributor Author

@dg0yt:
Any quick idea why android is suddenly failing here with:

FAILED: common/CMakeFiles/common.dir/md5.cpp.o 
/android-ndk-r27c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=x86_64-none-linux-android28 --sysroot=/android-ndk-r27c/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DEXPORT_C_API=1 -DHAVE_INT_TYPES_H=1 -DHIGH_BIT_DEPTH=0 -DX265_ARCH_X86=1 -DX265_DEPTH=8 -DX265_NS=x265 -DX86_64=1 -I/mnt/vcpkg-ci/b/x265/src/4.1-55ed3644b6.clean/source/. -I/mnt/vcpkg-ci/b/x265/src/4.1-55ed3644b6.clean/source/common -I/mnt/vcpkg-ci/b/x265/src/4.1-55ed3644b6.clean/source/encoder -I/mnt/vcpkg-ci/b/x265/x64-android-dbg -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -frtti -fexceptions  -fPIC   -fno-limit-debug-info    -fPIC -MD -MT common/CMakeFiles/common.dir/md5.cpp.o -MF common/CMakeFiles/common.dir/md5.cpp.o.d -o common/CMakeFiles/common.dir/md5.cpp.o -c /mnt/vcpkg-ci/b/x265/src/4.1-55ed3644b6.clean/source/common/md5.cpp
/mnt/vcpkg-ci/b/x265/src/4.1-55ed3644b6.clean/source/common/md5.cpp:188:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  188 |     register uint32_t a, b, c, d;
      |     ^~~~~~~~
/mnt/vcpkg-ci/b/x265/src/4.1-55ed3644b6.clean/source/common/md5.cpp:188:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  188 |     register uint32_t a, b, c, d;
      |     ^~~~~~~~
/mnt/vcpkg-ci/b/x265/src/4.1-55ed3644b6.clean/source/common/md5.cpp:188:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  188 |     register uint32_t a, b, c, d;
      |     ^~~~~~~~
/mnt/vcpkg-ci/b/x265/src/4.1-55ed3644b6.clean/source/common/md5.cpp:188:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  188 |     register uint32_t a, b, c, d;
      |     ^~~~~~~~
4 errors generated.

@dg0yt
Copy link
Contributor

dg0yt commented Mar 21, 2025

Did you notice that android is now dynamic crt, API Level 28?

@Neumann-A
Copy link
Contributor Author

Did you notice that android is now dynamic crt, API Level 28?

So what exactly changed? --target=x86_64-none-linux-android28 changed suddenly? What is the current default?

@dg0yt
Copy link
Contributor

dg0yt commented Mar 21, 2025

So what exactly changed? --target=x86_64-none-linux-android28 changed suddenly? What is the current default?

android28 is new. It was android21 until recently. The effect on available API is significant. But okay, this port shouldn't be affected.

@@ -38,16 +38,12 @@ if(VCPKG_TARGET_IS_UWP)
list(APPEND FEATURE_OPTIONS -DMINIGLOG=ON)
endif()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert changes to ceres

@@ -24,7 +24,7 @@ function(vcpkg_from_git)
if(DEFINED arg_FETCH_REF AND NOT DEFINED arg_REF)
message(FATAL_ERROR "REF must be specified if FETCH_REF is specified")
endif()
if(NOT DEFINED arg_LFS AND "LFS" IN_LIST arg_KEYWORDS_MISSING_VALUES)
if(arg_LFS STREQUAL "" AND "LFS" IN_LIST arg_KEYWORDS_MISSING_VALUES)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be just

Suggested change
if(arg_LFS STREQUAL "" AND "LFS" IN_LIST arg_KEYWORDS_MISSING_VALUES)
if("LFS" IN_LIST arg_KEYWORDS_MISSING_VALUES)

?

@@ -1,4 +1,6 @@
cmake_minimum_required(VERSION 3.21)
set(ENV{CMAKE_POLICY_VERSION_MINIMUM} 3.5)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this we don't need "-DCMAKE_POLICY_VERSION_MINIMUM=3.5" in vcpkg_configure_cmake and vcpkg_configure_cmake. Setting the env variable is necessary because projects can call cmake within cmake and then the cmake variable would be missing which is why the env variable is superior

@Neumann-A
Copy link
Contributor Author

PR is basically green and thus theoretically ready for review.

@BillyONeal
Copy link
Member

@ras0219-msft @vicroms @BillyONeal @JavierMatosD discussed this today. I'm sorry this comment doesn't necessarily give you a path forward here @Neumann-A ; I thought it important to record the thought process even if we don't really have a good answer right now.

We have a problem in that there doesn't seem to be a great answer to provide the kind of compat guarantees we would normally want to provide given that CMake has done this to us. Originally, we were going to say something like:

  • An update to CMake 4 must not require changes to the ports directory
  • We should test additionally that a ports tree from ~ a year ago work

but after testing that cmake_policy(SET xxxx OLD)s like those patched in this PR become hard errors, we understand that this is an unrealistic ask.

Potential ideas. This is a brainstorm, not picking one:

  • Add something close to how VCPKG_FORCE_SYSTEM_BINARIES to the tool except only to control CMake, letting a user force an older version if they want. This is relatively cheap but might not be great UX.
    • This probably implies fixing the 'version'/minimum version idea mismatch in vcpkg-tools.json
  • Add a mechanism in vcpkg.json to explicitly opt in to 4.x.
  • Add a mechanism to lock the chosen version of cmake based on the version of vcpkg-cmake selected. Unfortunately this would only help for a hypothetical 'cmake 5.x' unless we could introduce another version that specifically pins 3.x

We probably won't have landed on a path forward before 4.x is actually out. We're curious what the Linuxes do here; do they add cmake4 as a separate package (like they did for python) or do they force patch everyone (like they did for openssl)?

@Neumann-A
Copy link
Contributor Author

In the meantime CMake 4 has been released.

but after testing that cmake_policy(SET xxxx OLD)s like those patched in this PR become hard errors, we understand that this is an unrealistic ask.

I could override cmake_policy? And ignore policy settings which would error with the newer CMake versions. It wouldn't help however with the slight syntax errors projects seem to have. I could also be sneaky and first upgrade all ports and then hide stability behind only changing the cmake version ;)

Add a mechanism to lock the chosen version of cmake based on the version of vcpkg-cmake selected. Unfortunately this would only help for a hypothetical 'cmake 5.x' unless we could introduce another version that specifically pins 3.x

Doesn't this mean to basically have two verisons of CMake? One running vcpkg and run running the ports? Also this would imply a tool port for CMake?

We're curious what the Linuxes do here;

Most of the errors are on macosx so they probably do not care? And setting set(ENV{CMAKE_POLICY_VERSION_MINIMUM} 3.5) is basically all that is needed to make nearly all projects build.

hebasto added a commit to bitcoin/bitcoin that referenced this pull request Apr 1, 2025
30c59ad ci: Drop confusing comment (Hennadii Stepanov)
ef00a28 ci: Add workaround for vcpkg's libevent package (Hennadii Stepanov)

Pull request description:

  This PR is necessary for Windows GHA [images](https://github.com/actions/runner-images/blob/win22/20250330.1/images/windows/Windows2022-Readme.md), which provide CMake >= 4.0.

  The idea has been taken from microsoft/vcpkg#44273 (comment).

ACKs for top commit:
  maflcko:
    lgtm ACK 30c59ad
  pinheadmz:
    ACK 30c59ad

Tree-SHA512: 898a616a40c1aaec69d8a329d56f887cacec71b9588842feef2b689fbd21a12d8f8b3b4053a6373332008668960b9df7c71a44fcd97e637e250705daf1215c7f
@PhoebeHui PhoebeHui assigned Mengna-Li and unassigned jimwang118 Apr 2, 2025
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[qtgraphs] Build failure on x64-windows due to CMake Version
6 participants