Skip to content

[cmake] WIP#40253

Closed
dg0yt wants to merge 2 commits intomicrosoft:masterfrom
dg0yt:cmake
Closed

[cmake] WIP#40253
dg0yt wants to merge 2 commits intomicrosoft:masterfrom
dg0yt:cmake

Conversation

@dg0yt
Copy link
Copy Markdown
Contributor

@dg0yt dg0yt commented Aug 3, 2024

Adressing baseline regression: The Windows DLL triplets fail to build downstream cmake.

[527/528] C:\Windows\system32\cmd.exe /C "cd . && D:\downloads\tools\cmake-3.29.2-windows\cmake-3.29.2-windows-i386\bin\cmake.exe -E vs_link_exe --intdir=Source\QtDialog\CMakeFiles\cmake-gui.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests D:\b\cmake\src\17503183d2-2d56d3dcb1.clean\Source\cmake.version.manifest -- C:\PROGRA~1\MICROS~1\2022\ENTERP~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\link.exe  Source\QtDialog\CMakeFiles\CMakeGUIQRCLib.dir\qrc_CMakeSetup.cpp.obj Source\CMakeFiles\CMakeVersion.dir\CMakeVersion.rc.res Source\QtDialog\CMakeFiles\cmake-gui.dir\CMakeGUIExec.cxx.obj Source\QtDialog\CMakeFiles\cmake-gui.dir\CMakeSetup.rc.res  /out:bin\cmake-gui.exe /implib:bin\cmake-gui.lib /pdb:bin\cmake-gui.pdb /version:0.0 /machine:x64 -stack:10000000 /nologo    /debug /INCREMENTAL /subsystem:windows  Source\QtDialog\CMakeGUIMainLib.lib  Source\QtDialog\CMakeGUILib.lib  Source\CMakeLib.lib  Source\kwsys\cmsys.lib  Utilities\std\cmstd.lib  D:\installed\x64-windows\debug\lib\libexpatd.lib  D:\installed\x64-windows\debug\lib\zlibd.lib  D:\installed\x64-windows\debug\lib\archive.lib  D:\installed\x64-windows\debug\lib\libcurl-d.lib  D:\installed\x64-windows\debug\lib\jsoncpp.lib  D:\installed\x64-windows\debug\lib\uv.lib  psapi.lib  user32.lib  advapi32.lib  iphlpapi.lib  ws2_32.lib  dbghelp.lib  ole32.lib  Utilities\cmlibrhash\cmlibrhash.lib  rpcrt4.lib  crypt32.lib  D:\installed\x64-windows\debug\lib\Qt6Widgetsd.lib  D:\installed\x64-windows\debug\lib\Qt6Guid.lib  D:\installed\x64-windows\debug\lib\Qt6Cored.lib  mpr.lib  userenv.lib  D:\installed\x64-windows\debug\lib\Qt6EntryPointd.lib  shell32.lib  d3d11.lib  dxgi.lib  dxguid.lib  d3d12.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
[527/528] C:\Windows\system32\cmd.exe /C "cd /D D:\b\cmake\x64-windows-dbg && D:\b\cmake\x64-windows-dbg\bin\cmake.exe -P cmake_install.cmake"
FAILED: CMakeFiles/install.util 
C:\Windows\system32\cmd.exe /C "cd /D D:\b\cmake\x64-windows-dbg && D:\b\cmake\x64-windows-dbg\bin\cmake.exe -P cmake_install.cmake"

The link command is executed via the installed cmake (D:\downloads\tools\cmake-3.29.2-windows\cmake-3.29.2-windows-i386\bin\cmake.exe),
but the failing install command is executed via the the freshly built cmake (D:\b\cmake\x64-windows-dbg\bin\cmake.exe).

(From #40224 (comment)

CMake wants it this way for native builds:
https://github.com/Kitware/CMake/blob/4aa42149d69c8e0fa542e18196463d671190710c/Source/cmGlobalGenerator.cxx#L3121-L3127

So there seems to be an issue with DLLs.

@dg0yt
Copy link
Copy Markdown
Contributor Author

dg0yt commented Aug 3, 2024

Also affecting D:\b\cmake\x64-windows-rel\bin\cmake.exe, i.e release config.

@dg0yt
Copy link
Copy Markdown
Contributor Author

dg0yt commented Aug 3, 2024

The deployed cmake.exe is able to run and report the version - the original problem only exists with the executable in the build directory.

Comment on lines +26 to +27
"name": "qtbase",
"default-features": false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

that is probably wrong. needs at least widgets and gui

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

True. And doesn't matter for CI. (What I really want is a feature, but it is not a priority.)

@Neumann-A
Copy link
Copy Markdown
Contributor

What is the link line for cmake.exe itself ?

the original problem only exists with the executable in the build directory.

With ADD_BIN_TO_PATH it should run just fine. I did this intentionally so that I am sure that the build cmake actually works without having to test it manually.

@dg0yt
Copy link
Copy Markdown
Contributor Author

dg0yt commented Aug 3, 2024

What is the link line for cmake.exe itself ?

CI logs:

[512/518] C:\Windows\system32\cmd.exe /C "cd . && D:\downloads\tools\cmake-3.29.2-windows\cmake-3.29.2-windows-i386\bin\cmake.exe -E vs_link_exe --intdir=Source\CMakeFiles\cmake.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests D:\b\cmake\src\17503183d2-7dbde7966f.clean\Source\cmake.version.manifest -- C:\PROGRA~1\MICROS~1\2022\ENTERP~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\link.exe  Source\CMakeFiles\CMakeVersion.dir\CMakeVersion.rc.res Source\CMakeFiles\cmake.dir\cmakemain.cxx.obj Source\CMakeFiles\cmake.dir\cmcmd.cxx.obj  /out:bin\cmake.exe /implib:bin\cmake.lib /pdb:bin\cmake.pdb /version:0.0 /machine:x64 -stack:10000000 /nologo /DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF   /subsystem:console  Source\CMakeLib.lib  Source\kwsys\cmsys.lib  Utilities\std\cmstd.lib  D:\installed\x64-windows\lib\libexpat.lib  D:\installed\x64-windows\lib\zlib.lib  D:\installed\x64-windows\lib\archive.lib  D:\installed\x64-windows\lib\libcurl.lib  D:\installed\x64-windows\lib\jsoncpp.lib  D:\installed\x64-windows\lib\uv.lib  psapi.lib  user32.lib  advapi32.lib  iphlpapi.lib  userenv.lib  ws2_32.lib  dbghelp.lib  ole32.lib  shell32.lib  D:\installed\x64-windows\lib\rhash.lib  rpcrt4.lib  crypt32.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."

the original problem only exists with the executable in the build directory.

With ADD_BIN_TO_PATH it should run just fine. I did this intentionally so that I am sure that the build cmake actually works without having to test it manually.

I agree. However it fails, and I don't have a local msvc installation to investigate the difference.

@Neumann-A
Copy link
Copy Markdown
Contributor

Release only triplet:

E:\vcpkg_folders\various\buildtrees\cmake\x64-windows-release-rel\bin>set PATH=E:\vcpkg_folders\various\installed\x64-windows-release\bin;%PATH%

E:\vcpkg_folders\various\buildtrees\cmake\x64-windows-release-rel\bin>cmake --version
cmake version 3.22.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

No problem....

@dg0yt
Copy link
Copy Markdown
Contributor Author

dg0yt commented Aug 3, 2024

So it is only in CI, and only before app-local deployment?

@dg0yt
Copy link
Copy Markdown
Contributor Author

dg0yt commented Aug 3, 2024

And did you pull in all transitive dependencies which are pulled in via test ports?

For example, with curl, you also need vcpkg-ci-curl. Which got a number of additions recently.

@Neumann-A
Copy link
Copy Markdown
Contributor

And did you pull in all transitive dependencies which are pulled in via test ports?

I only pulled in the minimal required deps. x64-windows this way also worked. I can test with more but in the end it is probably a release/debug problem.

@Neumann-A
Copy link
Copy Markdown
Contributor

./vcpkg.exe install --overlay-ports=scripts/test_ports/ cmake vcpkg-ci-curl --host-triplet=x64-windows

worked as expected

@Neumann-A
Copy link
Copy Markdown
Contributor

Looking at the link line I would guess libarchive might be to blame if libcurl isnt the one to blame.

@Neumann-A
Copy link
Copy Markdown
Contributor

Hmm building with libarchive[*] also works.

@dg0yt
Copy link
Copy Markdown
Contributor Author

dg0yt commented Aug 4, 2024

#40224 passed CI now. The actual cmake issue probably involves an installation order problem.

@JonLiu1993 JonLiu1993 self-assigned this Aug 5, 2024
@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 Aug 5, 2024
@dg0yt
Copy link
Copy Markdown
Contributor Author

dg0yt commented Sep 8, 2024

Probably symptom of #40414, fixed by #40473.

@dg0yt dg0yt closed this Sep 8, 2024
@dg0yt
Copy link
Copy Markdown
Contributor Author

dg0yt commented Sep 8, 2024

Most changes might still be useful.

@dg0yt dg0yt deleted the cmake branch March 29, 2025 15:44
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.

3 participants