~eliasnaur/gio#40: 
wayland: wl_display_connect failed - Cannot get this to run!

Just starting to look at this. Have tried downloading the hello.go file, builds ok. But running with same issue:

wayland: wl_display_connect failed

From the linux install page I have done the following:

sudo apt install libwayland-dev libxkbcommon-dev libgles2-mesa-dev libegl1-mesa-dev
I have rebooted but it did not help!

go version:

go version go1.12.5 linux/amd64

OS is :

Linux Mint 19.2 Cinnamon 4.2.4

Kernel:

4.15.0-65-generic

So I did the following in a clean directory!

user:~/git/tmp$ export GO111MODULE=on user:~/git/tmp$ go run gioui.org/apps/hello

go: finding gioui.org/apps/hello latest go: finding gioui.org/apps latest go: downloading gioui.org/apps v0.0.0-20191004171805-f230036cad23 go: extracting gioui.org/apps v0.0.0-20191004171805-f230036cad23 go: finding github.com/google/go-github/v24 v24.0.1 go: finding gioui.org v0.0.0-20191003113538-6dad034b2280 go: finding golang.org/x/exp v0.0.0-20190627132806-fd42eb6b336f go: finding golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 go: finding golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 go: finding golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e go: finding google.golang.org/appengine v1.4.0 go: finding cloud.google.com/go v0.34.0 go: finding golang.org/x/net v0.0.0-20180826012351-8a410e7b638d go: finding google.golang.org/appengine v1.1.0 go: finding github.com/google/go-github v17.0.0+incompatible go: finding github.com/golang/protobuf v1.2.0 go: finding github.com/google/go-querystring v1.0.0 go: finding golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be go: finding golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac go: finding golang.org/x/sys v0.0.0-20180824143301-4910a1d54f87 go: finding golang.org/x/sys v0.0.0-20190312061237-fead79001313 go: finding github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 go: finding golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6 go: finding golang.org/x/image v0.0.0-20190227222117-0694c2d4d067 go: finding golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846 go: finding golang.org/x/net v0.0.0-20180724234803-3673e40ba225 go: finding golang.org/x/net v0.0.0-20190311183353-d8887717615a go: downloading gioui.org v0.0.0-20191003113538-6dad034b2280 go: extracting gioui.org v0.0.0-20191003113538-6dad034b2280 go: downloading golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9 go: extracting golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9 2019/10/04 18:28:21 wayland: wl_display_connect failed exit status 1

Status
RESOLVED DUPLICATE
Submitter
~stuartdd
Assigned to
No-one
Submitted
1 year, 8 months ago
Updated
6 months ago
Labels
No labels applied.

~eliasnaur 1 year, 8 months ago

Are you running Wayland? If not, this is a duplicate of #8, missing X11 support.

~stuartdd 1 year, 8 months ago

Further to my earlier reply. This is from the Mint user groups:


Well, from a Mint point of view we’ve no plan to use it just yet. Xorg is a much better solution still in the scope of our distribution. Wayland is promising because it will solve some important issues we’re having with Xorg but it’s far from ready in terms of what it supports and what supports it.

From a development point of view nobody’s really asking for it, Arch, Fedora are happy to use MATE and Cinnamon as they are.. and nobody’s really working on it whether it’s in MATE or Cinnamon.

We’re not opposed to seeing it happen, it’s just something that “might” work “one day” and it’s not a priority. It’s also something that requires a significant amount of work so it doesn’t make sense to look into it much at the moment. Things might change in the future, but this is the current situation.


So I cannot really enable it on Mint and Mint have no plan to use it.

So I will need to wait for Mint or Gio on X11.

Regards

Stuart

On 04/10/2019 19:01, ~eliasnaur wrote:

Are you running Wayland? If not, this is a duplicate of #8, missing X11 support.

~eliasnaur REPORTED DUPLICATE 1 year, 8 months ago

~raqbit 1 year, 5 months ago

Hi, I cannot run this either while running in a Gnome Wayland session.

$ loginctl show-session 2 | grep Type
Type=wayland
$go run -tags nox11 gioui.org/example/hello
2020/01/01 19:41:03 wayland: wl_display_connect failed
exit status 1

System details

go version go1.13.5 linux/amd64
Ubuntu 19.10

~eliasnaur 1 year, 5 months ago

On Wed Jan 1, 2020 at 6:42 PM, ~raqbit wrote:

Hi, I cannot run this either while running in a Gnome Wayland session.

$ loginctl show-session 2 | grep Type
Type=wayland
$go run
-tags nox11 gioui.org/example/hello
2020/01/01 19:41:03 wayland:
wl_display_connect failed
exit status 1

System details



go version go1.13.5 linux/amd64
Ubuntu 19.10

I can't explain why wl_display_connect fails. I've pushed a change that adds errno to the error message, can you please try again? Make sure you're using the latest version by running

$ go get gioui.org@ccbcbdbfbd4f3aa4c01c36566ea48b118730242f

before go run ....

~raqbit 1 year, 5 months ago

I'm not sure if it's grabbing the go-get'd version of gio, as it says downloading when using the run command.

$  go clean --modcache
$ ls $GOPATH/pkg/mod
ls: cannot access '<$GOPATH>/pkg/mod': No such file or directory

$ go get gioui.org@ccbcbdbfbd4f3aa4c01c36566ea48b118730242f
go: finding gioui.org ccbcbdbfbd4f3aa4c01c36566ea48b118730242f
go: downloading gioui.org v0.0.0-20200103103112-ccbcbdbfbd4f
go: extracting gioui.org v0.0.0-20200103103112-ccbcbdbfbd4f

$ go run -tags nox11 gioui.org/example/hello               
go: downloading gioui.org/example v0.0.0-20200103103112-ccbcbdbfbd4f
go: extracting gioui.org/example v0.0.0-20200103103112-ccbcbdbfbd4f
go: downloading golang.org/x/image v0.0.0-20190802002840-cff245a6509b
go: downloading golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3
go: extracting golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3
go: extracting golang.org/x/image v0.0.0-20190802002840-cff245a6509b
go: downloading golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a
go: downloading golang.org/x/text v0.3.0
go: extracting golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a
go: extracting golang.org/x/text v0.3.0
go: finding gioui.org/example v0.0.0-20200103103112-ccbcbdbfbd4f
go: finding golang.org/x/image v0.0.0-20190802002840-cff245a6509b
go: finding golang.org/x/text v0.3.0
go: finding golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3
go: finding golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a
2020/01/03 22:01:33 wayland: wl_display_connect failed: no such file or directory
exit status 1

~eliasnaur 1 year, 5 months ago

On Fri Jan 3, 2020 at 9:03 PM, ~raqbit wrote:

I'm not sure if it's grabbing the go-get'd version of gio, as it says downloading when using the run command.

$ go run -tags nox11 gioui.org/example/hello 2020/01/03 22:01:33 wayland:

Thanks, it looks like you're running the correct version, because the errno says "no such file or directory":

wl_display_connect failed: no such file or directory exit status 1

Unfortunately, I still don't know what's causing wl_display_connect to fail. Is the X11 version running (it appears so, since you've specified the nox11 tag)?

What are the values of the WAYLAND_DISPLAY and WAYLAND_SOCKET environment variables?

-- elias

~raqbit 1 year, 5 months ago

Yes, The X11 version runs fine.

$ echo "\"$WAYLAND_DISPLAY\"-\"$WAYLAND_SOCKET\""
"wayland-0"-""

~eliasnaur 1 year, 5 months ago

On Sun Jan 5, 2020 at 11:34 AM, ~raqbit wrote:

Yes, The X11 version runs fine.

$ echo
"\"$WAYLAND_DISPLAY\"-\"$WAYLAND_SOCKET\""
"wayland-0"-""

Looks good to me. Perhaps strace can help figure out where the "no such file or directory" comes from:

$ go build gioui.org/example/hello
$ strace -f ./hello

~pierrec 6 months ago*

I am seeing the same issue, and it has to do with the wayland display file name not being set in gio (app/internal/window/os_wayland.go:L1486).

Hacking it for now to move forward with:

dpyName := filepath.Join(
		os.Getenv("XDG_RUNTIME_DIR"),
		"..", //TODO only valid on ubuntu (skip the snap dir)?
		os.Getenv("WAYLAND_DISPLAY"),
	)
	cdpyName := C.CString(dpyName)
	defer C.free(unsafe.Pointer(cdpyName))
	d.disp, err = C.wl_display_connect(cdpyName)

~eliasnaur 6 months ago

On Wed Nov 18, 2020 at 8:38 PM CET, ~pierrec wrote:

I am seeing the same issue, and it has to do with the wayland display file name not being set in gio (app/internal/window/os_wayland.go:L1486).

I don't follow. The documentation for wl_display_connect[0] mention both XDG_RUNTIME_DIR and WAYLAND_DISPLAY.

Not finding the socket seems like a system misconfiguration to me. Do other Wayland clients work in the environment you're running Gio programs in?

Hacking it for now to move forward with: dpyName := filepath.Join(

		

os.Getenv("XDG_RUNTIME_DIR"), "..", //TODO only valid on ubuntu (skip the snap dir)? os.Getenv("WAYLAND_DISPLAY"), ) cdpyName := C.CString(dpyName) defer C.free(unsafe.Pointer(cdpyName)) d.disp, err = C.wl_display_connect(cdpyName)

[0] https://manpages.debian.org/experimental/libwayland-doc/wl_display_connect.3.en.html

~pierrec 6 months ago

I have seen that doc and was confused as well when testing on Ubuntu. I have since rebooted/logged off, and the issue has vanished: the WAYLAND_DISPLAY file is now properly created in the XDG_RUNTIME_DIR as expected.

Register here or Log in to comment, or comment via email.