Hi Dmitry,

On Wed August 7 2019 11:27:00 Dmitry Shachnev wrote:
> I agree with Lisandro that for many people it will be enough to just run
> the examples, not (re-)compile them.

The Qt examples are not like glxgears.  They are fundamentally
different.  They are not to demonstrate how pretty Qt looks or how
fast it runs.

If their purpose was to demonstrate how pretty Qt looks there might
be a dozen examples, not hundreds of examples covering every aspect
of Qt programming.

If their purpose was to demonstrate how pretty Qt looks there would
not be source files and header files and project files and images
and resources and every thing else needed to build ... except the
dependencies.

If someone wants to see Qt in action they can login to KDE.

Qt is a tool for programmers.  Qt examples are for programmers to
build.  When they don't build they are broken.


Lisandro wrote:
> Tell upstream that. It's the Qt build system that does exactly that:
> provide compiled binaries.

The orig.tar.xz do not include the precompiled binaries.  Of course
debuild can build the binaries with all the necessary dependencies
installed, but it was Debian's decision to ship precompiled binaries
in the Debian examples packages.  That was not Qt's decision.  And
it was Debian's decision to ship the examples without the dependencies
so they won't build for programmers even though they build for debuild.
That is unkind!

But just as an aside let's pretend for a moment that Lisandro is
correct.  Let's try running one of the precompiled binaries.  Go
ahead on a clean system and install qtwebview5-examples which is
the package I just finished testing.  Then:

$ /usr/lib/x86_64-linux-gnu/qt5/examples/webview/minibrowser/minibrowser
QQmlApplicationEngine failed to load component
qrc:/main.qml:53 module "QtWebView" is not installed

Sadly I don't have the time to file reports on all these examples
runtime bugs.  My goal is in a couple of weeks to document the
problems preventing Qt examples from building, together with fixes
that Qt programmers can use to work around the problems and that
future DDs can use to fix the problems.


> So we should not add these 
> dependencies, at most we can add some of these packages to Suggests.

The necessary packages are not essential so they must be dependencies.
That is the way Debian works.  These packages are fundamentally broken
without qt5-default and c++-compiler and make and an eclectic mix of
auxiliary packages.

Programmers should be able to install the examples packages and have
them compile without hunting for missing dependencies.  That's the
whole point of using a distro.  Nobody is going to install the examples
unless they want to compile them.

They is no joy in staring at an example widget that does nothing unless
you actually intend to build upon it in your own programming.  Or go
ahead and run
/usr/lib/x86_64-linux-gnu/qt5/examples/corelib/threads/waitconditions/waitconditions
and tell me what you learned from merely running it.


> But see below:
>
> On Mon, Aug 05, 2019 at 06:53:52AM -0700, Mike Bird wrote:
> > A directory of files and several dependencies are missing from
> > qtbase5-examples.  Here is how to fix it.
> >
> > (1) In the source package, file "examples/vulkan/vulkan.pro", at the
> >     end add a blank line and then a line containing only
> >     "EXAMPLE_FILES = shared" (without the quotes).  The resut will
> >     end up looking like the tail of file "cat
> > examples/network/network.pro".
>
> This sounds like an upstream issue. Please file a bug on bugreports.qt.io
> or directly submit the patch to codereview.qt-project.org, explaining why
> this change is needed

With all the various "rm -rf" in debian/rules I would not feel comfortable
filing bugs upstream against Debian Qt packages.


>  (you did not explain your problem here).

Without the "shared" directory, a lot of the examples cannot compile.


> > (2) Add the following miscellaneous dependencies:
> >       qt5-default c++-compiler make qtbase5-private-dev libqt5opengl5-dev
>
> As Lisandro explained, nothing should really depend on qt5-default.
>
> In fact, Lintian even has a warning for this:
> https://wiki.debian.org/Lintian/Tags/depends-on-metapackage

The lintian warning has two aspects.  Debian internally should be exporting
QT_SELECT=qt5 in debian/rules.  That is correct and Debian does.

But the lintian warning also assumes that qt5-default is a metapackage
which if depended upon restricts users ability to uninstall stuff.  But
qt5-default depends only on qtbase5-dev and qtchooser.  Yet qtbase5-dev
depends on qtchooser, and qtchooser is not much use without qtbase5-dev or
qtbase4-dev, so the lintian warning is inappropriate and should be
removed or at least overridden for Qt5 examples.

Without qt5-default the examples break with:

$ qmake /usr/lib/x86_64-linux-gnu/qt5/examples/webview/webview.pro
qmake: could not find a Qt installation of ''

Not very helpful and when you Google it you'll be told to install qt5-default,
which is what should have been brought in as a dependency by the distro.


> And I think people who really need to *compile* examples will have g++ and
> qmake/make installed. If they are missing it is quite easy to figure out
> how to install them.

That's not how dependencies work in Debian.  If you want to make g++ essential
we can have that conversation but some people might prefer clang.  Meanwhile
anyone who wants to use Qt examples as they were intended - which is to help
with programming and not for staring at widgets which don't do anything - is
going to need the dependencies I have listed.

The fixes are simple.  Someone could have fixed them in the time we've been
discussing this.  What takes time is figuring out what is wrong.  And it
makes no sense that every single Qt programmer should have to go through that
process.


AND NOW FOR THE IMPORTANT PART ...

I'm not asking you to fix these bugs.  I'm not asking Lisandro to fix these
bugs.  I recognize that Debian is a do-ocracy.

I'm asking you to re-open this bug and to leave the other related bugs open.

I'm putting a lot of work into identifying the problems and workarounds.  This
information is valuable to future DDs who might want to fix these bugs.  And
this information is valuable to Qt programmers using Debian who wonder why the
examples are broken.

When configured correctly the examples build directly from qtcreator, or from
the command line somewhat as follows:

  mkdir foo && cd foo && qmake /usr/lib/.../foo.pro && make

That is how the Qt examples are meant to work.  There is no reason why every
single Qt programmer should have to spend two weeks figuring out the
workarounds when they can be kept here in readily accessible form in open
bug reports until some DD decides he or she wants to fix the problems.

Thank you for reading this far.  Please re-open this bug and leave the related
bugs open to provide information for Qt programmers and future DDs.

--Mike

Reply via email to