Skip to content

Conversation

@slipher
Copy link
Contributor

@slipher slipher commented Nov 12, 2025

Requires the updater-wip branch from https://github.com/slipher/fluid.

There are two branches. This one, slipher/qt6, includes only the commits that are supposed to be related to Qt6 migration. The other one slipher/qt6-combined represents the actual working copy I am using which includes some other commits.

Upgrade from Qt 5.14 to 6.8; migrate from qmake to cmake; update Fluid by a lot which requires some migrations; also update Quazip which didn't require any migrations.

Current issues:

  • Implement MacOS
  • Fix release mode build for Windows
  • Update codeql workflow
  • The Linux executable is a PIE
  • (Linux) File dialog that should should be modal fails to control focus (maybe missing some x11 lib?)
  • Missing date strings in file dialog. The date strings are hardly needed, but their absence causes warning spam in the terminal.
  • D-Bus is disabled. I think we use that for having the task icon blink when the download finishes.
  • Hard dependency on obscure XCB libraries
  • (Linux) examine xkb library dependencies
  • Restore basic text editing functionality, for command line editor? (copy and paste, undo)
  • Custom CMake for Fluid
  • Doesn't exit when all windows are closed
  • Fluid "ripple" animations when clicking a button not working?

@illwieckz
Copy link
Member

illwieckz commented Nov 12, 2025

It now depends on libxcb-cursor.so.0 and I had to install libxcb-cursor0 on my end, meaning no one of the applications I use requires that, meaning that dependency is very rare.

Edit: I forgot to say I'm running Ubuntu 24.04.3 LTS Noble Numbat.

build-qt.sh Outdated
-DFEATURE_formlayout=OFF
-DFEATURE_fscompleter=OFF
-DFEATURE_future=OFF
-DFEATURE_gc_binaries=OFF
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is the same as -gc-binaries, it should be ON to reduce size:

According to https://doc.qt.io/qt-6/build-optimized-qt.html:

-gc-binaries
Remove unnecessary parts from binary. Place each function or data item into its own section and enable linker garbage collection of unused sections.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. gc-binaries + reduce-exports shaved off 1.8M.

@illwieckz
Copy link
Member

I get this:

In file included from /updater/downloadworker.cpp:20:
/updater/downloadworker.h:25:10: fatal error: QStandardItemModel: No such file or directory
   25 | #include <QStandardItemModel>
      |          ^~~~~~~~~~~~~~~~~~~~

@slipher
Copy link
Contributor Author

slipher commented Nov 12, 2025

I get this:

In file included from /updater/downloadworker.cpp:20:
/updater/downloadworker.h:25:10: fatal error: QStandardItemModel: No such file or directory
   25 | #include <QStandardItemModel>
      |          ^~~~~~~~~~~~~~~~~~~~

I guess the "remove an unused include" commit from slipher/qt6-combined is needed.

@illwieckz
Copy link
Member

That was that, thanks!

@illwieckz
Copy link
Member

Out of curiosity, I tried building Qt without OpenGL, to see if that would save space. The updater builds and runs this way but that looks ugly: curves are aliased, and some background color on configuration dialog is wrong.

@illwieckz
Copy link
Member

It now depends on libxcb-cursor.so.0 and I had to install libxcb-cursor0 on my end, meaning no one of the applications I use requires that, meaning that dependency is very rare.

Edit: I forgot to say I'm running Ubuntu 24.04.3 LTS Noble Numbat.

That's annoying: when that dependency isn't there, Qt6 doesn't build, but we cannot ship an updater requiring it.

On Ubuntu 24.04 that dependency is not installed by default, and is required by only 8 softwares! That means no one have this dependency installed on Ubuntu LTS! Maybe we will have to build it statically.

@slipher
Copy link
Contributor Author

slipher commented Nov 12, 2025

Out of curiosity, I tried building Qt without OpenGL, to see if that would save space. The updater builds and runs this way but that looks ugly: curves are aliased, and some background color on configuration dialog is wrong.

The Qt Quick documentation says that some effects are expected not to display if software rendering is used. Also I get high CPU usage in that mode (for me it happens when I run the app from a container that lacks some support libs).

It now depends on libxcb-cursor.so.0 and I had to install libxcb-cursor0 on my end, meaning no one of the applications I use requires that, meaning that dependency is very rare.
Edit: I forgot to say I'm running Ubuntu 24.04.3 LTS Noble Numbat.

That's annoying: when that dependency isn't there, Qt6 doesn't build, but we cannot ship an updater requiring it.

On Ubuntu 24.04 that dependency is not installed by default, and is required by only 8 softwares! That means no one have this dependency installed on Ubuntu LTS! Maybe we will have to build it statically.

Ouch. It seems Qt 6 has the opposite problem of Qt 5, which had too few hard requirements and ended up not displaying properly on the initial attempt to upgrade to Bullseye. There is an extensive list of libs for the test named xcb_syslibs in the build system which are required all or nothing. But recently I saw somewhere an option for using an internal xcb that we should try out. I forgot what the option is called but I can see the code in there at qtbase src/3rdparty/xcb/.

@slipher
Copy link
Contributor Author

slipher commented Nov 14, 2025

I now have a version that statically links against the libxcb-XXX libraries from Debian.

@illwieckz
Copy link
Member

Excellent!

@illwieckz
Copy link
Member

Some minor changes that live in a local branch of mine:

  • The install command looks like this way on my end:
RUN apt-get update \
    && apt-get install -y \
    autoconf \
    autopoint \
    ca-certificates \
    curl \
    gettext \
    git \
    g++ \
    libgl1-mesa-dev \
    libtool \
    libx11-xcb-dev \
    libxcb-glx0-dev \
    libxkbcommon-x11-dev \
    make \
    ninja-build \
    perl \
    p7zip-full \
    pkg-config \
    python \
    xz-utils \
    zlib1g-dev \
    $XCB_MINIMUM_PACKAGES \
    && echo 'deb https://archive.debian.org/debian bullseye-backports main' > /etc/apt/sources.list.d/backports.list \
    && apt-get update \
    && apt-get install -y \
    cmake/bullseye-backports \
    && apt-get clean

It installs explicitely ca-certificates because that's needed for the archive depot. It worked before because a package pulled it (probably curl), but it's not bad to be explicit.
It runs apt-get clean at the end in hope the snapshotted docker step is smaller on disk.
The backport repository url is made a bit smaller.
Also, just as a style concern, I put the && at the beginning of the line so it makes more obvious to my eyes it's a command and not an argument.

I also have a patch that moves the Aria build before the Qt build, so anytime Qt changes are made, the whole build is faster because modifying the Qt build doesn't invalidate the Aria build because of ordering.

I had a third patch adding ENV LANG=C.UTF-8 before anything else, but you already implemented the same yourself.

@illwieckz
Copy link
Member

illwieckz commented Nov 14, 2025

I don't know if that's bad or not, but Qt links against libxcb-xkb.a while also linking against libxkbcommon-x11.so.0 which is linked against libxcb-xkb.so.1, meaning we link against two libxcb-xkb, and one of them will be the static one from the Debian docker, while the other one will be the shared one from the user's computer.

@illwieckz
Copy link
Member

Doing this makes sure the shared lib is always used for xcb-xkb while others are linked statically:

RUN ls /usr/lib/x86_64-linux-gnu/libxcb-*.so | grep -v xcb-xkb | xargs rm -v

@slipher
Copy link
Contributor Author

slipher commented Nov 14, 2025

The input part is where Qt has a bundled one that we can try. -qt-xkb or something in the configure args

@illwieckz
Copy link
Member

The backports list file was removed:

E: Release 'bullseye-backports' for 'cmake' was not found

Also I noticed the backport url could use http, making it possible to be fetched before installing ca-certificates. Debian does it own crypto thing and doesn't need to trust the carrier as it can validate the package whatever the way it was sourced. This makes possible to do a single apt update.

That ca-certificates package is likely needed for the curl download, but then keeping it implicit from curl now sounds fine.

That's doable:

RUN echo 'deb http://archive.debian.org/debian bullseye-backports main' > /etc/apt/sources.list.d/backports.list \
    && apt-get update \
    && apt-get install -y \
    autoconf \
    autopoint \
    curl \
    gettext \
    git \
    g++ \
    libgl1-mesa-dev \
    libtool \
    libx11-xcb-dev \
    libxcb-glx0-dev \
    libxkbcommon-x11-dev \
    make \
    ninja-build \
    perl \
    p7zip-full \
    pkg-config \
    python \
    xz-utils \
    zlib1g-dev \
    $XCB_MINIMUM_PACKAGES \
    && apt-get install -y \
    cmake/bullseye-backports \
    && apt-get clean

@slipher slipher force-pushed the slipher/qt6 branch 3 times, most recently from aa400d7 to 780eba1 Compare November 16, 2025 13:36
@illwieckz
Copy link
Member

The commit spam no-pie/no-pic mistakenly deletes this line from the OpenSSL build:

RUN ./config --prefix=/openssl --openssldir=/dev/null no-shared no-apps no-autoload-config no-capieng no-dso no-dynamic-engine no-engine no-loadereng no-module -Os

Dockerfile Outdated
# Note: {foo:+bar} here is a syntax of the Dockerfile, not the shell!
ENV IPO_ARG=${release:+-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON}
RUN echo IPO_ARG ${IPO_ARG}
RUN BUILDQT_CMAKE_ARGS="${IPO_ARG} -DCMAKE_POSITION_INDEPENDENT_CODE=OFF -DFEATURE_reduce_relocations=OFF" CXXFLAGS='-fno-pic -no-pie' CFLAGS='-fno-pic -no-pie' PKG_CONFIG_PATH=/openssl/lib64/pkgconfig ./build-qt.sh && mv qt /qt && rm -rf /build-qt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-DCMAKE_POSITION_INDEPENDENT_CODE=OFF ${IPO_ARG} instead of ${IPO_ARG} -DCMAKE_POSITION_INDEPENDENT_CODE=OFF

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

${IPO_ARG} -DCMAKE_POSITION_INDEPENDENT_CODE=OFF always disable IPO.

@slipher
Copy link
Contributor Author

slipher commented Nov 17, 2025

The commit spam no-pie/no-pic mistakenly deletes this line from the OpenSSL build:

RUN ./config --prefix=/openssl --openssldir=/dev/null no-shared no-apps no-autoload-config no-capieng no-dso no-dynamic-engine no-engine no-loadereng no-module -Os

Fixed

@slipher
Copy link
Contributor Author

slipher commented Nov 18, 2025

There is now a Windows build, which seems to work in non-release mode. (But if you pass release=1, you get an internal compiler error.)

@slipher
Copy link
Contributor Author

slipher commented Nov 20, 2025

Fixed issue with the app not exiting when all windows are closed.

Also added the toolchain file for MinGW which I forgot to add before.

@illwieckz
Copy link
Member

Fixed issue with the app not exiting when all windows are closed.

Thanks a lot!

@slipher
Copy link
Contributor Author

slipher commented Nov 28, 2025

Finally got the modal dialog thing. Turns out it is not implemented for "non-native" dialogs until Qt 6.10. The Debian distro libraries used "native" dialogs so that's why the problem could not be reproduced there. I tried building with version 6.10 but then the dialog wouldn't open at all. So I backported the commit to 6.8.

Something that is broken is the render of the “Continue reading” link, the HTML code explicitly says this should be cyan and aligned to the right, while it is rendered as white and aligned to the left. Actually that look isn't that bad, and we may decide to do it purposely, but that's not what the code is asking for.

Fixed

@illwieckz
Copy link
Member

illwieckz commented Nov 28, 2025

You may be interested in my build-qt: per-module patch application patch to simplifies the application of patches, this is something I wrote when I added a patch for qtshadertools but I rebased it and rewrote it to be even more generic so it could handle without custom code the qtdeclarative patch you added.

@illwieckz
Copy link
Member

I see no difference with “Continue reading”.

@slipher
Copy link
Contributor Author

slipher commented Nov 28, 2025

Maybe it would be better to just test slipher/qt6-combined since I keep forgetting to update the slipher/qt6 pointer.

@slipher
Copy link
Contributor Author

slipher commented Nov 28, 2025

Maybe it would be better to just test slipher/qt6-combined since I keep forgetting to update the slipher/qt6 pointer.

Never mind, I don't think it was in there either. Pushed both

@illwieckz
Copy link
Member

This is starting to look (the PR) very good!

@illwieckz
Copy link
Member

About fontconfig support, I noticed we require it on Linux to be able to render the names of the user's folders in the install directory picker window.

We not only have to render our blog posts, we also have to render any character in a file path on user's computers.

@illwieckz
Copy link
Member

Another regression spotted: when we hover the “Continue reading” link, the mouse pointer doesn't turn into a finger pointing hand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants