[Interest] QFileInfo not working inside non privileged docker container
Manner RĂ³bert
rmanni at gmail.com
Fri Feb 16 17:00:20 CET 2018
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/ec877952/attachment.html>
More information about the Interest
mailing list