Details
-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
-
e7e593b2f (13.0)
Description
Summary
The core issue faced by users is this: By default, Qt Design Studio generated projects end up with extremely long paths (with many many levels of nesting) in the build folder – far longer/deeper than typical project structures. Thus, it's easy to run into Windows path length limits.
Unfortunately, it is not easy to identify the root cause of the build error from the error log:
- The "Compile Output" shows error messages that are very cryptic and look unrelated to path lenghts. For example:
- D:\Development\QtSupport\00483290\build-TestProject-Desktop_Qt_6_5_1_MSVC2019_64bit-Debug_deps\ds-build\src\imports\tools\eventsimulator\QuickStudioEventSimulatorplugin_QtQuick_Studio_EventSimulatorPlugin.cpp : fatal error C1083: Cannot open compiler generated file: '': Invalid argument
- D:\001_AdminLOI\002_QT\004_SerialPort\build-SerialPort-Desktop_Qt_6_5_1_MinGW_64_bit-Debug_deps\ds-build\src\imports\tools\eventsimulator\QuickStudioEventSimulatorplugin_autogen\include\QuickStudioEventSimulatorplugin_QtQuick_Studio_EventSimulatorPlugin.moc:174: error: opening dependency file _deps\ds-build\src\imports\tools\eventsimulator\CMakeFiles\QuickStudioEventSimulatorplugin.dir\QuickStudioEventSimulatorplugin_QtQuick_Studio_EventSimulatorPlugin.cpp.obj.d: No such file or directory
- The clearer explanation is buried deep inside Qt Creator's "General Messages" pane, which is easily missed:
- The object file directory ABC has 190 characters. The maximum full path to an object file is 250 characters (see CMAKE_OBJECT_PATH_MAX). Object file XYZ cannot be safely placed under this directory. The build may not work correctly.
Some suggestions of ways we can help:
- Support ways to let the build system to generate shorter file/folder names
- Make the build system provide more obvious guidance to the user when this issue is encountered
- Restructure the Qt Design Studio Components repository to make it shallower (QDS-10160)
- Add the Qt Design Studio Components to the official installer, like any other module
Original Report
I have created a QT quick qml project (6.4), the Cmake was chosen. After build, I got this error:
"D:\001_AdminLOI\002_QT\004_SerialPort\build-SerialPort-Desktop_Qt_6_5_1_MinGW_64_bit-Debug_deps\ds-build\src\imports\tools\eventsimulator\QuickStudioEventSimulatorplugin_autogen\include\QuickStudioEventSimulatorplugin_QtQuick_Studio_EventSimulatorPlugin.moc:174: error: opening dependency file _deps\ds-build\src\imports\tools\eventsimulator\CMakeFiles\QuickStudioEventSimulatorplugin.dir\QuickStudioEventSimulatorplugin_QtQuick_Studio_EventSimulatorPlugin.cpp.obj.d: No such file or directory
In file included from C:/Qt/6.5.1/mingw_64/include/QtCore/qglobal.h:34,
from C:/Qt/6.5.1/mingw_64/include/QtCore/qnamespace.h:12,
from C:/Qt/6.5.1/mingw_64/include/QtCore/qobjectdefs.h:12,
from C:/Qt/6.5.1/mingw_64/include/QtCore/qobject.h:10,
from C:/Qt/6.5.1/mingw_64/include/QtCore/qplugin.h:12,
from C:/Qt/6.5.1/mingw_64/include/QtQml/qqmlextensionplugin.h:7,
from D:/001_AdminLOI/002_QT/004_SerialPort/build-SerialPort-Desktop_Qt_6_5_1_MinGW_64_bit-Debug/_deps/ds-build/src/imports/tools/eventsimulator/QuickStudioEventSimulatorplugin_QtQuick_Studio_EventSimulatorPlugin.cpp:3:
D:/001_AdminLOI/002_QT/004_SerialPort/build-SerialPort-Desktop_Qt_6_5_1_MinGW_64_bit-Debug/_deps/ds-build/src/imports/tools/eventsimulator/QuickStudioEventSimulatorplugin_autogen/include/QuickStudioEventSimulatorplugin_QtQuick_Studio_EventSimulatorPlugin.moc:174:1: fatal error: opening dependency file _deps\ds-build\src\imports\tools\eventsimulator\CMakeFiles\QuickStudioEventSimulatorplugin.dir\QuickStudioEventSimulatorplugin_QtQuick_Studio_EventSimulatorPlugin.cpp.obj.d: No such file or directory
174 | QT_WARNING_POP
| ^~~~~~~~~~~~~~"
The problem is that the full path is very long, in this case, the QT generated a project with many chiuld folders that cause the path is very long, as seen in the above log: _deps\ds-build\src\imports\tools\eventsimulator\CMakeFiles\QuickStudioEventSimulatorplugin.dir\QuickStudioEventSimulatorplugin_QtQuick_Studio_EventSimulatorPlugin.cpp.obj.d
This path takes 172 chars, while Cmake allow maximum 260 chars.
Can QT team restructure/refactor the generated folders? Currently, users only have 260-172 = 88 chars left to be used.
I have enabled Window Long path already, so I think the 260 chars limitation comes from Cmake.
Attachments
Issue Links
- depends on
-
QTBUG-107516 Migrate from GCC MinGW to LLVM-MinGW
- Closed
- is duplicated by
-
QTBUG-120219 Builds on Windows with Long Filenames Fail
- Closed
-
QTCREATORBUG-29957 QML Design Studio Broken - Fresh Project
- Closed
-
QTBUG-129297 [Boot2Qt][Windows] 'QQuickWidget - QQuickView Comparison Example' could not be built on Windows
- Closed
- relates to
-
QTCREATORBUG-26786 Compilation of indexedcontainerproxyconstiterator fails on Windows (command line length)
- Closed
-
QTBUG-127100 File name too long cause compilation failure
- Reported
-
QTBUG-98345 Qt QML compiler resource object files install location is hardcoded
- Reported
-
QDS-12509 Building DS project fails
- Closed
-
QTBUG-117628 Shorten generated file names in the qmlcompiler
- Open
- replaces
-
QDS-10160 Qt Design Studio Components: Help users manage long build folder paths
- Reported