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

[qttools] Install error. #38936

Closed
reitowo opened this issue May 24, 2024 · 6 comments · Fixed by #38682
Closed

[qttools] Install error. #38936

reitowo opened this issue May 24, 2024 · 6 comments · Fixed by #38682
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@reitowo
Copy link
Contributor

reitowo commented May 24, 2024

Qt 6.7.0 doesn't handle CMake scripts properly at install command.
When using qt_generate_deploy_app_script in my CMakeLists and install, it can't find qtpaths.exe. It is trying to find under vcpkg_installed/x64-windows/bin but it is in vcpkg_installed/x64_windows/tools/Qt6/bin.
Also, when setting the qtpaths manually to correct path, it also trying to find all debug dlls under vcpkg_installed/x64-windows/bin instead of vcpkg_installed/x64_windows/debug/bin.

At least 6.4.3 version was working normally.

Qt really just don't like vcpkg's model, huh?

@Neumann-A
Copy link
Contributor

can you give me an expanded trace with --trace-expand?

Probably an easy fix by adjusting the script

@reitowo
Copy link
Contributor Author

reitowo commented May 24, 2024

--trace-expand which command this arg is apply to?

-- Running Qt deploy tool for E:/VTSLink/Client/VTSLink/out/build/x64-RelWithDebInfo/bin/VTSLink.exe in working directory 'E:/VTSLink/Client/VTSLink/out/install/x64-RelWithDebInfo'
'E:/VTSLink/Client/VTSLink/out/build/x64-RelWithDebInfo/vcpkg_installed/x64-windows/tools/Qt6/bin/windeployqt.exe' 'E:/VTSLink/Client/VTSLink/out/build/x64-RelWithDebInfo/bin/VTSLink.exe' '--dir' '.' '--libdir' 'bin' '--plugindir' 'plugins' '--qml-deploy-dir' 'qml' '--translationdir' 'translations' '--force' '--qtpaths' 'E:/VTSLink/Client/VTSLink/out/build/x64-RelWithDebInfo/vcpkg_installed/x64-windows/bin/qtpaths.exe'
Error: "E:\VTSLink\Client\VTSLink\out\build\x64-RelWithDebInfo\vcpkg_installed\x64-windows\bin\qtpaths.exe" does not exist.
CMake Error at vcpkg_installed/x64-windows/share/Qt6Core/Qt6CoreDeploySupport.cmake:528 (message):
  Executing
  E:/VTSLink/Client/VTSLink/out/build/x64-RelWithDebInfo/vcpkg_installed/x64-windows/tools/Qt6/bin/windeployqt.exe
  failed: 1
Call Stack (most recent call first):
  .qt/deploy_VTSLink_bfe1574f6c.cmake:5 (qt6_deploy_runtime_dependencies)
  cmake_install.cmake:58 (include)

vcpkg.json

{
  "name": "vts-link-client",
  "license": "GPL-2.0-only",
  "dependencies": [
    {
      "name": "libdatachannel",
      "default-features": true,
      "features": [ "ws", "stdcall" ]
    },
    {
      "name": "ffmpeg",
      "default-features": true,
      "features": [ "nvcodec", "qsv", "amf" ]
    },
    {
      "name": "grpc",
      "default-features": true,
      "features": [ "codegen" ]
    },
    "amd-amf",
    "mfx-dispatch",
    "protobuf",
    "concurrentqueue",
    "crashpad",
    "libqrencode",
    "detours",
    "pthreads",
    {
      "name": "spout2",
      "default-features": true,
      "features": [ "dx" ]
    },
    {
      "name": "qtbase",
      "default-features": false,
      "features": [
        "gui",
        "network",
        "thread",
        "widgets",
        "png"
      ]
    },
    "qttools",
    "qttranslations",
    "directxtk",
    {
      "name": "opencv2",
      "default-features": true,
      "features": [ "png" ]
    }
  ],
  "overrides": [
    {
      "name": "openssl",
      "version-string": "1.1.1m#2"
    },
    {
      "name": "qtbase",
      "version-string": "6.7.0"
    },
    {
      "name": "qttools",
      "version-string": "6.7.0#1"
    },
    {
      "name": "qttranslations",
      "version-string": "6.7.0"
    }
  ],
  "supports": "windows",
  "vcpkg-configuration": {
    "default-registry": {
      "kind": "git",
      "repository": "https://github.com/cnSchwarzer/vcpkg",
      "baseline": "bee2447e324d4a59fe460640683adbd2df3d8373",
      "reference": "reito"
    },
    "registries": [
    ]
  }
}

@Neumann-A
Copy link
Contributor

Patch 1:

diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake
index 8a0d07feac..0e6a720c20 100644
--- a/src/corelib/Qt6CoreMacros.cmake	
+++ b/src/corelib/Qt6CoreMacros.cmake
@@ -2977,13 +2977,15 @@ function(_qt_internal_setup_deploy_support)
     if(CMAKE_HOST_WIN32)
         if(CMAKE_CROSSCOMPILING)
             set(qt_paths_ext ".bat")
+        elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")
+            set(qt_paths_ext ".debug.bat")
         else()
             set(qt_paths_ext ".exe")
         endif()
     else()
         set(qt_paths_ext "")
     endif()
-    set(target_qtpaths_path "${QT6_INSTALL_PREFIX}/${QT6_INSTALL_BINS}/qtpaths${qt_paths_ext}")
+    set(target_qtpaths_path "${QT6_INSTALL_PREFIX}/tools/Qt6/bin/qtpaths${qt_paths_ext}")
 
     file(GENERATE OUTPUT "${QT_DEPLOY_SUPPORT}" CONTENT
 "cmake_minimum_required(VERSION 3.16...3.21)

@Neumann-A
Copy link
Contributor

it also trying to find all debug dlls under vcpkg_installed/x64-windows/bin instead of vcpkg_installed/x64_windows/debug/bin.

For debug libs it needs to use windeployqt.debug.bat. The target should be setup accordingly. Did you call find_package with CoreTools ?

@Neumann-A
Copy link
Contributor

And for testing you can just manually edit the installed tree with the patch above. That avoids reinstalling all of qt.

@reitowo
Copy link
Contributor Author

reitowo commented May 25, 2024

The patch works! Thanks. Would you submit a PR?

@Cheney-W Cheney-W added the category:port-bug The issue is with a library, which is something the port should already support label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants