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

[Bug]: Missing Qt6GuiTools in QT6 package for MinGW (Windows) #793

Closed
1 task done
pktiuk opened this issue Jun 6, 2024 · 10 comments
Closed
1 task done

[Bug]: Missing Qt6GuiTools in QT6 package for MinGW (Windows) #793

pktiuk opened this issue Jun 6, 2024 · 10 comments
Labels
bug Something isn't working triage

Comments

@pktiuk
Copy link

pktiuk commented Jun 6, 2024

Bug description

Hello,
I have 4 workflows in my CI involving QT6 on Windows:

  • QT 5.15.2 (win64_mingw81)
  • QT 6.7 (win64_mingw)
  • QT 5.15.2 (win64_msvc2019_64)
  • QT 6.7 (win64_msvc2019_64)

There is a problem with QT 6.7 (win64_mingw). There is a problem only with this configuration (workflows use the same code, the same base image). I think that package may miss something.

Cmake reports Error:

 CMake Warning at C:/msys64/mingw64/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package):
  By not providing "FindQt6GuiTools.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "Qt6GuiTools", but CMake did not find one.

  Could not find a package configuration file provided by "Qt6GuiTools"
  (requested version 6.7.1) with any of the following names:

    Qt6GuiToolsConfig.cmake
    qt6guitools-config.cmake

MinGW doesn't work also with 6.5, 6.6 and 6.2 releases (so I guess all the 6.X versions are broken)

All of the logs can be found in the logs from GitHub Actions on my repository:
https://github.com/AntiMicroX/antimicrox/actions/runs/9408049153/job/25915160132

Reproduction

Expected behavior

QT6 with MinGW should work like remaining variants.

aqt and python version

Python 3.11, aqt 3.1.15

Operating System

Windows

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@pktiuk pktiuk added bug Something isn't working triage labels Jun 6, 2024
@pzhlkj6612
Copy link
Contributor

Hi! Did you try installing Qt6 MinGW with the official installer on Windows locally? If the official installation is broken, too, I think you could raise an issue on Qt's bug tracker: https://bugreports.qt.io/.

And I guess this change is not only for MinGW, but also macOS: Could NOT find EGL (missing: EGL_INCLUDE_DIR HAVE_EGL EGL_LIBRARY) - Pastebin.com.

@pktiuk
Copy link
Author

pktiuk commented Jun 7, 2024

Hello @pzhlkj6612 ,
I don't have Windows. That's why the only contact I have with this system is via runners used in Continous Integration.

@pktiuk
Copy link
Author

pktiuk commented Jun 29, 2024

@pzhlkj6612
Is there any official way of installing QT on windows purely by CLI? Which could be replicated inside a GitHub runner?
In such a case I could figure out whether the source of problem lies in QT or in AQT

@pzhlkj6612
Copy link
Contributor

@pktiuk

There might be a way to install Qt with its online installer by CLI, but I didn't succeed.

My command in PowerShell on Windows 11:

.\qt-unified-windows-x64-online.exe `
  --email '<email>' `
  --password '<password>' `
  --no-save-account `
  --accept-licenses `
  --accept-obligations `
  --default-answer `
  --confirm-command `
  install qt.qt6.671.win64_mingw 

ATTENTION: use Secrets in GitHub Actions to protect your credentials.

Always failed due to this error:

[526488] perform qt.tools.qtdesignstudio operation: Execute
[526491]        - arguments: C:\\Qt\\Tools\QtDesignStudio\bin\sdktool.exe, -s, C:\\Qt\\Tools\QtDesignStudio\share\qtcreator\\QtProject\qtdesignstudio, addTC, --id, ProjectExplorer.ToolChain.Custom:{9799e31f-e3d0-47cb-8bc1-1d0806d0ed23}, --language, C, --name, mock C compiler, --abi, x86-windows-msvc2019-pe-64bit, --path, not_existing, ProjectExplorer.CustomToolChain.TargetAbi, QString:x86-windows-msvc2019-pe-64bit, UNDOEXECUTE, {0,2}, C:\\Qt\\Tools\QtDesignStudio\bin\sdktool.exe, -s, C:\\Qt\\Tools\QtDesignStudio\share\qtcreator\\QtProject\qtdesignstudio, rmTC, --id, ProjectExplorer.ToolChain.Custom:{9799e31f-e3d0-47cb-8bc1-1d0806d0ed23}
[526645] C:\\\\Qt\\\\Tools\\QtDesignStudio\\bin\\sdktool.exe" started, arguments: "-s C:\\\\Qt\\\\Tools\\QtDesignStudio\\share\\qtcreator\\\\QtProject\\qtdesignstudio addTC --id ProjectExplorer.ToolChain.Custom:{9799e31f-e3d0-47cb-8bc1-1d0806d0ed23} --language C --name mock C compiler --abi x86-windows-msvc2019-pe-64bit --path not_existing ProjectExplorer.CustomToolChain.TargetAbi QString:x86-windows-msvc2019-pe-64bit
[529361] Warning: SOFT ASSERT [17:09:26.661]: "false" in C:\Users\qt\work\build\qt-creator\src\libs\utils\filepath.cpp:927
SOFT ASSERT [17:09:26.661]: "false" in C:\Users\qt\work\build\qt-creator\src\libs\utils\filepath.cpp:991
SOFT ASSERT [17:09:29.360]: "false" in C:\Users\qt\work\build\qt-creator\src\libs\utils\filepath.cpp:991
SOFT ASSERT [17:09:29.360]: "false" in C:\Users\qt\work\build\qt-creator\src\libs\utils\filepath.cpp:991
SOFT ASSERT [17:09:29.360]: "false" in C:\Users\qt\work\build\qt-creator\src\libs\utils\filepath.cpp:991
Error: Could not save settings C://Qt//Tools/QtDesignStudio/share/qtcreator//QtProject/qtdesignstudio/toolchains.xml.

I don't know why. I was running the installer with the Admin right.

References:

@pzhlkj6612
Copy link
Contributor

@pktiuk , you can try to deploy a Windows VM on Linux. Debugging build system on CI looks painful to me. If you have Windows users, making a Windows test environment may not hurt.

I've viewed the directory hierarchy of Qt 6.7.0, 6.7.1 and 6.7.2 official installations on a Windows 11:

$ find . -iname '*Qt6GuiTools*'
./6.7.0/mingw_64/lib/cmake/Qt6GuiTools
./6.7.0/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsAdditionalTargetInfo.cmake
./6.7.0/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsConfig.cmake
./6.7.0/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsConfigVersion.cmake
./6.7.0/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsConfigVersionImpl.cmake
./6.7.0/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsDependencies.cmake
./6.7.0/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsTargets-relwithdebinfo.cmake
./6.7.0/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsTargets.cmake
./6.7.0/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsVersionlessTargets.cmake
./6.7.0/msvc2019_64/lib/cmake/Qt6GuiTools
./6.7.0/msvc2019_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsAdditionalTargetInfo.cmake
./6.7.0/msvc2019_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsConfig.cmake
./6.7.0/msvc2019_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsConfigVersion.cmake
./6.7.0/msvc2019_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsConfigVersionImpl.cmake
./6.7.0/msvc2019_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsDependencies.cmake
./6.7.0/msvc2019_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsTargets-debug.cmake
./6.7.0/msvc2019_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsTargets-relwithdebinfo.cmake
./6.7.0/msvc2019_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsTargets.cmake
./6.7.0/msvc2019_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsVersionlessTargets.cmake

$ grep -rn 'Qt6GuiTools' .
./6.7.0/mingw_64/lib/cmake/Qt6Gui/Qt6GuiDependencies.cmake:36:set(__qt_Gui_tool_deps "Qt6GuiTools\;6.7.0")
./6.7.0/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsAdditionalTargetInfo.cmake:1:# Additional target information for Qt6GuiTools
./6.7.0/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsConfig.cmake:35:if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/Qt6GuiToolsDependencies.cmake")
  <more results from "Qt6GuiToolsConfig.cmake">
./6.7.0/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsConfigVersion.cmake:5:include("${CMAKE_CURRENT_LIST_DIR}/Qt6GuiToolsConfigVersionImpl.cmake")
./6.7.0/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsDependencies.cmake:5:set(Qt6GuiTools_FOUND FALSE)
./6.7.0/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsDependencies.cmake:16:set(Qt6GuiTools_FOUND TRUE)
./6.7.0/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsTargets.cmake:69:file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/Qt6GuiToolsTargets-*.cmake")
./6.7.0/mingw_64/lib/cmake/Qt6WidgetsTools/Qt6WidgetsToolsDependencies.cmake:6:set(__qt_WidgetsTools_tool_deps "Qt6CoreTools\;6.7.0;Qt6GuiTools\;6.7.0")
./6.7.0/msvc2019_64/lib/cmake/Qt6Gui/Qt6GuiDependencies.cmake:36:set(__qt_Gui_tool_deps "Qt6GuiTools\;6.7.0")
./6.7.0/msvc2019_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsAdditionalTargetInfo.cmake:1:# Additional target information for Qt6GuiTools
./6.7.0/msvc2019_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsConfig.cmake:35:if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/Qt6GuiToolsDependencies.cmake")
  <more results from "Qt6GuiToolsConfig.cmake">
./6.7.0/msvc2019_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsConfigVersion.cmake:5:include("${CMAKE_CURRENT_LIST_DIR}/Qt6GuiToolsConfigVersionImpl.cmake")
./6.7.0/msvc2019_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsDependencies.cmake:5:set(Qt6GuiTools_FOUND FALSE)
./6.7.0/msvc2019_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsDependencies.cmake:16:set(Qt6GuiTools_FOUND TRUE)
./6.7.0/msvc2019_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsTargets.cmake:69:file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/Qt6GuiToolsTargets-*.cmake")
./6.7.0/msvc2019_64/lib/cmake/Qt6WidgetsTools/Qt6WidgetsToolsDependencies.cmake:6:set(__qt_WidgetsTools_tool_deps "Qt6CoreTools\;6.7.0;Qt6GuiTools\;6.7.0")

Versions 6.7.0, 6.7.1 and 6.7.2 all have the same structure.

@pktiuk
Copy link
Author

pktiuk commented Sep 19, 2024

@pzhlkj6612

This is really strange: https://github.com/AntiMicroX/antimicrox/actions/runs/10945179079/job/30388800737?pr=1001

These files seem to be already placed in a proper location. Maybe I should prepare some kind of minimal reproduction.

Run find D:/a/antimicrox/antimicrox/Qt/6.4.2/ -iname '*Qt6GuiTools*'
D:/a/antimicrox/antimicrox/Qt/6.4.2/mingw_64/lib/cmake/Qt6GuiTools
D:/a/antimicrox/antimicrox/Qt/6.4.2/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsAdditionalTargetInfo.cmake
D:/a/antimicrox/antimicrox/Qt/6.4.2/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsConfig.cmake
D:/a/antimicrox/antimicrox/Qt/6.4.2/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsConfigVersion.cmake
D:/a/antimicrox/antimicrox/Qt/6.4.2/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsConfigVersionImpl.cmake
D:/a/antimicrox/antimicrox/Qt/6.4.2/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsDependencies.cmake
D:/a/antimicrox/antimicrox/Qt/6.4.2/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsTargets-relwithdebinfo.cmake
D:/a/antimicrox/antimicrox/Qt/6.4.2/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsTargets.cmake
D:/a/antimicrox/antimicrox/Qt/6.4.2/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsVersionlessTargets.cmake
-- Building for: Ninja

........

CMake Warning at C:/msys64/mingw64/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package):
  By not providing "FindQt6GuiTools.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "Qt6GuiTools", but CMake did not find one.
  Could not find a package configuration file provided by "Qt6GuiTools"
  (requested version 6.4.2) with any of the following names:
    Qt6GuiToolsConfig.cmake
    qt6guitools-config.cmake
  Add the installation prefix of "Qt6GuiTools" to CMAKE_PREFIX_PATH or set
  "Qt6GuiTools_DIR" to a directory containing one of the above files.  If
  "Qt6GuiTools" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  Qt/6.4.2/mingw_64/lib/cmake/Qt6WidgetsTools/Qt6WidgetsToolsDependencies.cmake:9 (find_dependency)
  Qt/6.4.2/mingw_64/lib/cmake/Qt6WidgetsTools/Qt6WidgetsToolsConfig.cmake:34 (include)
  Qt/6.4.2/mingw_64/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:62 (find_package)
  Qt/6.4.2/mingw_64/lib/cmake/Qt6Widgets/Qt6WidgetsDependencies.cmake:34 (_qt_internal_find_tool_dependencies)
  Qt/6.4.2/mingw_64/lib/cmake/Qt6Widgets/Qt6WidgetsConfig.cmake:40 (include)
  Qt/6.4.2/mingw_64/lib/cmake/Qt6/Qt6Config.cmake:157 (find_package)
  CMakeLists.txt:536 (find_package)

@pzhlkj6612
Copy link
Contributor

Run find D:/a/antimicrox/antimicrox/Qt/6.4.2/ -iname '*Qt6GuiTools*'
D:/a/antimicrox/antimicrox/Qt/6.4.2/mingw_64/lib/cmake/Qt6GuiTools/Qt6GuiToolsConfig.cmake
...
  Could not find a package configuration file provided by "Qt6GuiTools"
  (requested version 6.4.2) with any of the following names:
    Qt6GuiToolsConfig.cmake
    qt6guitools-config.cmake
  Add the installation prefix of "Qt6GuiTools" to CMAKE_PREFIX_PATH or set
  "Qt6GuiTools_DIR" to a directory containing one of the above files.  If
  "Qt6GuiTools" provides a separate development package or SDK, be sure it
  has been installed.

Look at https://github.com/AntiMicroX/antimicrox/blob/4f053c687b017a84e7eb0fde6226343139472301/.github/workflows/main.yml#L144-L150:

            - name: Configure CMake
              run: |
                find D:/a/antimicrox/antimicrox/Qt/6.4.2/ -iname '*Qt6GuiTools*'
                cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -B "${{ github.workspace }}/build" ${{ matrix.cmake-args }}
              env:
                  CMAKE_PREFIX_PATH: ${{ env.Qt5_Dir }}
                  WORKSPACE_DIR: ${{ github.workspace }}

I think you can try this:

env:
    CMAKE_PREFIX_PATH: ${{ env.Qt6_Dir }}/lib/cmake/Qt6GuiTools

Is there a GuiTools in Qt 5? I don't know.

pktiuk added a commit to AntiMicroX/antimicrox that referenced this issue Oct 23, 2024
@pktiuk
Copy link
Author

pktiuk commented Oct 23, 2024

I think you can try this:

env:
    CMAKE_PREFIX_PATH: ${{ env.Qt6_Dir }}/lib/cmake/Qt6GuiTools

This did not help AntiMicroX/antimicrox@93262c4

Is there a GuiTools in Qt 5? I don't know.

I don't think this should matter at all. The source of the problem seems to lie within MinGW version of QT, because msvc for QT6 works fine.

@pktiuk
Copy link
Author

pktiuk commented Oct 23, 2024

I think I fixed it. AntiMicroX/antimicrox#1066

Proper walue was:

CMAKE_PREFIX_PATH: "${{ env.QT_ROOT_DIR }}/lib/cmake"

@pzhlkj6612
your suggestion helped a lot.
Somehow, only one variant of build was affected by this problem

Great thanks. I wouldn't make it without your comments.

@pktiuk pktiuk closed this as completed Oct 23, 2024
@pzhlkj6612
Copy link
Contributor

@pktiuk,

I think you can try this:

env:
    CMAKE_PREFIX_PATH: ${{ env.Qt6_Dir }}/lib/cmake/Qt6GuiTools

This did not help...

Proper walue was:

CMAKE_PREFIX_PATH: "${{ env.QT_ROOT_DIR }}/lib/cmake"

@pzhlkj6612 your suggestion helped a lot. Somehow, only one variant of build was affected by this problem

Great thanks. I wouldn't make it without your comments.

Good to hear that!

That was my bad. I forgot about what install-qt-action@v4 has changed. There is no Qt5_Dir or Qt6_Dir environment variables any more, but the QT_ROOT_DIR one 1.

Footnotes

  1. https://github.com/jurplel/install-qt-action/blob/08a6bd0b9fa49af9090ec35e68ce61dea976ed9f/README_upgrade_guide.md?plain=1#L12-L17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

2 participants