From 952a2afab8a4a3cbd14fcd8474932fbfa1961aea Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sat, 18 Jan 2025 20:31:29 +0100 Subject: [PATCH 1/7] nixosTests.miriway: Update alacritty config format, switch to pkgs.formats --- nixos/tests/miriway.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/tests/miriway.nix b/nixos/tests/miriway.nix index 14546dd03dff3..82522cea7c21a 100644 --- a/nixos/tests/miriway.nix +++ b/nixos/tests/miriway.nix @@ -55,7 +55,7 @@ import ./make-test-python.nix ( ]; # To help with OCR - etc."xdg/foot/foot.ini".text = lib.generators.toINI { } { + etc."xdg/foot/foot.ini".source = (pkgs.formats.ini { }).generate "foot.ini" { main = { font = "inconsolata:size=16"; }; @@ -65,7 +65,7 @@ import ./make-test-python.nix ( regular2 = foreground; }; }; - etc."xdg/alacritty/alacritty.yml".text = lib.generators.toYAML { } { + etc."xdg/alacritty/alacritty.toml".source = (pkgs.formats.toml { }).generate "alacritty.toml" { font = rec { normal.family = "Inconsolata"; bold.family = normal.family; From d3e2f73277c69a3bb0d4d1e086b4ee0fb53ea988 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sat, 18 Jan 2025 20:31:41 +0100 Subject: [PATCH 2/7] nixosTests.miracle-wm: Update alacritty config format, switch to pkgs.formats --- nixos/tests/miracle-wm.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/tests/miracle-wm.nix b/nixos/tests/miracle-wm.nix index 2bb62222b22a1..96df8bb434b60 100644 --- a/nixos/tests/miracle-wm.nix +++ b/nixos/tests/miracle-wm.nix @@ -59,7 +59,7 @@ ]; # To help with OCR - etc."xdg/foot/foot.ini".text = lib.generators.toINI { } { + etc."xdg/foot/foot.ini".source = (pkgs.formats.ini { }).generate "foot.ini" { main = { font = "inconsolata:size=16"; }; @@ -69,7 +69,7 @@ regular2 = foreground; }; }; - etc."xdg/alacritty/alacritty.yml".text = lib.generators.toYAML { } { + etc."xdg/alacritty/alacritty.toml".source = (pkgs.formats.toml { }).generate "alacritty.toml" { font = rec { normal.family = "Inconsolata"; bold.family = normal.family; From 9b520ccbfb2ee7c51f2ea7d4e059194397cc50ed Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sun, 19 Jan 2025 00:47:21 +0100 Subject: [PATCH 3/7] nixosTests.miriway: Switch back to commented-out code It seems to work again. --- nixos/tests/miriway.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/nixos/tests/miriway.nix b/nixos/tests/miriway.nix index 82522cea7c21a..9ed962f572b1d 100644 --- a/nixos/tests/miriway.nix +++ b/nixos/tests/miriway.nix @@ -109,10 +109,8 @@ import ./make-test-python.nix ( machine.wait_for_file("/tmp/test-wayland-exit-ok") machine.copy_from_vm("/tmp/test-wayland.out") machine.screenshot("foot_wayland_info") - # Only succeeds when a mouse is moved inside an interactive session? - # machine.send_chars("exit\n") - # machine.wait_until_fails("pgrep foot") - machine.succeed("pkill foot") + machine.send_chars("exit\n") + machine.wait_until_fails("pgrep foot") # Test XWayland machine.send_key("ctrl-alt-a") @@ -121,10 +119,8 @@ import ./make-test-python.nix ( machine.wait_for_file("/tmp/test-x11-exit-ok") machine.copy_from_vm("/tmp/test-x11.out") machine.screenshot("alacritty_glinfo") - # Only succeeds when a mouse is moved inside an interactive session? - # machine.send_chars("exit\n") - # machine.wait_until_fails("pgrep alacritty") - machine.succeed("pkill alacritty") + machine.send_chars("exit\n") + machine.wait_until_fails("pgrep alacritty") ''; } ) From d777e99f6a48223cc5bfd4529d6608e5ba104ddb Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sun, 19 Jan 2025 12:40:30 +0100 Subject: [PATCH 4/7] nixosTests.miriway: Move the mouse to work around VM setup issues --- nixos/tests/miriway.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/nixos/tests/miriway.nix b/nixos/tests/miriway.nix index 9ed962f572b1d..012def1c4510c 100644 --- a/nixos/tests/miriway.nix +++ b/nixos/tests/miriway.nix @@ -23,6 +23,8 @@ import ./make-test-python.nix ( user = "alice"; }; + programs.ydotool.enable = true; + services.xserver.enable = true; services.displayManager.defaultSession = lib.mkForce "miriway"; @@ -109,7 +111,17 @@ import ./make-test-python.nix ( machine.wait_for_file("/tmp/test-wayland-exit-ok") machine.copy_from_vm("/tmp/test-wayland.out") machine.screenshot("foot_wayland_info") + + # please actually register that we want to close the window + machine.succeed("ydotool mousemove -- 10 10") + machine.sleep(3) + machine.send_chars("exit\n") + + # please actually register that we want to close the window + machine.succeed("ydotool mousemove -- 10 10") + machine.sleep(3) + machine.wait_until_fails("pgrep foot") # Test XWayland @@ -119,7 +131,17 @@ import ./make-test-python.nix ( machine.wait_for_file("/tmp/test-x11-exit-ok") machine.copy_from_vm("/tmp/test-x11.out") machine.screenshot("alacritty_glinfo") + + # please actually register that we want to close the window + machine.succeed("ydotool mousemove -- 10 10") + machine.sleep(3) + machine.send_chars("exit\n") + + # please actually register that we want to close the window + machine.succeed("ydotool mousemove -- 10 10") + machine.sleep(3) + machine.wait_until_fails("pgrep alacritty") ''; } From 7c2becf742a58b7ed60fe9cef0488d879add64bc Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sun, 19 Jan 2025 12:40:45 +0100 Subject: [PATCH 5/7] nixosTests.miracle-wm: Move the mouse to work around VM setup issues --- nixos/tests/miracle-wm.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/nixos/tests/miracle-wm.nix b/nixos/tests/miracle-wm.nix index 96df8bb434b60..bc346a1568152 100644 --- a/nixos/tests/miracle-wm.nix +++ b/nixos/tests/miracle-wm.nix @@ -22,6 +22,8 @@ user = "alice"; }; + programs.ydotool.enable = true; + services.xserver.enable = true; services.displayManager.defaultSession = lib.mkForce "miracle-wm"; @@ -114,7 +116,17 @@ machine.wait_for_file("/tmp/test-wayland-exit-ok") machine.copy_from_vm("/tmp/test-wayland.out") machine.screenshot("foot_wayland_info") + + # please actually register that we want to close the window + machine.succeed("ydotool mousemove -- 10 10") + machine.sleep(3) + machine.send_chars("exit\n") + + # please actually register that we want to close the window + machine.succeed("ydotool mousemove -- 10 10") + machine.sleep(3) + machine.wait_until_fails("pgrep foot") # Test XWayland @@ -125,7 +137,17 @@ machine.wait_for_file("/tmp/test-x11-exit-ok") machine.copy_from_vm("/tmp/test-x11.out") machine.screenshot("alacritty_glinfo") + + # please actually register that we want to close the window + machine.succeed("ydotool mousemove -- 10 10") + machine.sleep(3) + machine.send_chars("exit\n") + + # please actually register that we want to close the window + machine.succeed("ydotool mousemove -- 10 10") + machine.sleep(3) + machine.wait_until_fails("pgrep alacritty") ''; } From b7771dfb4271620e6ccfbf3c4da77e32cf5c4836 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sun, 19 Jan 2025 16:06:57 +0100 Subject: [PATCH 6/7] mir,mir_2_15: Disable UdevWrapperTest.UdevMonitorDoesNotTriggerBeforeEnabling Failure seems to have been noticed by upstream, I assume they'll look into it: https://github.com/canonical/mir/issues/3716#issuecomment-2580698552 --- pkgs/servers/mir/common.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/mir/common.nix b/pkgs/servers/mir/common.nix index e41798d6aa08d..d9a56369f30fc 100644 --- a/pkgs/servers/mir/common.nix +++ b/pkgs/servers/mir/common.nix @@ -159,7 +159,12 @@ stdenv.mkDerivation (finalAttrs: { # BadBufferTest.test_truncated_shm_file *doesn't* throw an error as the test expected, mark as such # https://github.com/canonical/mir/pull/1947#issuecomment-811810872 (lib.cmakeBool "MIR_SIGBUS_HANDLER_ENVIRONMENT_BROKEN" true) - (lib.cmakeFeature "MIR_EXCLUDE_TESTS" (lib.strings.concatStringsSep ";" [ ])) + (lib.cmakeFeature "MIR_EXCLUDE_TESTS" ( + lib.strings.concatStringsSep ";" [ + # https://github.com/canonical/mir/issues/3716#issuecomment-2580698552 + "UdevWrapperTest.UdevMonitorDoesNotTriggerBeforeEnabling" + ] + )) # These get built but don't get executed by default, yet they get installed when tests are enabled (lib.cmakeBool "MIR_BUILD_PERFORMANCE_TESTS" false) (lib.cmakeBool "MIR_BUILD_PLATFORM_TEST_HARNESS" false) From 3c0a99ed60bc2337886c9619733a9e0187a76076 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Mon, 20 Jan 2025 21:39:55 +0100 Subject: [PATCH 7/7] mir,mir_2_15: Drop glog dependency glog pkg-config file disappeared after https://github.com/NixOS/nixpkgs/pull/364543. - mir doesn't depend on it anymore - mir_2_15 did, and re-enabling the pkg-config file for the new glog version errored out Upstream decided to just drop glog as a dependency, so follow suit. --- pkgs/servers/mir/common.nix | 2 -- pkgs/servers/mir/default.nix | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/mir/common.nix b/pkgs/servers/mir/common.nix index d9a56369f30fc..ccc1150db5b73 100644 --- a/pkgs/servers/mir/common.nix +++ b/pkgs/servers/mir/common.nix @@ -12,7 +12,6 @@ freetype, glib, glm, - glog, libapparmor, libdrm, libepoxy, @@ -112,7 +111,6 @@ stdenv.mkDerivation (finalAttrs: { freetype glib glm - glog libdrm libepoxy libevdev diff --git a/pkgs/servers/mir/default.nix b/pkgs/servers/mir/default.nix index 57bc70f1a7a40..d040ebeb85259 100644 --- a/pkgs/servers/mir/default.nix +++ b/pkgs/servers/mir/default.nix @@ -29,6 +29,14 @@ in hash = "sha256-k+51piPQandbHdm+ioqpBrb+C7Aqi2kugchAehZ1aiU="; }) + # Always depend on epoxy + # Remove when version > 2.15.0 + (fetchpatch { + name = "0003-mir-cmake-always-require-epoxy.patch"; + url = "https://github.com/canonical/mir/commit/171c42ac3929f946a70505ee42be0ce8220f245a.patch"; + hash = "sha256-QuVZBcHSn/DK+xbjM36Y89+w22vk7NRV4MkbjgvS28A="; + }) + # Fix ignored return value of std::lock_guard # Remove when version > 2.15.0 # Was changed as part of the big platform API change, no individual upstream commit with this fix @@ -44,6 +52,33 @@ in # Partially done in https://github.com/canonical/mir/pull/3192, though one of the calloc was fixed earlier # when some code was moved into that file ./1003-mir-2_15-calloc-args-in-right-order.patch + + # Drop gflags & glog dependencies + # Remove when version > 2.16.4 + (fetchpatch { + name = "0101-Drop-unused-dependency-on-gflags.patch"; + url = "https://github.com/canonical/mir/commit/15a40638e5e9c4b6a11b7fa446ad31e190f485e7.patch"; + includes = [ + "CMakeLists.txt" + "examples/mir_demo_server/CMakeLists.txt" + "examples/mir_demo_server/glog_logger.cpp" + ]; + hash = "sha256-qIsWCOs6Ap0jJ2cpgdO+xJHmSqC6zP+J3ALAfmlA6Vc="; + }) + (fetchpatch { + name = "0102-Drop-the-glog-example.patch"; + url = "https://github.com/canonical/mir/commit/8407da28ddb9a535df2775f224bf5143e8770d52.patch"; + includes = [ + "CMakeLists.txt" + "examples/mir_demo_server/CMakeLists.txt" + "examples/mir_demo_server/glog_logger.cpp" + "examples/mir_demo_server/glog_logger.h" + "examples/mir_demo_server/server_example.cpp" + "examples/mir_demo_server/server_example_log_options.cpp" + "examples/mir_demo_server/server_example_log_options.h" + ]; + hash = "sha256-jVhVR7wZZZGRS40z+HPNoGBLHulvE1nHRKgYhQ6/g9M="; + }) ]; }; }