[Interest] QFileInfo not working inside non privileged docker container

Manner Róbert rmanni at gmail.com
Fri Feb 16 18:02:42 CET 2018


Hi,

I always tend to give up before finding the solution :)
Just in case someone is in similar shoes, this seems to fix qmake:

diff --git a/src/corelib/global/qconfig-bootstrapped.h
b/src/corelib/global/qconfig-bootstrapped.h
index dabb7156..2ecd8680 100644
--- a/src/corelib/global/qconfig-bootstrapped.h
+++ b/src/corelib/global/qconfig-bootstrapped.h
@@ -97,7 +97,7 @@
 #define QT_FEATURE_renameat2 -1
 #define QT_FEATURE_sharedmemory -1
 #define QT_FEATURE_slog2 -1
-#define QT_FEATURE_statx -1
+#define QT_FEATURE_statx 1
 #define QT_FEATURE_syslog -1
 #define QT_NO_SYSTEMLOCALE
 #define QT_FEATURE_systemsemaphore -1

Br,

Robert


On Fri, Feb 16, 2018 at 5:00 PM, Manner Róbert <rmanni at gmail.com> wrote:

> Hi,
>
> We have an issue at our company where Qt gets crosscompiled inside a
> docker. Suddenly it stopped building after trying to upgrade to Qt 5.10.0
> (5.9.2 worked for sure). It fails at the last step of configure: running
> qmake with a dummy qt.conf to generate the makefile. Same build goes fine
> outside of docker.
>
> I have tracked down the issue until that the root cause seems to be that
> QFileInfo is not working, it is not giving back any meaningful data for
> files or directories.
>
> I have created an example to demonstrate the problem: it runs fine outside
> docker (on a real host) or inside docker in privileged mode. But without
> privileged mode (which is not possible during a docker image build), it
> does not work.
>
> ----------------------------------- EXAMPLE STARTS
> #include <QFileInfo>
> #include <QDebug>
>
> int main (int argc, char* argv[])
> {
>     Q_UNUSED(argc);
>     Q_UNUSED(argv);
>     QFileInfo fi(__FILE__);
>     qDebug() << "Filesize:" << fi.size() << "Is file?" << fi.isFile() <<
> "Exists?" << fi.exists();
>     // Output is: Filesize: 0 Is file? false Exists? false
>
>     QFileInfo di(".");
>     qDebug() << "Is directory?" << di.isDir() << "Is file?" << di.isFile()
> << "Exists?" << di.exists();
>     // Output is: Is directory? false Is file? false Exists? false
>
>     return 0;
> }
> ------------------------------------- EXAMPLE ENDS
>
> (The host and guest is a pretty recent archlinux with qt 5.10.)
>
> Do you have any idea what happened with QFileInfo between 5.9 and 5.10
> which could cause such problem? Any idea what I should patch out?
>
> Thanks in advance,
>
> Robert
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180216/94de4b34/attachment.html>


More information about the Interest mailing list