push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
From d31d3abb36163b0f0a892898349d6a99aaf50e10 Mon Sep 17 00:00:00 2001
From: OPNA2608 <opna2608@protonmail.com>
Date: Thu, 26 Dec 2024 23:12:39 +0100
Subject: [PATCH] Fix ignored return value of std::lock_guard
Upstream this seems to have been resolved as part of the big platform API change, so manually rewrote this change into a patch.
---
src/platforms/wayland/displayclient.cpp | 2 +-
src/server/frontend_xwayland/xcb_connection.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/platforms/wayland/displayclient.cpp b/src/platforms/wayland/displayclient.cpp
index 27bdfe5..987be52 100644
--- a/src/platforms/wayland/displayclient.cpp
+++ b/src/platforms/wayland/displayclient.cpp
@@ -563,7 +563,7 @@ void mgw::DisplayClient::on_display_config_changed()
void mgw::DisplayClient::delete_outputs_to_be_deleted()
{
- std::lock_guard{outputs_mutex};
+ std::lock_guard lock{outputs_mutex};
outputs_to_be_deleted.clear();
}
diff --git a/src/server/frontend_xwayland/xcb_connection.cpp b/src/server/frontend_xwayland/xcb_connection.cpp
index 4f72b98..0be74b0 100644
--- a/src/server/frontend_xwayland/xcb_connection.cpp
+++ b/src/server/frontend_xwayland/xcb_connection.cpp
@@ -207,7 +207,7 @@ void mf::XCBConnection::verify_not_in_error_state() const
auto mf::XCBConnection::query_name(xcb_atom_t atom) const -> std::string
{
- std::lock_guard{atom_name_cache_mutex};
+ std::lock_guard lock{atom_name_cache_mutex};
auto const iter = atom_name_cache.find(atom);
if (iter == atom_name_cache.end())
--
2.47.0

View File

@@ -0,0 +1,77 @@
From ab00b6d09303c17ecc7a2131a95591716e9ad7a1 Mon Sep 17 00:00:00 2001
From: Jonathan Wakely <jwakely@fedoraproject.org>
Date: Thu, 26 Dec 2024 23:00:23 +0100
Subject: [PATCH] Add missing includes for <algorithm>
Co-authored-by: OPNA2608 <opna2608@protonmail.com>
---
src/miral/external_client.cpp | 1 +
src/miral/keymap.cpp | 1 +
src/platform/graphics/linux_dmabuf.cpp | 1 +
src/server/scene/rendering_tracker.cpp | 1 +
tests/unit-tests/graphics/test_overlapping_output_grouping.cpp | 1 +
5 files changed, 5 insertions(+)
diff --git a/src/miral/external_client.cpp b/src/miral/external_client.cpp
index 0c3d176..792b962 100644
--- a/src/miral/external_client.cpp
+++ b/src/miral/external_client.cpp
@@ -22,6 +22,7 @@
#include <mir/options/option.h>
#include <mir/server.h>
+#include <algorithm>
#include <stdexcept>
namespace mo = mir::options;
diff --git a/src/miral/keymap.cpp b/src/miral/keymap.cpp
index e494a10..010cb75 100644
--- a/src/miral/keymap.cpp
+++ b/src/miral/keymap.cpp
@@ -30,6 +30,7 @@
#define MIR_LOG_COMPONENT "miral::Keymap"
#include <mir/log.h>
+#include <algorithm>
#include <mutex>
#include <string>
#include <vector>
diff --git a/src/platform/graphics/linux_dmabuf.cpp b/src/platform/graphics/linux_dmabuf.cpp
index f5a750f..840c3d0 100644
--- a/src/platform/graphics/linux_dmabuf.cpp
+++ b/src/platform/graphics/linux_dmabuf.cpp
@@ -41,6 +41,7 @@
#include <mutex>
#include <vector>
#include <optional>
+#include <algorithm>
#include <drm_fourcc.h>
#include <wayland-server.h>
diff --git a/src/server/scene/rendering_tracker.cpp b/src/server/scene/rendering_tracker.cpp
index fe4e05e..24393a3 100644
--- a/src/server/scene/rendering_tracker.cpp
+++ b/src/server/scene/rendering_tracker.cpp
@@ -17,6 +17,7 @@
#include "rendering_tracker.h"
#include "mir/scene/surface.h"
+#include <algorithm>
#include <stdexcept>
#include <boost/throw_exception.hpp>
diff --git a/tests/unit-tests/graphics/test_overlapping_output_grouping.cpp b/tests/unit-tests/graphics/test_overlapping_output_grouping.cpp
index 4478578..7167ad1 100644
--- a/tests/unit-tests/graphics/test_overlapping_output_grouping.cpp
+++ b/tests/unit-tests/graphics/test_overlapping_output_grouping.cpp
@@ -22,6 +22,7 @@
#include <gtest/gtest.h>
#include <vector>
+#include <algorithm>
namespace mg = mir::graphics;
namespace geom = mir::geometry;
--
2.47.0

View File

@@ -0,0 +1,35 @@
From 2b3fa53f0115d73d1d515f8c839fc481ba5db46d Mon Sep 17 00:00:00 2001
From: Alan Griffiths <alan@octopull.co.uk>
Date: Thu, 26 Dec 2024 23:21:12 +0100
Subject: [PATCH] calloc args in right order
Co-authored-by: OPNA2608 <opna2608@protonmail.com>
---
examples/client/wayland_client.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/examples/client/wayland_client.c b/examples/client/wayland_client.c
index a52b04c..e644a44 100644
--- a/examples/client/wayland_client.c
+++ b/examples/client/wayland_client.c
@@ -375,7 +375,7 @@ int main(int argc, char** argv)
struct wl_display* display = wl_display_connect(NULL);
struct globals* globals;
- globals = calloc(sizeof *globals, 1);
+ globals = calloc(1, sizeof *globals);
struct wl_registry* registry = wl_display_get_registry(display);
@@ -389,7 +389,7 @@ int main(int argc, char** argv)
void* pool_data = NULL;
struct wl_shm_pool* shm_pool = make_shm_pool(globals->shm, 400 * 400 * 4, &pool_data);
- struct draw_context* ctx = calloc(sizeof *ctx, 1);
+ struct draw_context* ctx = calloc(1, sizeof *ctx);
for (int i = 0; i < 4; ++i)
{
--
2.47.0

257
pkgs/servers/mir/common.nix Normal file
View File

@@ -0,0 +1,257 @@
{
stdenv,
lib,
fetchFromGitHub,
nixosTests,
testers,
cmake,
pkg-config,
python3,
boost,
egl-wayland,
freetype,
glib,
glm,
libapparmor,
libdisplay-info,
libdrm,
libepoxy,
libevdev,
libglvnd,
libinput,
libuuid,
libxcb,
libxkbcommon,
libxmlxx,
yaml-cpp,
lttng-ust,
libgbm,
mesa,
nettle,
pixman,
udev,
wayland,
wayland-scanner,
xorg,
xwayland,
dbus,
gobject-introspection,
gtest,
umockdev,
wlcs,
validatePkgConfig,
}:
{
version,
pinned ? false,
hash,
patches ? [ ],
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mir";
inherit version;
src = fetchFromGitHub {
owner = "canonical";
repo = "mir";
rev = "v${finalAttrs.version}";
inherit hash;
};
inherit patches;
postPatch = ''
# Fix scripts that get run in tests
patchShebangs tools/detect_fd_leaks.bash tests/acceptance-tests/wayland-generator/test_wayland_generator.sh.in
# Fix LD_PRELOADing in tests
substituteInPlace \
cmake/MirCommon.cmake \
tests/umock-acceptance-tests/CMakeLists.txt \
tests/unit-tests/platforms/gbm-kms/kms/CMakeLists.txt \
tests/unit-tests/CMakeLists.txt \
--replace-warn 'LD_PRELOAD=liblttng-ust-fork.so' 'LD_PRELOAD=${lib.getLib lttng-ust}/lib/liblttng-ust-fork.so' \
--replace-warn 'LD_PRELOAD=libumockdev-preload.so.0' 'LD_PRELOAD=${lib.getLib umockdev}/lib/libumockdev-preload.so.0'
# Fix Xwayland default
substituteInPlace src/miral/x11_support.cpp \
--replace-fail '/usr/bin/Xwayland' '${lib.getExe xwayland}'
''
+ lib.optionalString (lib.strings.versionOlder version "2.18.0") ''
# Fix paths for generating drm-formats
substituteInPlace src/platform/graphics/CMakeLists.txt \
--replace-fail "/usr/include/drm/drm_fourcc.h" "${lib.getDev libdrm}/include/libdrm/drm_fourcc.h" \
--replace-fail "/usr/include/libdrm/drm_fourcc.h" "${lib.getDev libdrm}/include/libdrm/drm_fourcc.h"
'';
strictDeps = true;
nativeBuildInputs = [
cmake
glib # gdbus-codegen
lttng-ust # lttng-gen-tp
pkg-config
(python3.withPackages (
ps:
with ps;
[ pillow ]
++ lib.optionals finalAttrs.finalPackage.doCheck [
pygobject3
python-dbusmock
]
))
validatePkgConfig
wayland-scanner
];
buildInputs = [
boost
egl-wayland
freetype
glib
glm
libdrm
libepoxy
libevdev
libglvnd
libinput
libuuid
libxcb
libxkbcommon
libxmlxx
yaml-cpp
lttng-ust
libgbm
nettle
udev
wayland
xorg.libX11
xorg.libXcursor
xorg.xorgproto
xwayland
]
++ lib.optionals (lib.strings.versionAtLeast version "2.18.0") [
libapparmor
]
++ lib.optionals (lib.strings.versionAtLeast version "2.21.0") [
pixman
]
++ lib.optionals (lib.strings.versionAtLeast version "2.22.0") [
libdisplay-info
];
nativeCheckInputs = [
dbus
gobject-introspection
]
++ lib.optionals (lib.strings.versionAtLeast version "2.22.0") [
mesa.llvmpipeHook
];
checkInputs = [
gtest
umockdev
wlcs
];
cmakeFlags = [
(lib.cmakeBool "BUILD_DOXYGEN" false)
(lib.cmakeFeature "MIR_PLATFORM" (
lib.strings.concatStringsSep ";" [
"atomic-kms"
"gbm-kms"
"eglstream-kms"
"x11"
"wayland"
]
))
(lib.cmakeBool "MIR_ENABLE_TESTS" finalAttrs.finalPackage.doCheck)
# 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.optionals (lib.strings.versionOlder version "2.22.0") [
# 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)
# https://github.com/canonical/mir/issues/2987
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106799
(lib.cmakeBool "MIR_USE_PRECOMPILED_HEADERS" false)
(lib.cmakeFeature "MIR_COMPILER_QUIRKS" (
lib.strings.concatStringsSep ";" (
lib.optionals (lib.strings.versionOlder version "2.22.0") [
# https://github.com/canonical/mir/issues/3017 actually affects x86_64 as well
"test_touchspot_controller.cpp:array-bounds"
]
)
))
];
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
preCheck = ''
export HOME=$TMP # shader cache
export XDG_RUNTIME_DIR=$TMP
'';
outputs = [
"out"
"dev"
];
passthru = {
tests = {
pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
}
// lib.optionalAttrs (!pinned) { inherit (nixosTests) miriway miracle-wm; };
providedSessions = lib.optionals (lib.strings.versionOlder version "2.16.0") [
# More of an example than a fully functioning shell, some notes for the adventurous:
# - ~/.config/miral-shell.config is one possible user config location,
# accepted options=value are according to `mir-shell --help`
# - default icon theme setting is DMZ-White, needs vanilla-dmz installed & on XCURSOR_PATH
# or setting to be changed to an available theme
# - terminal emulator setting may need to be changed if miral-terminal script
# does not know about preferred terminal
"mir-shell"
];
}
// lib.optionalAttrs (!pinned) { updateScript = ./update.sh; };
meta = {
description = "Display server and Wayland compositor developed by Canonical";
homepage = "https://mir-server.io";
changelog = "https://github.com/canonical/mir/releases/tag/v${finalAttrs.version}";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [
onny
OPNA2608
];
platforms = lib.platforms.linux;
pkgConfigModules = [
"miral"
"mircommon"
"mircore"
"miroil"
"mirplatform"
"mir-renderer-gl-dev"
"mirrenderer"
"mirserver"
"mirtest"
"mirwayland"
]
++ lib.optionals (lib.strings.versionOlder version "2.17.0") [ "mircookie" ]
++ lib.optionals (lib.strings.versionAtLeast version "2.17.0") [
"mircommon-internal"
"mirserver-internal"
];
};
})

View File

@@ -0,0 +1,114 @@
{ callPackage, fetchpatch }:
let
common = callPackage ./common.nix { };
in
{
mir = common {
version = "2.22.1";
hash = "sha256-NESLpKedoI+WjnwmtmdTvqo+mbCopb2wCA5J4t49YSk=";
};
mir_2_15 = common {
version = "2.15.0";
pinned = true;
hash = "sha256-c1+gxzLEtNCjR/mx76O5QElQ8+AO4WsfcG7Wy1+nC6E=";
patches = [
# Fix gbm-kms tests
# Remove when version > 2.15.0
(fetchpatch {
name = "0001-mir-Fix-the-signature-of-drmModeCrtcSetGamma.patch";
url = "https://github.com/canonical/mir/commit/98250e9c32c5b9b940da2fb0a32d8139bbc68157.patch";
hash = "sha256-tTtOHGNue5rsppOIQSfkOH5sVfFSn/KPGHmubNlRtLI=";
})
# Fix external_client tests
# Remove when version > 2.15.0
(fetchpatch {
name = "0002-mir-Fix-cannot_start_X_Server_and_outdated_tests.patch";
url = "https://github.com/canonical/mir/commit/0704026bd06372ea8286a46d8c939286dd8a8c68.patch";
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=";
})
# Exclude known-flaky tests
# Remove when version > 2.15.0
(fetchpatch {
name = "0004-mir-exclude-tests-surfaces_with_exclusive_zone_set_to_negative_one_do_not_respect_other_exclusive_zones-1.patch";
url = "https://github.com/canonical/mir/commit/967d872daab50d845adce389c0672edfd18b90c9.patch";
hash = "sha256-XfTWQj+fmPpC1hIqt7ELGU6Yq2wJSO+FQ8bsikI5h0I=";
})
(fetchpatch {
name = "0005-mir-exclude-tests-surfaces_with_exclusive_zone_set_to_negative_one_do_not_respect_other_exclusive_zones-2.patch";
url = "https://github.com/canonical/mir/commit/932d8744852bca9830668018474890bce0c5f6d6.patch";
hash = "sha256-+udEt6pF5VLSBtRgo9r1YdVsinARWLAL4AeEG01DV68=";
})
(fetchpatch {
name = "0006-mir-exclude-tests-surfaces_with_exclusive_zone_set_to_negative_one_do_not_respect_other_exclusive_zones-3.patch";
url = "https://github.com/canonical/mir/commit/fbad5e50be02992f6cf1f41f928950532f3f62c5.patch";
hash = "sha256-J0YEhXf8sAWEHHxU7QKSJjOoHiXsYqotBfgGm79X6GA=";
})
# 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
./1001-mir-2_15-Fix-ignored-return-value-of-std-lock_guard.patch
# Fix missing includes for methods from algorithm
# Remove when version > 2.16.4
# https://github.com/canonical/mir/pull/3191 backported to 2.15
./1002-mir-2_15-Add-missing-includes-for-algorithm.patch
# Fix order of calloc arguments
# Remove when version > 2.16.4
# 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=";
})
# Fix compat with newer GTest
# Remove when version > 2.21.1
(fetchpatch {
name = "0201-Fix-gtest-nodiscard-error.patch";
url = "https://github.com/canonical/mir/commit/60dab2b197deb159087e44865e7314ad2865b79d.patch";
includes = [
"tests/integration-tests/input/test_single_seat_setup.cpp"
"tests/unit-tests/input/test_default_input_device_hub.cpp"
];
hash = "sha256-gzLVQW9Z6y+s2D7pKtp0ondQrjkzZ5iUYhGDPqFXD5M=";
})
];
};
}

8
pkgs/servers/mir/update.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl gnused jq common-updater-scripts
set -eou pipefail
version="$(curl --silent "https://api.github.com/repos/canonical/mir/tags" | jq '.[0].name' --raw-output)"
update-source-version mir "${version:1}" --file=./pkgs/servers/mir/default.nix