Bug#1093464: spurious error message if XDG_RUNTIME_DIR is not set

2025-12-04 Thread Vincent Lefevre
Control: reassign -1 libwine 10.0~rc2~repack-2
Control: found -1 10.0~repack-12

The error also occurs when running /usr/bin/wine64-stable directly,
without the wine package installed.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)



Bug#1093464: spurious error message if XDG_RUNTIME_DIR is not set

2025-12-04 Thread Vincent Lefevre
On 2025-11-11 15:35:42 +0100, Bill Allombert wrote:
> On Tue, Apr 08, 2025 at 07:37:52PM +0100, Simon McVittie wrote:
> > On Sun, 19 Jan 2025 at 00:14:17 +0100, Bill Allombert wrote:
> > > I run wine in text mode in a CI cronjob (so XDG_RUNTIME_DIR is not 
> > > defined).
> > > Since I upgraded wine, it reports a spurious error message:
> > > error: XDG_RUNTIME_DIR is invalid or not set in the environment.
> > > even though I set WINEDEBUG=-all

This reminds me the following when DISPLAY is set:
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=914822

> > I believe this message comes from libwayland-client, and cannot easily be
> > suppressed by a caller.
> > (https://codesearch.debian.net/search?q=XDG_RUNTIME_DIR+is+invalid+or+not+set+in+the+environment&literal=1)
> 
> Thanks for this info!
> FWIW, I do not see why libwayland-client should expect
> XDG_RUNTIME_DIR to be set. This seems like a major layering
> violation. One should be able to use wayland without using a desktop
> environment.

Well, XDG_RUNTIME_DIR has nothing to do with desktop environments, not
even with graphical displays. It is set by pam_systemd at login time,
e.g. also via ssh without a graphical display. See the pam_systemd(8)
man page.

Note that wine uses /run/user/$UID (which is normally identical to
$XDG_RUNTIME_DIR) even when XDG_RUNTIME_DIR is unset, as I can see
changes under "/run/user/$UID/wine". Since $XDG_RUNTIME_DIR is
"automatically created the first time a user logs in and removed on
the user's final logout" (pam_systemd(8) man page), I'm wondering
whether wine is correct anyway: this directory may be removed while
wine is still running in the background.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)



Bug#1093464: spurious error message if XDG_RUNTIME_DIR is not set

2025-11-11 Thread Bill Allombert
On Tue, Apr 08, 2025 at 07:37:52PM +0100, Simon McVittie wrote:
> On Sun, 19 Jan 2025 at 00:14:17 +0100, Bill Allombert wrote:
> > I run wine in text mode in a CI cronjob (so XDG_RUNTIME_DIR is not defined).
> > Since I upgraded wine, it reports a spurious error message:
> > error: XDG_RUNTIME_DIR is invalid or not set in the environment.
> > even though I set WINEDEBUG=-all
> 
> I believe this message comes from libwayland-client, and cannot easily be
> suppressed by a caller.
> (https://codesearch.debian.net/search?q=XDG_RUNTIME_DIR+is+invalid+or+not+set+in+the+environment&literal=1)

Thanks for this info!
FWIW, I do not see why libwayland-client should expect XDG_RUNTIME_DIR to be 
set.
This seems like a major layering violation. One should be able to use wayland 
without
using a desktop environment.

Cheers,
-- 
Bill. 

Imagine a large red swirl here. 



Bug#1093464: spurious error message if XDG_RUNTIME_DIR is not set

2025-11-01 Thread Michael Gilbert
control: tag -1 patch

I didn't quickly get a headless or other setup to reproduce the
original problem but went ahead and developed a potential fix based on
smcv's suggestion.

Please try the short patch attached, I don't currently have a way to test.

Best wishes,
Mike
description: eliminate spurious message when wayland is not active
bug-debian: https://bugs.debian.org/1093464
author: Michael Gilbert 

--- a/dlls/winewayland.drv/waylanddrv_main.c
+++ b/dlls/winewayland.drv/waylanddrv_main.c
@@ -82,6 +82,16 @@ static void wayland_init_process_name(vo
 
 static NTSTATUS waylanddrv_unix_init(void *arg)
 {
+/* Is there indication of an active wayland session (debian bug #1093464)? */
+if (!secure_getenv("WAYLAND_DISPLAY"))
+{
+const char *wayland = "wayland";
+const char *session = secure_getenv("XDG_SESSION_TYPE");
+
+if (!session) return STATUS_UNSUCCESSFUL;
+if (strncasecmp(session, wayland, strlen(wayland))) return STATUS_UNSUCCESSFUL;
+}
+
 /* Set the user driver functions now so that they are available during
  * our initialization. We clear them on error. */
 __wine_set_user_driver(&waylanddrv_funcs, WINE_GDI_DRIVER_VERSION);


Bug#1093464: spurious error message if XDG_RUNTIME_DIR is not set

2025-04-08 Thread Simon McVittie

On Sun, 19 Jan 2025 at 00:14:17 +0100, Bill Allombert wrote:

I run wine in text mode in a CI cronjob (so XDG_RUNTIME_DIR is not defined).
Since I upgraded wine, it reports a spurious error message:
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
even though I set WINEDEBUG=-all


I believe this message comes from libwayland-client, and cannot easily 
be suppressed by a caller.

(https://codesearch.debian.net/search?q=XDG_RUNTIME_DIR+is+invalid+or+not+set+in+the+environment&literal=1)

Some Wayland clients avoid this error message by only attempting to 
connect to a Wayland display if there is some sort of evidence that 
there ought to be a functioning Wayland session. For example, SDL only 
tries to use Wayland if $WAYLAND_DISPLAY is set, or if $XDG_SESSION_TYPE 
is set to "wayland". Wine could maybe do similarly.


(Or, your cron job could create a temporary XDG_RUNTIME_DIR for the 
duration of running Wine things.)


smcv



Bug#1093464: spurious error message if XDG_RUNTIME_DIR is not set

2025-01-18 Thread Bill Allombert
Package: wine
Version: 10.0~rc2~repack-2
Severity: normal

Dear Debian Wine party,

I run wine in text mode in a CI cronjob (so XDG_RUNTIME_DIR is not defined).
Since I upgraded wine, it reports a spurious error message:
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
even though I set WINEDEBUG=-all
This causes the output of wine to be broken and break the build.

Cheers,
Bill.