PDA

View Full Version : qmake fails processing many many sources in one .pri



Pieter from Belgium
15th October 2009, 16:49
On Fedora 9, Qt 4.5.2's qmake seems not to like including a very large .pri file with very many SOURCES/HEADERS. After including it, stange behaviour appears. In particular the system() calls no longer get executed.

Contents of files.pri (cut):



# ==================================================
# This file has been automatically generated.
# Please do not edit.
# ==================================================
GEN_HEADERS += path_to\src\generated\headerx.h
GEN_SOURCES += path_to\src\generated\sourcex.cpp
...
[620 headers + 620 sources]

HEADERS += $$GEN_HEADERS
SOURCES += $$GEN_SOURCES
QMAKE_CLEAN += $$GEN_HEADERS
QMAKE_CLEAN += $$GEN_SOURCES
QMAKE_DISTCLEAN +=path_to\src\generated\files.pri


On Windows, and on Fedora 10 and 11, this still works.

However, I wonder whether they just have a larger limit, or if they have no (practical) limit?

wysota
18th October 2009, 16:28
Are you sure this is caused by QMake?

Pieter from Belgium
19th October 2009, 06:35
Yes, I am quite convinced.

The other .pro files are more or less as follows.

Main .pro file:


# set some variables configuring the file format for which an API must be generated
include(../format.pri)


Generic format.pri file:


# among others, call code generation python script,
# generating a zillion of classes, and a files.pri file listing those classes
# as indicated in original post

include ($${CGOUTPUTDIR}/files.pri)

# system(...) calls below fail if files.pri too large

system(...)


Further experiments showed that it seems to be the size of the file or of the variable contents that causes this problem. Reducing the path length (but keeping the same number of sources) resolves the issue.

However, the number of files generated will still increase in near future, so it is important for me to known whether there is a (practical) limit in later Fedora versions/other versions of Qt.

wysota
19th October 2009, 07:40
But how do you know it is not somehow related to Fedora and not QMake? You said yourself later versions of Fedora do not suffer from this issue.

Pieter from Belgium
21st October 2009, 08:54
Correction, let's say that it is an issue with qmake running on Fedora 9. It may thus indeed be Fedora. I currently have no clue where it lies.

Let me rephrase my question:

Is the failure I observe specific for qmake on Fedora 9, or is there inherently a limit (though larger on other platforms) in the number of sources I can use in this setup.

Of course, there always is a limit, but I am wondering if this limit is significant, or extremely large...

If the limit is significant, I will probably run onto it also when migrating to a later Fedora, and would have to refactor my code generation.