Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Qt5 configuration tuning #12467

Closed
zackw opened this issue Aug 18, 2014 · 0 comments
Closed

Qt5 configuration tuning #12467

zackw opened this issue Aug 18, 2014 · 0 comments

Comments

@zackw
Copy link
Contributor

zackw commented Aug 18, 2014

I've done some tuning on the configuration for the bundled copy of QtBase and QtWebkit. Highlights include:

  • More unnecessary features disabled
  • QtWebkit now correctly configured to use QtBase's bundled copy of sqlite, instead of falling back to the system copy (and blowing up if there is no system copy with headers available).
  • Move the Qt version check from main.cpp to phantomjs.pro so the build will bomb out quicker if the check fails
  • src/qt/preconfig.sh now just configures Qt, it does not build it; build.sh is responsible for all building. (This makes it easier to test tweaks to the Qt configuration.)
  • New build.sh options --system-qtdeps, --system-qt, and --system-qtwebkit allow experimental use of (more) system libraries. -qtdeps selects system sqlite, fontconfig, freetype, harfbuzz, libjpeg, libpng, and zlib. -qt skips the QtBase build altogether and uses a system version (and, therefore, its system-supplied dependencies); -qtwebkit goes even further and uses system QtWebkit (and therefore QtBase and deps). The latter two do not compile successfully at present, but they will be useful for people who want to make that mode work (by upstreaming all the remaining modifications to qt/qtwebkit).
  • Qt does not include a bundled copy of Fontconfig. The system fontconfig, if used, will pull in the system freetype and several other libraries (notably libpng). Therefore, disable fontconfig unless --system-qtdeps is used.

I'm open to discussion on all of the above changes, but I think they are all net positives.

For your interest, below is a dependency graph of phantomjs from a --system-qtdeps build.

pjs-deps

zackw added a commit to zackw/phantomjs that referenced this issue Aug 18, 2014
 * Ignore src/phantomjs_plugin_import.cpp, which is now created during
   the build.
 * Add leading slashes to a bunch of files that should not be ignored if
   they crop up in subdirectories.

Part of issue ariya#12467.
zackw added a commit to zackw/phantomjs that referenced this issue Aug 18, 2014
 * Allow any patchlevel of Qt 5.3.x.
 * Do it in the master .pro file instead of main.cpp; this makes the build
   fail immediately rather than after compiling a bunch of stuff.

Part of issue ariya#12467.
zackw added a commit to zackw/phantomjs that referenced this issue Aug 18, 2014
Invoking build.sh with --system-qtwebkit will skip the build of Qt and
QtWebkit and use the qmake in $PATH to build PhantomJS proper.

This doesn't actually *work* at the moment because the bundled
copy of Webkit has patches not yet merged upstream, but it's still
useful to have for testing purposes.

Part of issue ariya#12467.
zackw added a commit to zackw/phantomjs that referenced this issue Aug 18, 2014
 * build.sh now handles building qt and qtwebkit.
 * preconfig.sh is now only responsible for accumulating arguments
   to pass to qt's configure script.
 * preconfig.sh doesn't have command line arguments of its own;
   anything on its command line will be passed directly to qt's
   configure script.
 * first pass of adjustments to the qt configure parameters
   to try to get a more static build - unfortunately, system
   sqlite, libz, libpng, and libexpat are still getting pulled
   in somehow (mostly via fontconfig, I think).

Part of issue ariya#12467.
zackw added a commit to zackw/phantomjs that referenced this issue Aug 18, 2014
As with the system-qtwebkit option, this does not actually work at this
point, but it enables experimentation toward getting it to work.

Part of issue ariya#12467.
zackw added a commit to zackw/phantomjs that referenced this issue Aug 18, 2014
This is how we arrange for QtWebkit to use QtBase's bundled copy of
sqlite; without it, QtWebkit will attempt to use a system-provided
library instead, and if headers are unavailable, the build will fail.

Part of issue ariya#12467.
zackw added a commit to zackw/phantomjs that referenced this issue Aug 18, 2014
In this mode, system-provided libraries will be used for all of
Qt's dependencies, but Qt and QtWebkit themselves are still the
bundled copies.  This mode actually works.

Now that this mode exists, disable fontconfig in the "everything
bundled" mode, because it drags in the system freetype and several
other system libraries.  (There is no bundled fontconfig.)

Part of issue ariya#12467.
zackw added a commit to zackw/phantomjs that referenced this issue Aug 18, 2014
ariya pushed a commit that referenced this issue Aug 19, 2014
 * Ignore src/phantomjs_plugin_import.cpp, which is now created during
   the build.
 * Add leading slashes to a bunch of files that should not be ignored if
   they crop up in subdirectories.

Part of issue #12467.
ariya pushed a commit that referenced this issue Aug 19, 2014
 * Allow any patchlevel of Qt 5.3.x.
 * Do it in the master .pro file instead of main.cpp; this makes the build
   fail immediately rather than after compiling a bunch of stuff.

Part of issue #12467.
ariya pushed a commit that referenced this issue Aug 19, 2014
Invoking build.sh with --system-qtwebkit will skip the build of Qt and
QtWebkit and use the qmake in $PATH to build PhantomJS proper.

This doesn't actually *work* at the moment because the bundled
copy of Webkit has patches not yet merged upstream, but it's still
useful to have for testing purposes.

Part of issue #12467.
ariya pushed a commit that referenced this issue Aug 19, 2014
 * build.sh now handles building qt and qtwebkit.
 * preconfig.sh is now only responsible for accumulating arguments
   to pass to qt's configure script.
 * preconfig.sh doesn't have command line arguments of its own;
   anything on its command line will be passed directly to qt's
   configure script.
 * first pass of adjustments to the qt configure parameters
   to try to get a more static build - unfortunately, system
   sqlite, libz, libpng, and libexpat are still getting pulled
   in somehow (mostly via fontconfig, I think).

Part of issue #12467.
ariya pushed a commit that referenced this issue Aug 19, 2014
As with the system-qtwebkit option, this does not actually work at this
point, but it enables experimentation toward getting it to work.

Part of issue #12467.
ariya pushed a commit that referenced this issue Aug 19, 2014
This is how we arrange for QtWebkit to use QtBase's bundled copy of
sqlite; without it, QtWebkit will attempt to use a system-provided
library instead, and if headers are unavailable, the build will fail.

Part of issue #12467.
ariya pushed a commit that referenced this issue Aug 19, 2014
In this mode, system-provided libraries will be used for all of
Qt's dependencies, but Qt and QtWebkit themselves are still the
bundled copies.  This mode actually works.

Now that this mode exists, disable fontconfig in the "everything
bundled" mode, because it drags in the system freetype and several
other system libraries.  (There is no bundled fontconfig.)

Part of issue #12467.
ariya pushed a commit that referenced this issue Aug 19, 2014
@ariya ariya closed this as completed Aug 19, 2014
zackw added a commit to zackw/phantomjs that referenced this issue Aug 19, 2014
The PhantomJS QPA hardcoded usage of QFontconfigDatabase on
Unix-not-OSX, causing build failures in "bundle all the libraries" mode.
Use QGenericUnixFontDatabase instead, which is QFontconfigDatabase if
fontconfig is enabled, and QBasicFontDatabase if it isn't.  This means
that the bundled-qtdeps build will use only the fonts bundled with Qt,
and won't be able to find them on a machine that doesn't have the source
tree, which is suboptimal, but at least this makes the bundled-qtdeps
build complete successfully again.

Part of issue ariya#12467.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants