[Development] Failed to run configure.bat in qt/qt5 repository on Windows?

Cristian Adam cristian.adam at qt.io
Sat Aug 19 12:35:14 CEST 2023


Hi,

This time you encountered a different problem on Windows, the long path issue 😅

You have used Qt 6.3, which suffers from this bug [QTBUG-109207] moc can't create output file when path is longer than 255 characters - Qt Bug Tracker<https://bugreports.qt.io/browse/QTBUG-109207> which got fixed in Qt 6.5.0.

For MinGW we have a wiki page MinGW - Qt Wiki<https://wiki.qt.io/MinGW> which states which toolchain / version of the compiler we use.

The good news with "choco" is that they now use the same MinGW binary source as we do, but they picked a newer version which has a bug<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106395> that affects Qt. See their Chocolatey Software | MinGW-w64 12.2.0.03042023<https://community.chocolatey.org/packages/mingw> for details.

If you are going to do a Qt MinGW build don't forget to pass -DCMAKE_IGNORE_PREFIX_PATH=C:/strawberry/c

But, as Thiago mentioned, you can compile LLVM yourself.

I gave it a try, built LLVM 17.0.0 (rc2) and Qt 6.5.2 with MinGW 11.2.0 (not from choco).
Here is my cmd file that I've used to build LLVM:

@echo off

cmake -S repo/llvm ^
  -B build-mingw ^
  -G Ninja ^
  -D CMAKE_IGNORE_PREFIX_PATH=c:/Strawberry/c ^
  -D CMAKE_BUILD_TYPE=Release ^
  -D LLVM_ENABLE_PROJECTS=clang ^
  -D LLVM_TARGETS_TO_BUILD=X86 ^
  -D LIBCLANG_BUILD_STATIC=ON

cmake --build build-mingw
cmake --install build-mingw --prefix install-mingw

and here is my Qt build cmd file:

@echo off

..\repo\configure ^
  -release ^
  -nomake examples ^
  -nomake tests ^
  -submodules qtbase,qt5compat,qtsvg,qtimageformats,qtshadertools,qtdeclarative,qttools,qtquicktimeline,qtquick3d,qtserialport ^
  -prefix c:/qt/6.5.2/my_mingw_64 ^
  -- -D CMAKE_IGNORE_PREFIX_PATH=c:/Strawberry/c -D CMAKE_PREFIX_PATH=c:/Projects/llvm-project/install-mingw

I've also attached my Qt configuration log file.

It all built fine, no errors.

Cheers,
Cristian.


________________________________
From: Haowei Hsu <hwhsu1231 at gmail.com>
Sent: Saturday, August 19, 2023 08:07
To: Cristian Adam <cristian.adam at qt.io>
Cc: Qt development mailing list <development at qt-project.org>
Subject: Re: [Development] Failed to run configure.bat in qt/qt5 repository on Windows?

Hello, Cristian.
This time, I tried to build the Qt Documentation with the MinGW compiler installed by
Chocolatey. And I replace the MSVC-based libclang with the MinGW-based libclang,
downloaded from: https://download.qt.io/development_releases/prebuilt/libclang/qt/

Chocolatey Install command: gsudo choco install mingw

[image.png]
[image.png]

However, there's another new error occurred:

[image.png]

What happened?

The following commands are what I run:

  1.  chdir /d D:\Repo\GitHub\testing\qt-docs\qt
  2.  git status
  3.  where gcc
  4.  gcc --version
  5.  mkdir build\mingw && chdir build\mingw
  6.  ..\..\configure.bat -developer-build -skip qtpositioning -- -DCMAKE_PREFIX_PATH="C:/Program Files/libclang"
  7.  cmake --build . --target docs --parallel 4

You can see the attachment with the full log: log-failed-to-build-docs-using-choco-mingw.txt
---
Haowei Hsu

Cristian Adam <cristian.adam at qt.io<mailto:cristian.adam at qt.io>> 於 2023年8月18日 週五 下午10:16寫道:
Hi,

Right, you've hit now [QTBUG-108391] Prebuilt clang packages provided by Qt contains hardcoded library path - Qt Bug Tracker<https://bugreports.qt.io/browse/QTBUG-108391>

I have a workaround there.

As it turns out we haven't managed to make a new Qt LLVM release with the change suggested in the bugreport. 🙁

This is again a MSVC thing, a MinGW build wouldn't have the DIA SDK and won't have the issue in the first place.

Cheers,
Cristian.
________________________________
From: Haowei Hsu <hwhsu1231 at gmail.com<mailto:hwhsu1231 at gmail.com>>
Sent: Friday, August 18, 2023 15:46
To: Cristian Adam <cristian.adam at qt.io<mailto:cristian.adam at qt.io>>
Cc: Qt development mailing list <development at qt-project.org<mailto:development at qt-project.org>>
Subject: Re: [Development] Failed to run configure.bat in qt/qt5 repository on Windows?

Hello, Cristian.

After adding -DCMAKE_BUILD_TYPE=Release to configure.bat and change the value of
CMAKE_PREFIX_PATH to "C:/Program Files/libclang", the warning message of not being
able to find libclang disappears. However, when I try to build docs target, a new error message
shows up:

ninja: error: 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/DIA SDK/lib/amd64/diaguids.lib',
needed by 'qtbase/bin/qdoc.exe', missing and no known rule to make it

[image.png]

I noticed that it is trying to find diaguids.lib in Professional edition of VS2019. However, the
vcvarsall.bat I use to initialize the environment is Community edition.

[image.png]
[image.png]

What happened?

The following commands are what I run:

  1.  git status
  2.  mkdir build && chdir build
  3.  vcvarsall.bat x64
  4.  ..\configure.bat -developer-build -skip qtpositioning -- -DCMAKE_PREFIX_PATH="C:/Program Files/libclang" -DCMAKE_BUILD_TYPE=Release
  5.  cmake --build . --target docs
  6.  where vcvarsall.bat
  7.  where cl

You can see the attachment with the full log: log-failed-to-locate-community-diaguids-lib.txt
---
Haowei Hsu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20230819/e05528c6/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 10770 bytes
Desc: image.png
URL: <http://lists.qt-project.org/pipermail/development/attachments/20230819/e05528c6/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 27499 bytes
Desc: image.png
URL: <http://lists.qt-project.org/pipermail/development/attachments/20230819/e05528c6/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 20187 bytes
Desc: image.png
URL: <http://lists.qt-project.org/pipermail/development/attachments/20230819/e05528c6/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 245202 bytes
Desc: image.png
URL: <http://lists.qt-project.org/pipermail/development/attachments/20230819/e05528c6/attachment-0009.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 38187 bytes
Desc: image.png
URL: <http://lists.qt-project.org/pipermail/development/attachments/20230819/e05528c6/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 128557 bytes
Desc: image.png
URL: <http://lists.qt-project.org/pipermail/development/attachments/20230819/e05528c6/attachment-0011.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: conf-mingw.log
Type: application/octet-stream
Size: 14454 bytes
Desc: conf-mingw.log
URL: <http://lists.qt-project.org/pipermail/development/attachments/20230819/e05528c6/attachment-0001.obj>


More information about the Development mailing list