Skip to content

qt5: facelift#487372

Open
eryngion wants to merge 10 commits intoNixOS:stagingfrom
eryngion:qt5-facelift
Open

qt5: facelift#487372
eryngion wants to merge 10 commits intoNixOS:stagingfrom
eryngion:qt5-facelift

Conversation

@eryngion
Copy link

@eryngion eryngion commented Feb 5, 2026

These are various fixes, improvements, and cleanups that I've accumulated over the past 2+ years of trying to keep my out-of-tree cross compilation changes working. Most of these commits are applicable to native builds too and nothing here depends on the scary cross changes.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

eryngion added 10 commits February 5, 2026 15:28
Rely on callPackage whenever possible.
It never worked and it's just an attempt to duplicate the logic
from qmake (i.e. QMAKEPATH -> QMAKEMODULES translation) that qmake
does all by itself.
hyphen's sources in tarbals are identical, and the version from
pkgs properly supports cross compilation.
…qmakeFlags

but don't use __structuredAttrs
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches. 10.rebuild-darwin: 501-1000 This PR causes many rebuilds on Darwin and should normally target the staging branches. 12.first-time contribution This PR is the author's first one; please be gentle! labels Feb 5, 2026
@eryngion
Copy link
Author

eryngion commented Feb 5, 2026

Also there's a backported CVE patch for qtdeclarative in Debian and a half-working patch for ffmpeg 8 support for qtwebengine in Fedora.

@@ -236,6 +230,18 @@ let
./qtwebkit.patch
./qtwebkit-icu68.patch
./qtwebkit-cstdint.patch
(fetchpatch {
url = "https://src.fedoraproject.org/rpms/qt5-qtwebkit/raw/84f3c61c46bce99bfbd70d8c202e022d62f2ea9a/f/qtwebkit-icu76.patch";
sha256 = "sha256-Z+ot7R5Dy+F08FbcXzN4MB2ttxLg0I0P8uVErpbFiu4=";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
sha256 = "sha256-Z+ot7R5Dy+F08FbcXzN4MB2ttxLg0I0P8uVErpbFiu4=";
hash = "sha256-Z+ot7R5Dy+F08FbcXzN4MB2ttxLg0I0P8uVErpbFiu4=";

@doronbehar
Copy link
Contributor

@eryngion well done for all the work! I have a few comments regarding the commit messages. I'd personally apply the following rebase on the commit log:

pick 051cefa0bfa0 qt5: simplify package functions' definitions and calls
break
# TODO: Check the hash doesn't change
pick f4423ca7f70f qt5.qtbase: remove the unused withQttranslation parameter
break
# TODO: Check the hash doesn't change
pick 636a2757a8c4 qt5.qtbase: remove broken QMAKEMODULES code
pick 3bfdd7d08f77 qt5.qtbase: fix mysql support for cross builds
pick f97b09838819 qt5.qtbase: strictDeps works without mysql in nativeBuildInputs
break
# commit: qt5.qtdeclarative: remove unused qtsvg dependency (split the next commit to 2 separate commits)
reword a3868fe309ef qt5.qtdeclarative: fix building with gcc15 and remove unused qtsvg dependency
pick 7c4d33567998 qt5.qtwebkit: fix build and use hyphen and woff2 from pkgs
pick ed823ab51e4c Revert "qt5.qtwebengine: Pin to GCC 14"
squash a258d0b6f167 qt5.qtwebengine: fix building with gcc 15, use more system librares, and propagate less of them
pick e04ba2746ca8 qt5.qmake: make it usable again for packages that pass file names in qmakeFlags

I also have a question: How come qt5.qtdeclarative builds fine now, with GCC 15 on branch master?

@eryngion
Copy link
Author

eryngion commented Feb 8, 2026

I also have a question: How come qt5.qtdeclarative builds fine now, with GCC 15 on branch master?

I was wondering about something along those lines. So, {NIX_CFLAGS_COMPILE = "-H"; qmakeFlags = ["-d"];} to the resque.

In native builds includes look like this:

. ../qml/compiler/qv4compiler_p.h
.. /nix/store/***-qtbase-5.15.18-dev/include/QtCore/qstring.h
... /nix/store/***-qtbase-5.15.18-dev/include/QtCore/qchar.h
.... /nix/store/***-qtbase-5.15.18-dev/include/QtCore/qglobal.h
..... /nix/store/***-qtbase-5.15.18-dev/include/QtCore/qatomic.h
...... /nix/store/***-qtbase-5.15.18-dev/include/QtCore/qbasicatomic.h
....... /nix/store/***-qtbase-5.15.18-dev/include/QtCore/qatomic_cxx11.h
........ /nix/store/***-gcc-15.2.0/include/c++/15.2.0/atomic
......... /nix/store/***-gcc-15.2.0/include/c++/15.2.0/cstdint

But in cross builds I get this:

..... /nix/store/***-qtbase-aarch64-unknown-linux-gnu-5.15.18-dev/include/QtCore/qatomic.h
...... /nix/store/***-qtbase-aarch64-unknown-linux-gnu-5.15.18-dev/include/QtCore/qbasicatomic.h
....... /nix/store/***-qtbase-aarch64-unknown-linux-gnu-5.15.18-dev/include/QtCore/qatomic_bootstrap.h
........ /nix/store/***-qtbase-aarch64-unknown-linux-gnu-5.15.18-dev/include/QtCore/qgenericatomic.h
......... /nix/store/***-qtbase-aarch64-unknown-linux-gnu-5.15.18-dev/include/QtCore/qtypeinfo.h

Looks like qatomic_cxx11.h is disabled because of QT_BOOTSTRAPPED
https://github.com/qt/qtbase/blob/49adb85d34918034e0d6a4c23817407103fb9f73/src/corelib/thread/qbasicatomic.h#L46-L53

And the bootstrap build is forced by cross compilation:
https://github.com/qt/qtbase/blob/49adb85d34918034e0d6a4c23817407103fb9f73/mkspecs/features/qt_build_config.prf#L85-L86

NB: this is not what I'm doing with bootstrapBuild flag for qtbase package definition.

And maybe we should try and disable this cross_compile --> force_bootstrap dependency at least for some platforms?

@eryngion
Copy link
Author

eryngion commented Feb 8, 2026

Re: splits and merges. I'm also removing a couple of unused dependencies in the big qtwebengine commit, so I don't see why the small qtdeclarative commit should be treated differently.

@doronbehar
Copy link
Contributor

Re: splits and merges. I'm also removing a couple of unused dependencies in the big qtwebengine commit, so I don't see why the small qtdeclarative commit should be treated differently.

The logic behind the commit separation suggestions is as under discussion here:

The general rule of thumb I'm following is: Changes that are:

  1. Sensible and improve (even minor) details
  2. Don't cause a build failure

Should be split to different commits. In this case, the Nixpkgs tree is fully using GCC 15 now, and there is no point in reverting a commit that makes the build fail.

However I did not notice the qtwebengine also mixes changes that are not necessarily related to each other, so now that you are saying that, I think they too should be decoupled, to:

qt5.qtwebengine: apply python 3.12 patch like all other patches
qt5.qtwebengine: fix build with Gcc 15 (reverts 6e27bc915b374bfdc7cabe75018f16b6c623fa91)
qt5.qtwebengine: propagate less buildInputs
qt5.qtwebengine: use more system libraries

Looks like qatomic_cxx11.h is disabled because of QT_BOOTSTRAPPED qt/qtbase@49adb85/src/corelib/thread/qbasicatomic.h#L46-L53

And the bootstrap build is forced by cross compilation: qt/qtbase@49adb85/mkspecs/features/qt_build_config.prf#L85-L86

NB: this is not what I'm doing with bootstrapBuild flag for qtbase package definition.

And maybe we should try and disable this cross_compile --> force_bootstrap dependency at least for some platforms?

TBH I haven't managed to follow you there. I trust you have made the sensible changes, but maybe it would have been nice to explain it better in the commit message.

@doronbehar
Copy link
Contributor

@eryngion would you like me to help you with this rebase?

@Bot-wxt1221
Copy link
Member

Err, if you want a quicker merge, split into different PRs is more acceptable

@doronbehar
Copy link
Contributor

Here are the 2 first commits of this PR, targeting master and should be very easy to agree upon and merge, because they cause no rebuilds:

Of course @eryngion is the committer there :).

@doronbehar
Copy link
Contributor

The qt5.qtweb{engine,kit} commits are irrelevant as these attributes have meta.knownVulnerabilities so I'm not cherry picking these commits.

Here is a qt5.qtbase commit sourced in this PR, but turned out to be simpler:

Afterwards, the only remaining commit is:

Afterwards I'll try to open separate PRs for changes from #267311 .

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

Labels

10.rebuild-darwin: 501-1000 This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants