appveyor / ci

AppVeyor community support repository
https://www.appveyor.com
344 stars 64 forks source link

Qt 6.5.2 ARM 64-bit's qtpaths.bat has hardcoded, possible nonexistent path #3892

Closed hmartinez82 closed 7 months ago

hmartinez82 commented 8 months ago

When crosspiling with Qt ARM 64-bit the CMake scripts need both a Host build of Qt (x64) and a Target build of Qt(ARM64). The builds are correctly generating the ARM64 binaries, but windeployqt is not working, even with passing the custom --qtpaths parameter.

This issue with windeployqt is only happening with the ARM 64-bit version of Qt. x64 is not affected.

Defect:

qmake and qpaths, in the \bin folder of the ARM 64-bit build of Qt are actually .bat files that use the x64 qmake.exe/qtpaths.exe binaries but with a custom .conf file. The issue, I think is that these .bat files are hardcoded to some folder I can't confirm exist nor match the host version of Qt. So:

Content of C:\Qt\6.5.2\msvc2019_arm64\bin\qtpaths.bat Expected (it should use a Qt matching version of a host build .exe)

@echo off
C:\Qt\6.5.2\msvc2019_64\bin\qtpaths6.exe -qtconf "%~dp0\target_qt.conf" %*

Actual

@echo off
\Users\qt\work\install\bin\qtpaths6.exe -qtconf "%~dp0\target_qt.conf" %*

Please make sure that qmake.bat, qmake6.bat, qtpaths.bat and qtpaths6.bat have correct paths.

hmartinez82 commented 8 months ago

I don't like that Qt doesn't have a more flexible solution for this that doesn't require manually patching those files. But in my previous experiences when building Qt 6 for x-compiling I always had to manually modify those four .bat files every time I moved the Host build around.

OwenMcDonnell commented 8 months ago

Are you thinking that qmake.bat should point to the path of the x64 qmake.exe, whereas qmake6.bat should point to the qmake6.exe, and similar for qtpaths/6.bat? I want to get the patch right on the next image update.

hmartinez82 commented 8 months ago

That will work, but canonically (given a local build I have), the mapping is: qmake.bat -> qmake6.exe qmake6.bat -> qmake6.exe qtpaths.bat -> qtpaths6.exe qtpaths6.bat -> qtpaths6.exe

You can also look at the existing .bat files. My ask is not to mess with the mapping. It is to just fix the path to the files. I mean this part: \Users\qt\work\install\bin\ is wrong in all .bat files

Whatever they use at the host executable can stay the same.

OwenMcDonnell commented 8 months ago

Got it, thanks for clarifying. I'll just redirect the paths to the executables as they are. The new image will be along in a few days, at which point, if it works, let me know so i can close this issue. Note that upcoming image will have Qt 6.5.3 not 6.5.2.

OwenMcDonnell commented 8 months ago

Please let me know if/when this issue is resolved.

hmartinez82 commented 8 months ago

@OwenMcDonnell you mean I can try again? I kept looking at https://www.appveyor.com/docs/windows-images-software/#qt and it still says 6.5.2

OwenMcDonnell commented 8 months ago

The deployed image is preceding the documentation this time, since we're deploying both VS2022 and VS2019 images this time. So, yes please give it a try.

hmartinez82 commented 8 months ago

@OwenMcDonnell What is the patht to this Qt 6.5.3? I tried C:/Qt/6.5.3/msvc2019_arm64/bin/qmake.bat but it says it's not found

I tried APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 with C:/Qt/6.5.3/msvc2022_arm64/bin/qmake.bat . Also not found.

OwenMcDonnell commented 8 months ago

Visual Studio 2022 image has not been updated yet. On Visual studio 2019 image you should find C:/Qt/6.5.3/msvc2019_arm64/bin/qmake.bat

hmartinez82 commented 8 months ago

I can confirm it fixed the issue. Let me know once the Visual Studio 2022 runner has this fixed Qt 6.5.3

OwenMcDonnell commented 7 months ago

The Visual Studio 2022 image has now been updated as well.

hmartinez82 commented 7 months ago

Awesome, closing this.