Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
5.14, 5.15.5, 6.2.0 Beta3
-
None
-
macOS 10.14
-
-
224a60989ed95e8b91ac88a12666af6e5a66e619 (qt/qtbase/5.12)
Description
The path structure for reproducing is important, thus my steps to reproduce will mention my structure.
Steps to reproduce:
1)make dir and cd /Volumes/T3/Dev/qt/qt5_cmake/examples/bla
2) call qmake on an example /Volumes/T3/Dev/qt/qt5_cmake/qtbase/examples/corelib/threads/mandelbrot/mandelbrot.pro
3) Observe the following message and path:
Info: creating stash file /Volumes/T3/Dev/.qmake.stash
The .qmake.stash file is created a couple of levels higher in the file system, instead of the build dir of the example.
The culprit code is in
bool QMakeEvaluator::prepareProject(const QString &inDir)
/Volumes/T3/Dev/qt/qt514_source/qtbase/qmake/library/qmakeevaluator.cpp:1107
bool QMakeEvaluator::prepareProject(const QString &inDir) { // .. forever { conffile = sdir + QLatin1String("/.qmake.conf"); if (!m_vfs->exists(conffile, flags)) conffile.clear(); cachefile = dir + QLatin1String("/.qmake.cache"); if (!m_vfs->exists(cachefile, flags)) cachefile.clear(); if (!conffile.isEmpty() || !cachefile.isEmpty()) { if (dir != sdir) m_sourceRoot = sdir; m_buildRoot = dir; break; } if (dir == superdir) goto no_cache; QFileInfo qsdfi(sdir); QFileInfo qdfi(dir); if (qsdfi.isRoot() || qdfi.isRoot()) goto no_cache; sdir = qsdfi.path(); dir = qdfi.path(); } // ..
the forever loop assumes that both the source and build dir would be at the same file system level, so when searching for a ".qmake.conf" file, sdir goes one level up in lock step with dir (build dir).
In my particular case, the .qmake.conf is found a few levels higher in /Volumes/T3/Dev/qt/qt5_cmake/qtbase/ while navigating up from mandelbrot.pro.
The same amount of ".."s are added to the build dir, resulting in going from /Volumes/T3/Dev/qt/qt5_cmake/examples/bla
to
/Volumes/T3/Dev
I think the proper solution is to extract the forever loop into two loops, so that there is no assumption that the .qmake.conf file and the .qmake.cache file are at the same level.
Attachments
Issue Links
- is duplicated by
-
QTBUG-93661 qmake tries to create cache file in root directory
- Closed
-
QTBUG-79325 Can't build in C:\dev\temp, C:\dev\tmp, C:\temp\dev, etc.
- Closed
- relates to
-
QTBUG-73222 Don't look for .qmake.stash outside build and source directories
- Reported
-
QTBUG-92271 Remove .qmake.conf files from Qt repos
- Closed
- resulted in
-
QTBUG-76907 Calling "make" a 2nd time in a Qt top-level build triggers a rebuild
- Closed