From 721887edc010e7dfefb22c5f38a13fa40ffb031a Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Tue, 19 May 2026 09:31:21 +0200 Subject: [PATCH 1/3] lomiri.qtmir: 0.8.0-unstable-2025-05-20 -> 0.8.0-unstable-2026-03-11 Behaves abit differently, so changes to the Lomiri VM tests were necessary. --- nixos/tests/lomiri.nix | 75 ++++++++++++------- .../lomiri/development/qtmir/default.nix | 6 +- 2 files changed, 50 insertions(+), 31 deletions(-) diff --git a/nixos/tests/lomiri.nix b/nixos/tests/lomiri.nix index 68254fbeeb35..5dc43286c0f3 100644 --- a/nixos/tests/lomiri.nix +++ b/nixos/tests/lomiri.nix @@ -142,7 +142,40 @@ let with machine.nested("Ensuring terminalTextColor {} stays present on the screen:".format(terminalTextColor)): retry(fn=check_for_color_continued_presence(terminalTextColor), timeout_seconds=5) - def ensure_lomiri_running() -> None: + def change_tty_back_forth(ttynumMain: int, ttynumDiff: int) -> None: + """ + A qtmir bump made the image get stuck, a tty switch back and forth fixes it. + """ + + machine.send_key(f"ctrl-alt-f{ttynumDiff}") + machine.sleep(10) + machine.send_key(f"ctrl-alt-f{ttynumMain}") + machine.sleep(10) + + def ensure_greeter_launched() -> None: + """ + Ensure that Lomiri (in greeter mode) has started up and is responsive. + Execution will stop at the user selection. + """ + + machine.wait_for_unit("display-manager.service") + machine.wait_until_succeeds("pgrep -u lightdm -f 'lomiri --mode=greeter'") + + # Start page shows current time + wait_for_text(r"(AM|PM)") + + # Display "hangs" since qtmir bump? Not sure why. Switch to a different tty and back, and ensure that time is still shown + # Greeter runs on: tty1 + change_tty_back_forth(1, 2) + wait_for_text(r"(AM|PM)") + machine.screenshot("lomiri_greeter_launched") + + # Advance to user selection, to make sure display really isn't stuck anymore + machine.send_key("ret") + wait_for_text("${description}") + machine.screenshot("lomiri_greeter_login") + + def ensure_lomiri_running(ttynumMain: int = 1, ttynumDiff: int = 2) -> None: """ Ensure that Lomiri has finished starting up. """ @@ -150,9 +183,6 @@ let # Process runs machine.wait_until_succeeds("pgrep -u ${user} -f 'lomiri --mode=full-shell'") - # Output rendering from Lomiri has started when it starts printing performance diagnostics - machine.wait_for_console_text("Last frame took") - # One of the last UI elements that loads is the clock. In the past, we could OCR for AM/PM to ensure it's there. That is now flaky. # The next best thing is to look for the launcher button, and ensure it stays around for awhile (DE doesn't crash). launcherColor: str = "#5277C3" @@ -161,6 +191,15 @@ let with machine.nested("Ensuring launcherColor {} stays present on the screen:".format(launcherColor)): retry(fn=check_for_color_continued_presence(launcherColor), timeout_seconds=30) + # Display "hangs" since qtmir bump? Not sure why. Switch to a different tty and back, and ensure that launcher button is still shown + change_tty_back_forth(ttynumMain, ttynumDiff) + with machine.nested("Waiting for the screen to have launcherColor {} on it:".format(launcherColor)): + retry(check_for_color(launcherColor)) + + # First input seems to get dropped while Mir registers the new input device. Send a key that does nothing, to get that out of the way, and sleep a tiny bit for registration to finish. + machine.send_key("left") + machine.sleep(3) + machine.screenshot("lomiri_launched") def wait_for_text(text) -> None: @@ -358,17 +397,7 @@ in # Lomiri in greeter mode should work & be able to start a session with subtest("lomiri greeter works"): - machine.wait_for_unit("display-manager.service") - machine.wait_until_succeeds("pgrep -u lightdm -f 'lomiri --mode=greeter'") - - # Start page shows current time - wait_for_text(r"(AM|PM)") - machine.screenshot("lomiri_greeter_launched") - - # Advance to login part - machine.send_key("ret") - wait_for_text("${description}") - machine.screenshot("lomiri_greeter_login") + ensure_greeter_launched() # Login machine.send_chars("${password}\n") @@ -771,24 +800,14 @@ in # Lomiri in greeter mode should use the correct keymap with subtest("lomiri greeter keymap works"): - machine.wait_for_unit("display-manager.service") - machine.wait_until_succeeds("pgrep -u lightdm -f 'lomiri --mode=greeter'") - - # Start page shows current time - # And the greeter *actually* renders our wallpaper! - wait_for_text(r"(AM|PM|Lorem|ipsum)") - machine.screenshot("lomiri_greeter_launched") - - # Advance to login part - machine.send_key("ret") - wait_for_text("${description}") - machine.screenshot("lomiri_greeter_login") + ensure_greeter_launched() # Login machine.send_chars("${pwInput}\n") # And the desktop doesn't render the wallpaper anymore. Grumble grumble... - ensure_lomiri_running() + # When going lomiri(greeter) -> lomiri(desktop), we run on tty2 + ensure_lomiri_running(2, 1) # Lomiri in desktop mode should use the correct keymap with subtest("lomiri session keymap works"): diff --git a/pkgs/desktops/lomiri/development/qtmir/default.nix b/pkgs/desktops/lomiri/development/qtmir/default.nix index 68db94af2f6b..4378dec63fef 100644 --- a/pkgs/desktops/lomiri/development/qtmir/default.nix +++ b/pkgs/desktops/lomiri/development/qtmir/default.nix @@ -36,13 +36,13 @@ stdenv.mkDerivation (finalAttrs: { # Not regular qtmir, experimental support for Mir 2.x # Currently following https://gitlab.com/ubports/development/core/qtmir/-/tree/personal/sunweaver/debian-upstream pname = "qtmir-debian-upstream"; - version = "0.8.0-unstable-2025-05-20"; + version = "0.8.0-unstable-2026-03-11"; src = fetchFromGitLab { owner = "ubports"; repo = "development/core/qtmir"; - rev = "b35762f5198873560138a810b387ae9401615c02"; - hash = "sha256-v5mdu3XLK4F5O56GDItyeCFsFMey4JaNWwXRlgjKFMA="; + rev = "57d9e9763933a5d6ca696676ebdde934529a71fe"; + hash = "sha256-xlMxBnEru4YK0BxUOd/jni9OTb6lZlw6nyHLNqdfY20="; }; outputs = [ From a392056e863c1db6a27ce121cc0e5da4394072ea Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Tue, 19 May 2026 09:33:12 +0200 Subject: [PATCH 2/3] lomiri.qtmir: Fix typo in comment, pull comments out of shell code Typo fix causes rebuild, which is silly. Pull comments out of executed shell code to avoid that in the future. --- .../lomiri/development/qtmir/default.nix | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/pkgs/desktops/lomiri/development/qtmir/default.nix b/pkgs/desktops/lomiri/development/qtmir/default.nix index 4378dec63fef..6760cbbd9555 100644 --- a/pkgs/desktops/lomiri/development/qtmir/default.nix +++ b/pkgs/desktops/lomiri/development/qtmir/default.nix @@ -50,19 +50,24 @@ stdenv.mkDerivation (finalAttrs: { "dev" ]; - postPatch = '' - # 10s timeout for Mir startup is too tight for VM tests on weaker hardwre (aarch64) - substituteInPlace src/platforms/mirserver/qmirserver_p.cpp \ - --replace-fail 'const int timeout = RUNNING_ON_VALGRIND ? 100 : 10' 'const int timeout = RUNNING_ON_VALGRIND ? 900 : 90' \ - --replace-fail 'const int timeout = 10' 'const int timeout = 90' - - substituteInPlace CMakeLists.txt \ - --replace-fail "\''${CMAKE_INSTALL_FULL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" \ - --replace-fail "\''${CMAKE_INSTALL_FULL_LIBDIR}/qt5/plugins/platforms" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtPluginPrefix}/platforms" \ - - substituteInPlace data/xwayland.qtmir.desktop \ - --replace-fail '/usr/bin/Xwayland' 'Xwayland' - ''; + postPatch = + # 10s timeout for Mir startup is too tight for VM tests on weaker hardware (aarch64) + '' + substituteInPlace src/platforms/mirserver/qmirserver_p.cpp \ + --replace-fail 'const int timeout = RUNNING_ON_VALGRIND ? 100 : 10' 'const int timeout = RUNNING_ON_VALGRIND ? 900 : 90' \ + --replace-fail 'const int timeout = 10' 'const int timeout = 90' + '' + # Fix where Qt plugins & QML modules should be installed to. We don't use "qt5" for Qt5. + + '' + substituteInPlace CMakeLists.txt \ + --replace-fail "\''${CMAKE_INSTALL_FULL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" \ + --replace-fail "\''${CMAKE_INSTALL_FULL_LIBDIR}/qt5/plugins/platforms" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtPluginPrefix}/platforms" + '' + # Look up Xwayland in environment + + '' + substituteInPlace data/xwayland.qtmir.desktop \ + --replace-fail '/usr/bin/Xwayland' 'Xwayland' + ''; strictDeps = true; From e59ae16417d05f65c1c571af627a51f00766cada Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Tue, 19 May 2026 09:36:54 +0200 Subject: [PATCH 3/3] lomiri.qtmir: Add Lomiri VM tests to passthru.tests If passthru.tests were being run for reverse deps by default, this wouldn't be necessary. But they aren't. So make the connection between qtmir and Lomiri more explicit. --- pkgs/desktops/lomiri/development/qtmir/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/desktops/lomiri/development/qtmir/default.nix b/pkgs/desktops/lomiri/development/qtmir/default.nix index 6760cbbd9555..4e816971ad54 100644 --- a/pkgs/desktops/lomiri/development/qtmir/default.nix +++ b/pkgs/desktops/lomiri/development/qtmir/default.nix @@ -2,6 +2,7 @@ stdenv, lib, fetchFromGitLab, + nixosTests, testers, cmake, cmake-extras, @@ -125,7 +126,9 @@ stdenv.mkDerivation (finalAttrs: { # Tests currently unavailable when building with Mir2 doCheck = false; - passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + passthru.tests = nixosTests.lomiri // { + pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + }; meta = { description = "QPA plugin to make Qt a Mir server";