Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package xwayland-run for openSUSE:Factory 
checked in at 2024-07-15 19:49:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xwayland-run (Old)
 and      /work/SRC/openSUSE:Factory/.xwayland-run.new.17339 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "xwayland-run"

Mon Jul 15 19:49:20 2024 rev:4 rq:1187417 version:0.0.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/xwayland-run/xwayland-run.changes        
2024-03-25 21:19:41.594750217 +0100
+++ /work/SRC/openSUSE:Factory/.xwayland-run.new.17339/xwayland-run.changes     
2024-07-15 19:49:54.633080924 +0200
@@ -1,0 +2,16 @@
+Sun Jul 14 23:51:26 UTC 2024 - Neal Gompa <ngo...@opensuse.org>
+
+- Update to 0.0.4
+  + xwayland: Improve xauth errors
+  + common: Improve error reporting
+  + common: Ignore setpgrp() failures
+  + mutter: Add a virtual monitor by default
+  + mutter: Check whether --no-x11 is supported
+  + common: Recursively remove our temporary XDG_RUNTIME_DIR
+  + commit: Wait for child processes before cleanup
+- Backport fix for waitpid errors
+  + Patch: 0001-wlheadless-Ignore-os.waitpid-1-0-error.patch
+- Add Suggests for default compositor
+- Set mutter as the default compositor for SLE
+
+-------------------------------------------------------------------

Old:
----
  xwayland-run-0.0.3.tar.gz

New:
----
  0001-wlheadless-Ignore-os.waitpid-1-0-error.patch
  xwayland-run-0.0.4.tar.gz

BETA DEBUG BEGIN:
  New:- Backport fix for waitpid errors
  + Patch: 0001-wlheadless-Ignore-os.waitpid-1-0-error.patch
- Add Suggests for default compositor
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ xwayland-run.spec ++++++
--- /var/tmp/diff_new_pack.bsB3p3/_old  2024-07-15 19:49:55.217102440 +0200
+++ /var/tmp/diff_new_pack.bsB3p3/_new  2024-07-15 19:49:55.221102587 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           xwayland-run
-Version:        0.0.3
+Version:        0.0.4
 Release:        0
 Summary:        Set of utilities to run headless X/Wayland clients
 
@@ -25,6 +25,9 @@
 URL:            https://gitlab.freedesktop.org/ofourdan/xwayland-run
 Source0:        %{url}/-/archive/%{version}/%{name}-%{version}.tar.gz
 
+# https://gitlab.freedesktop.org/ofourdan/xwayland-run/-/merge_requests/19
+Patch0001:      0001-wlheadless-Ignore-os.waitpid-1-0-error.patch
+
 BuildArch:      noarch
 
 BuildRequires:  meson >= 0.60.0
@@ -32,6 +35,19 @@
 BuildRequires:  python3-devel
 Requires:       (weston or cage or kwin6 or kwin5 or mutter or gnome-kiosk)
 Requires:       xorg-x11-server-wayland
+%if 0%{?suse_version} && 0%{?suse_version} < 1600
+Requires:       dbus-1
+%else
+Requires:       dbus-1-daemon
+%endif
+Requires:       xauth
+
+# Handle preference for boolean dep on compositor
+%if 0%{?sle_version}
+Suggests:       mutter
+%else
+Suggests:       weston
+%endif
 
 # Provide names of the other utilities included
 Provides:       wlheadless-run = %{version}-%{release}
@@ -47,7 +63,7 @@
 
 
 %build
-%meson
+%meson %{?sle_version:-Dcompositor=mutter}
 %meson_build
 
 

++++++ 0001-wlheadless-Ignore-os.waitpid-1-0-error.patch ++++++
>From 2f43fc2d1b57c7945576bf2950b236416c0403dd Mon Sep 17 00:00:00 2001
From: Niels De Graef <ndegr...@redhat.com>
Date: Thu, 4 Jul 2024 17:09:41 +0200
Subject: [PATCH] wlheadless: Ignore os.waitpid(-1, 0) error

There's a chance that all child processes have already stopped running
by the time we're cleaning up. If we then try to wait on child processes
to finish (using `os.waitpid(-1, 0)`, the function will throw a
`ChildProcessError`, which makes the whole script fail, with the
following error message:

```
Traceback (most recent call last):
  File "/usr/bin/wlheadless-run", line 90, in <module>
    wlheadless_common.cleanup()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/site-packages/wlheadless/wlheadless_common.py", 
line 151, in cleanup
    self.__cleanup_tempdir()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/site-packages/wlheadless/wlheadless_common.py", 
line 136, in __cleanup_tempdir
    os.waitpid(-1, 0)
    ~~~~~~~~~~^^^^^^^
ChildProcessError: [Errno 10] No child processes
```

Just ignore the error if it happens.
---
 src/wlheadless/wlheadless_common.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/wlheadless/wlheadless_common.py 
b/src/wlheadless/wlheadless_common.py
index 556c0f7..d056f3b 100644
--- a/src/wlheadless/wlheadless_common.py
+++ b/src/wlheadless/wlheadless_common.py
@@ -133,7 +133,10 @@ class WlheadlessCommon:
     def __cleanup_tempdir(self):
         """ Removes our temporary XDG_RUNTIME_DIR directory if empty. """
         if self.xdg_runtime_dir:
-            os.waitpid(-1, 0)
+            try:
+                os.waitpid(-1, 0)
+            except ChildProcessError:
+                pass
             try:
                 rmtree(self.xdg_runtime_dir)
             except OSError as error:
-- 
2.45.2


++++++ xwayland-run-0.0.3.tar.gz -> xwayland-run-0.0.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xwayland-run-0.0.3/meson.build 
new/xwayland-run-0.0.4/meson.build
--- old/xwayland-run-0.0.3/meson.build  2024-03-19 08:54:53.000000000 +0100
+++ new/xwayland-run-0.0.4/meson.build  2024-06-28 15:57:52.000000000 +0200
@@ -1,5 +1,5 @@
 project('xwayland-run',
-        version: '0.0.3',
+        version: '0.0.4',
         license: 'GPL-2.0-or-later',
         meson_version: '>= 0.60.0')
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xwayland-run-0.0.3/src/wlheadless/gnome-kiosk.py 
new/xwayland-run-0.0.4/src/wlheadless/gnome-kiosk.py
--- old/xwayland-run-0.0.3/src/wlheadless/gnome-kiosk.py        2024-03-19 
08:54:53.000000000 +0100
+++ new/xwayland-run-0.0.4/src/wlheadless/gnome-kiosk.py        2024-06-28 
15:57:52.000000000 +0200
@@ -41,11 +41,11 @@
             'dbus-run-session',
             'gnome-kiosk',
             '--wayland',
-            '--no-x11',
-            '--headless'
+            '--headless',
         ]
         self.wlheadless_common = WlheadlessCommon()
         self.xwayland = Xwayland()
+        self.options = 
self.wlheadless_common.get_command_output(['gnome-kiosk', '-h'])
 
 
     def spawn_client(self, command_args):
@@ -68,7 +68,14 @@
         """Starts the Wayland compositor."""
         wayland_display = 'wayland-' + format(getpid())
         environ['WAYLAND_DISPLAY'] = wayland_display
+        # Add at least one virtual monitor if none is specified
+        if not '--virtual-monitor' in compositor_args:
+            compositor_args.extend(['--virtual-monitor', '1024x768'])
         compositor = self.compositor
+        # The option '--no-x11' might not be supported if mutter was built
+        # without X11 support.
+        if '--no-x11' in self.options:
+            compositor.extend(['--no-x11'])
         compositor.extend(compositor_args)
         compositor.extend(['--wayland-display', format(wayland_display)])
         return self.wlheadless_common.run_compositor(compositor)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xwayland-run-0.0.3/src/wlheadless/mutter.py 
new/xwayland-run-0.0.4/src/wlheadless/mutter.py
--- old/xwayland-run-0.0.3/src/wlheadless/mutter.py     2024-03-19 
08:54:53.000000000 +0100
+++ new/xwayland-run-0.0.4/src/wlheadless/mutter.py     2024-06-28 
15:57:52.000000000 +0200
@@ -41,11 +41,11 @@
             'dbus-run-session',
             'mutter',
             '--wayland',
-            '--no-x11',
             '--headless',
         ]
         self.wlheadless_common = WlheadlessCommon()
         self.xwayland = Xwayland()
+        self.options = self.wlheadless_common.get_command_output(['mutter', 
'-h'])
 
 
     def spawn_client(self, command_args):
@@ -53,6 +53,10 @@
         wayland_display = 'wayland-' + format(getpid())
         environ['WAYLAND_DISPLAY'] = wayland_display
         compositor = self.compositor
+        # The option '--no-x11' might not be supported if mutter was built
+        # without X11 support.
+        if '--no-x11' in self.options:
+            compositor.extend(['--no-x11'])
         compositor.extend(self.compositor_args)
         compositor.extend(['--wayland-display', format(wayland_display)])
         compositor.extend(['--'])
@@ -63,6 +67,8 @@
     def spawn_xwayland(self, xserver_args = []):
         """Helper function to spawn mutter and Xwayland at once."""
         compositor = self.compositor
+        if '--no-x11' in self.options:
+            compositor.extend(['--no-x11'])
         compositor.extend(self.compositor_args)
         compositor.extend(['--'])
         xserver_args.extend(['-fullscreen'])
@@ -76,6 +82,9 @@
 
     def run_compositor(self, compositor_args = []):
         """Starts the Wayland compositor."""
+        # Add at least one virtual monitor if none is specified
+        if not '--virtual-monitor' in compositor_args:
+            compositor_args.extend(['--virtual-monitor', '1024x768'])
         # Just save the given args for when we shall actually spawn the 
compositor.
         self.compositor_args = compositor_args
         return 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/xwayland-run-0.0.3/src/wlheadless/wlheadless_common.py 
new/xwayland-run-0.0.4/src/wlheadless/wlheadless_common.py
--- old/xwayland-run-0.0.3/src/wlheadless/wlheadless_common.py  2024-03-19 
08:54:53.000000000 +0100
+++ new/xwayland-run-0.0.4/src/wlheadless/wlheadless_common.py  2024-06-28 
15:57:52.000000000 +0200
@@ -26,6 +26,7 @@
 import os
 import subprocess
 import socket
+from shutil import rmtree
 from signal import signal, SIGTERM, SIG_IGN
 from tempfile import mkdtemp
 from time import sleep
@@ -43,13 +44,25 @@
 
 
     def __init__(self):
-        os.setpgrp()
+        try:
+            os.setpgrp()
+        except Exception as error:
+            print(f'Warning, failed to create process group: {error}\n')
         self.xdg_runtime_dir = None
         if not os.getenv('XDG_RUNTIME_DIR'):
             self.xdg_runtime_dir = mkdtemp()
             os.environ['XDG_RUNTIME_DIR'] = self.xdg_runtime_dir
 
 
+    def get_command_output(self, command):
+        try:
+            output = subprocess.check_output(command)
+        except Exception as error:
+            print(f'Failed to run command: {error}\n')
+            return []
+        return (output.decode()).split()
+
+
     def load_compositor(self, compositor):
         try:
             module = importlib.import_module('wlheadless.' + compositor)
@@ -76,7 +89,7 @@
             with subprocess.Popen(command) as proc:
                 proc.wait()
                 return proc.returncode
-        except subprocess.SubprocessError as error:
+        except Exception as error:
             print(f'Failed to run the command: {error}\n')
             return -1
         except KeyboardInterrupt:
@@ -110,7 +123,7 @@
         try:
             proc = subprocess.Popen(compositor)
             return proc.pid
-        except subprocess.SubprocessError as error:
+        except Exception as error:
             print(f'Failed to start the compositor: {error}\n')
             return -1
         except KeyboardInterrupt:
@@ -120,8 +133,9 @@
     def __cleanup_tempdir(self):
         """ Removes our temporary XDG_RUNTIME_DIR directory if empty. """
         if self.xdg_runtime_dir:
+            os.waitpid(-1, 0)
             try:
-                os.rmdir(self.xdg_runtime_dir)
+                rmtree(self.xdg_runtime_dir)
             except OSError as error:
                 print(f'Error removing directory {self.xdg_runtime_dir}: 
{error}\n')
 
@@ -129,6 +143,9 @@
     def cleanup(self):
         """ Clean-up function """
         handler = signal(SIGTERM, SIG_IGN)
-        os.killpg(os.getpgid(0), SIGTERM)
+        try:
+            os.killpg(os.getpgid(0), SIGTERM)
+        except Exception as error:
+            print(f'Warning, failed to kill process group: {error}\n')
         signal(SIGTERM, handler)
         self.__cleanup_tempdir()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xwayland-run-0.0.3/src/wlheadless/xwayland.py 
new/xwayland-run-0.0.4/src/wlheadless/xwayland.py
--- old/xwayland-run-0.0.3/src/wlheadless/xwayland.py   2024-03-19 
08:54:53.000000000 +0100
+++ new/xwayland-run-0.0.4/src/wlheadless/xwayland.py   2024-06-28 
15:57:52.000000000 +0200
@@ -42,7 +42,10 @@
     def __init__(self):
         self.tempdir = None
         self.xauthfile = None
-        os.setpgrp()
+        try:
+            os.setpgrp()
+        except Exception as error:
+            print(f'Warning, failed to create process group: {error}\n')
 
 
     def run_command(self, command):
@@ -51,7 +54,7 @@
             with subprocess.Popen(command) as proc:
                 proc.wait()
                 return proc.returncode
-        except subprocess.SubprocessError as error:
+        except Exception as error:
             print(f'Failed to run the command: {error}\n')
             return -1
         except KeyboardInterrupt:
@@ -71,7 +74,7 @@
                 return -1
             os.environ['DISPLAY'] = f':{disp_num}'
             return proc.pid
-        except subprocess.CalledProcessError as error:
+        except Exception as error:
             print(f'Failed to start Xwayland: {error}\n')
             return -1
 
@@ -110,8 +113,8 @@
                 if proc.returncode != 0:
                     print('Failed to add xauth entry!\n')
                 return proc.returncode
-        except subprocess.SubprocessError:
-            print('Failed to spawn xauth\n!')
+        except Exception as error:
+            print(f'Failed to execute xauth: {error}\n - Is xauth 
installed?\n')
             return -1
 
 
@@ -121,8 +124,8 @@
         try:
             with subprocess.Popen(xauth_command_line) as proc:
                 proc.wait()
-        except subprocess.SubprocessError:
-            print('Failed to run xauth to remove the entry in Xauthority\n!')
+        except Exception as error:
+            print(f'Failed to run xauth to remove the entry in Xauthority: 
{error}\n')
 
 
     def setup_tempdir(self):
@@ -142,7 +145,10 @@
     def cleanup(self):
         """ Clean-up function. """
         handler = signal(SIGTERM, SIG_IGN)
-        os.killpg(os.getpgid(0), SIGTERM)
+        try:
+            os.killpg(os.getpgid(0), SIGTERM)
+        except Exception as error:
+            print(f'Warning, failed to kill process group: {error}\n')
         signal(SIGTERM, handler)
         self.remove_xauth_entry()
         self.cleanup_xauth()

Reply via email to