1

A very simple Qt project fails to build for me with Qt 5.10 in a Docker container (with an image derived from opensuse:tumbleweed). The project is as follows:

sh-4.4# cat test.pro
TEMPLATE = app
TARGET = test
INCLUDEPATH += .
INCLUDEPATH += sub
HEADERS = obj.h sub/iface.h
SOURCES = obj.cpp main.cpp

sh-4.4# cat sub/iface.h
#pragma once

#include <QtPlugin>

class Interface
{
public:
        virtual ~Interface () {}
};

Q_DECLARE_INTERFACE (Interface, "org.meh.interface/1.0")

sh-4.4# cat obj.h
#pragma once

#include <QObject>
#include <sub/iface.h>

class Obj : public QObject
{
        Q_OBJECT
        Q_INTERFACES (Interface)
};

sh-4.4# cat obj.cpp
#include "obj.h"

sh-4.4# cat main.cpp
int main() {}

In this case moc complains as follows:

obj.h:9: Error: Undefined interface

Everything is fine in another container with Qt 5.9, and everything is also fine with Qt 5.10 when the project is built in openSUSE Build Service (which uses something else instead of Docker). Some quick googling did not reveal any relevant bugreports for recent Qt versions.

What could be wrong?

0xd34df00d
  • 1,496
  • 1
  • 8
  • 17

2 Answers2

0

Running moc under strace shows Operation not permitted on various statx calls, which sheds some light on why exactly it fails (also, related to this question). This pull request is hopefully going to fix this.

0xd34df00d
  • 1,496
  • 1
  • 8
  • 17
0

Did you try to run the container with the --privileged (see Which capabilities are needed for statx to stop giving EPERM)?

Mahnu
  • 71
  • 5