QT 5 did not set layout constraints on their popups. This causes some
compositors like GNOME to place the popups partially outside the screen.
This change backports the corresponding fix, but with an exclusion for
KDE as its current version does not work well with layout constraints.
Qt QML is a language for designing user interfaces. QML (and related
JavaScript) source files are compiled into bytecode at runtime before
execution. To save time, this bytecode is cached on disk.
The cache is keyed primarily off the application name and mtime of the
source file. Since application names rarely change, source files that
have passed through the store have their mtimes fixed at 1, and
SOURCE_DATE_EPOCH is also set to 1 during builds, compiled bytecode in
this cache for Qt programs built by Nix is rarely or never invalidated.
This results in programs running with QML bytecode that does not match
their source code, which manifests as a constant source of random and
unreproducible glitches, oddities, and crashes in Qt applications when
they are upgraded. For applications like SDDM and Plasma, the user may
be left with a completely broken system, and sometimes even rolling back
doesn't fix the issue.
This patch resolves the issue by simply patching Qt's QML module in all
supported versions to disable the disk cache by default as if the
environment variable QML_DISABLE_DISK_CACHE were always 1. Patching the
code ensures consistent behavior for all Qt applications in all
environments, including non-NixOS uses.
Simple benchmarking suggests an approximate 10% CPU time penalty when
launching QML-heavy applications, and no measurable penalty to booting
into Plasma. This is considerably more benign than the earlier behavior.
For testing or the performance conscious, use of the cache can be
re-enabled after understanding the risks by setting the environment
variable QML_FORCE_DISK_CACHE to 1. This can be done system-wide using
e.g. the `environment.sessionVariables` NixOS option.
Future work could change the cache key through source code changes or
automatic generation of an appropriate SOURCE_DATE_EPOCH. Until then,
this is a simple change which removes a large class of user frustration
and headache for little penalty.
libpulseaudio doesn't currently build on darwin after a recent
upgrade (#160097). When looking closely at the darwin build, it
appeared that it wasn't being used at all.
❯ nix log $(nix-build --no-out-link channel:nixpkgs-unstable --argstr system x86_64-darwin -A qt512.qtmultimedia) | grep PulseAudio
Checking for PulseAudio >= 0.9.10... no
PulseAudio ............................. no
❯ nix log $(nix-build --no-out-link channel:nixpkgs-unstable --argstr system x86_64-darwin -A qt514.qtmultimedia) | grep PulseAudio
Checking for PulseAudio >= 0.9.10... no
PulseAudio ............................. no
❯ nix log $(nix-build --no-out-link channel:nixpkgs-unstable --argstr system x86_64-darwin -A qt515.qtmultimedia) | grep PulseAudio
Checking for PulseAudio >= 0.9.10... no
PulseAudio ............................. no
The qtbase package's `configurePhase` builds the `qmake` tool. In the
current nixpkgs expression it does this single-threadedly, by invoking
`make` without a `-j` flag.
Let's thread `NIX_BUILD_CORES` through to `./configure`'s invocation
of `make` via the `MAKEFLAGS` variable.
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>