devdraw doesn't work on AIX

Open
#122 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
go
Domain
desktop

Research direction

Start by reproducing the failure with sam or acme on AIX, then inspect the referenced golang.org/x/exp/shiny/driver/driver_fallback.go and driver_x11.go changes. Determine whether the XGB connection error is caused by exp or devdraw; done means devdraw can access a screen and sam or acme starts without the reported errors.

Written by the indexing model from the issue text.

Description

The Go port of devdraw does not work on AIX, even though Go itself does. While devdraw itself can be built on AIX, when running sam or acme, an error similar to the following is displayed:

$ sam
devdraw: no driver for accessing a screen
samterm: drawinit: EOF

This is because AIX is not supported in the upstream module golang.org/x/exp/shiny/driver. The following local modification to golang.org/x/exp adds support:

diff --git a/shiny/driver/driver_fallback.go b/shiny/driver/driver_fallback.go
index e36fbc5..9c9b01c 100644
--- a/shiny/driver/driver_fallback.go
+++ b/shiny/driver/driver_fallback.go
@@ -2,12 +2,13 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build !darwin && (!linux || android) && !windows && !dragonfly && !openbsd
+//go:build !darwin && (!linux || android) && !windows && !dragonfly && !openbsd && !aix
 // +build !darwin
 // +build !linux android
 // +build !windows
 // +build !dragonfly
 // +build !openbsd
+// +build !aix
 
 package driver
 
diff --git a/shiny/driver/driver_x11.go b/shiny/driver/driver_x11.go
index bc24238..e205638 100644
--- a/shiny/driver/driver_x11.go
+++ b/shiny/driver/driver_x11.go
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build (linux && !android) || dragonfly || openbsd
-// +build linux,!android dragonfly openbsd
+//go:build (linux && !android) || dragonfly || openbsd || aix
+// +build linux,!android dragonfly openbsd aix
 
 package driver

However, with that modification in place, errors such as the following are seen on the command line:

$ sam
XGB: conn.go:47: Could not get authority info: EOF
XGB: conn.go:48: Trying connection without authority info...
devdraw: x11driver: xgb.NewConn failed: EOF
samterm: drawinit: EOF

This might entirely be the fault of the exp module, not actually devdraw, but wasn't sure, so I'm reporting it here as well.

Dominant language
Go
Stars
377
Forks
109
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from 9fans/go

All issues in 9fans/go

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.