Package: debhelper
Version: 13.1
Severity: important

After the release of debhelper 13.1, mutter fails to build from source
with test failures. I can reproduce the build failure with a previous
version of mutter that used to build successfully.

>From the build log, the failing tests are failing with errors like this:

> (actor-anchors:15901): mutter-WARNING **: 09:33:40.658: WL: error: socket 
> path 
> "/<<PKGBUILDDIR>>/debian/.debhelper/generated/_source/xdg-runtime-dir/mutter-test-display-WV9YK0"
>  plus null terminator exceeds 108 bytes
> (actor-anchors:15901): mutter-ERROR **: 09:33:40.658: Failed to create_socket

I think mutter-test-display-WV9YK0 is a Wayland socket, which are
defined to be in the $XDG_RUNTIME_DIR. AF_UNIX sockets have to fit in
a fixed-length data structure (struct sockaddr_un, which has 108 bytes
available for the path on Linux) so they can't exist in directories with
really long paths. I've had this problem in the past with Telepathy and
D-Bus unit tests that tried to use a socket in the build directory, and
resolved it there by using a socket in (a temporary directory in) /tmp.

Having a place to put AF_UNIX sockets and other rendezvous points is the
purpose of the $XDG_RUNTIME_DIR, so its absolute path ought to be short
enough to have AF_UNIX sockets with a reasonable length available for
the basename. This is also potentially an issue for $HOME, but sockets
are a smaller fraction of the purpose of $HOME, so it's perhaps less
critical there.

In systemd's implementation (which is more or less the reference), the real
$XDG_RUNTIME_DIR is "/run/user/$uid", leaving 90+ bytes available for the
suffix of an AF_UNIX socket.

Some ideas:

* Maybe use shorter path segments: debian/.dh/gen/_s/xrd instead of
  debian/.debhelper/generated/_source/xdg-runtime-dir?

* Maybe use a random temporary directory /tmp/dh-xrd-XXXXXX for the
  XDG_RUNTIME_DIR instead of having it in the build directory, perhaps
  with a symlink in debian/.debhelper to make it easier to find?

* Or maybe create a random temporary directory /tmp/dh-XXXXXX with
  symlinks /tmp/dh-XXXXXX/xrd -> .../debian/.debhelper/... and
  /tmp/dh-XXXXXX/home -> .../debian/.debhelper/..., and then set
  HOME=/tmp/dh-XXXXXX/home and XDG_RUNTIME_DIR=/tmp/dh-XXXXXX/xrd
  instead of using the physical paths? (I don't know whether that would
  solve the problem for AF_UNIX sockets though - they might try to put
  the canonicalized physical path in a struct sockaddr_un, rather than
  the symlink.)

For now I'm going to put a workaround in mutter to create its own
temporary XDG_RUNTIME_DIR, but it seems a shame not to be able to take
advantage of debhelper solving this problem centrally.

    smcv

Reply via email to