mir,mir_2_15: Fix builds, modernise & fix VM tests (#374873)

Changed files
+93 -15
nixos
pkgs
servers
+24 -2
nixos/tests/miracle-wm.nix
···
user = "alice";
};
+
programs.ydotool.enable = true;
+
services.xserver.enable = true;
services.displayManager.defaultSession = lib.mkForce "miracle-wm";
···
];
# 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";
};
···
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;
···
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
···
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")
'';
}
+28 -10
nixos/tests/miriway.nix
···
user = "alice";
};
+
programs.ydotool.enable = true;
+
services.xserver.enable = true;
services.displayManager.defaultSession = lib.mkForce "miriway";
···
];
# 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";
};
···
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;
···
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")
+
+
# 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
machine.send_key("ctrl-alt-a")
···
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")
+
+
# 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")
'';
}
)
+6 -3
pkgs/servers/mir/common.nix
···
freetype,
glib,
glm,
-
glog,
libapparmor,
libdrm,
libepoxy,
···
freetype
glib
glm
-
glog
libdrm
libepoxy
libevdev
···
# 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)
+35
pkgs/servers/mir/default.nix
···
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
···
# 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=";
+
})
];
};
}