Skip to content

Correct way to export $DISPLAY to bst shell #1406

@BuildStream-Migration-Bot

Description

See original issue on GitLab
In GitLab by [Gitlab user @tcanabrava] on Oct 13, 2020, 18:58

I'm not really sure if this is a bug or not, probably a misconfiguration, but I have not found any documentation about it.
I'm trying to compile a Application that uses a X11 socket - the simplest one that I can think of, xorg-xdpyinfo.
it compiles but does not run with the following error:

No protocol specified
xdpyinfo:  unable to open display ":0".

I'm running on X11 and I can't use wayland currently.
my project.conf has the following special configuration - extracted from gnome-build-meta - and changed to add the X11 unix socket:

shell:
  command: ['bash', '--noprofile', '--norc', '-i']
  environment:
    LANG: '$LANG'
    DISPLAY: '$DISPLAY'
    DBUS_SESSION_BUS_ADDRESS: '$DBUS_SESSION_BUS_ADDRESS'
    XDG_RUNTIME_DIR: '$XDG_RUNTIME_DIR'

    # Inform applications which use pulseaudio of the server socket
    PULSE_SERVER: 'unix:${XDG_RUNTIME_DIR}/pulse/native'

  # Some things to mount into the sandbox
  host-files:
  # Understand user inherited uid/gid
  - '/etc/passwd'
  - '/etc/group'
  # Allow network resolution
  - '/etc/resolv.conf'

  - '/tmp/.X11-unix'

I'm on a graphical session:

/data/Projects/Buildstream/kde-build-meta on  master! ⌚ 18:52:42
$ echo $DISPLAY
:0

And /tmp/.X11-unix does exist:

/data/Projects/Buildstream/kde-build-meta on  master! ⌚ 18:56:41
$ ls /tmp/.X11-unix 
X0

At first I assumed it was a bug in my configuration, but then I tested with gnome-build-meta and that got me similar results.

So, What's the correct way to use buildstream shell to launch graphical applications in X11 systems?

Metadata

Metadata

Assignees

No one assigned

    Labels

    needinfoRequires additional information to investigate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions