internal/wayland: expose WAYLAND_VERSION
All checks were successful
Test / Create distribution (push) Successful in 35s
Test / Sandbox (push) Successful in 2m15s
Test / Hakurei (push) Successful in 3m15s
Test / Hpkg (push) Successful in 4m9s
Test / Sandbox (race detector) (push) Successful in 4m13s
Test / Hakurei (race detector) (push) Successful in 5m6s
Test / Flake checks (push) Successful in 1m31s
All checks were successful
Test / Create distribution (push) Successful in 35s
Test / Sandbox (push) Successful in 2m15s
Test / Hakurei (push) Successful in 3m15s
Test / Hpkg (push) Successful in 4m9s
Test / Sandbox (race detector) (push) Successful in 4m13s
Test / Hakurei (race detector) (push) Successful in 5m6s
Test / Flake checks (push) Successful in 1m31s
This might be useful troubleshooting information. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
b73a789dfe
commit
3afca2bd5b
@ -12,8 +12,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"hakurei.app/hst"
|
"hakurei.app/hst"
|
||||||
"hakurei.app/internal/env"
|
|
||||||
"hakurei.app/internal/info"
|
|
||||||
"hakurei.app/internal/outcome"
|
"hakurei.app/internal/outcome"
|
||||||
"hakurei.app/internal/store"
|
"hakurei.app/internal/store"
|
||||||
"hakurei.app/message"
|
"hakurei.app/message"
|
||||||
@ -23,16 +21,14 @@ import (
|
|||||||
func printShowSystem(output io.Writer, short, flagJSON bool) {
|
func printShowSystem(output io.Writer, short, flagJSON bool) {
|
||||||
t := newPrinter(output)
|
t := newPrinter(output)
|
||||||
defer t.MustFlush()
|
defer t.MustFlush()
|
||||||
|
hi := outcome.Info()
|
||||||
hi := &hst.Info{Version: info.Version(), User: new(outcome.Hsu).MustID(nil)}
|
|
||||||
env.CopyPaths().Copy(&hi.Paths, hi.User)
|
|
||||||
|
|
||||||
if flagJSON {
|
if flagJSON {
|
||||||
encodeJSON(log.Fatal, output, short, hi)
|
encodeJSON(log.Fatal, output, short, hi)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
t.Printf("Version:\t%s\n", hi.Version)
|
t.Printf("Version:\t%s (libwayland %s)\n", hi.Version, hi.WaylandVersion)
|
||||||
t.Printf("User:\t%d\n", hi.User)
|
t.Printf("User:\t%d\n", hi.User)
|
||||||
t.Printf("TempDir:\t%s\n", hi.TempDir)
|
t.Printf("TempDir:\t%s\n", hi.TempDir)
|
||||||
t.Printf("SharePath:\t%s\n", hi.SharePath)
|
t.Printf("SharePath:\t%s\n", hi.SharePath)
|
||||||
|
|||||||
@ -54,6 +54,9 @@ type Paths struct {
|
|||||||
|
|
||||||
// Info holds basic system information collected from the implementation.
|
// Info holds basic system information collected from the implementation.
|
||||||
type Info struct {
|
type Info struct {
|
||||||
|
// WaylandVersion is the libwayland value of WAYLAND_VERSION.
|
||||||
|
WaylandVersion string `json:"WAYLAND_VERSION"`
|
||||||
|
|
||||||
// Version is a hardcoded version string.
|
// Version is a hardcoded version string.
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
// User is the userid according to hsu.
|
// User is the userid according to hsu.
|
||||||
|
|||||||
@ -11,10 +11,22 @@ import (
|
|||||||
"hakurei.app/hst"
|
"hakurei.app/hst"
|
||||||
"hakurei.app/internal/acl"
|
"hakurei.app/internal/acl"
|
||||||
"hakurei.app/internal/env"
|
"hakurei.app/internal/env"
|
||||||
|
"hakurei.app/internal/info"
|
||||||
"hakurei.app/internal/system"
|
"hakurei.app/internal/system"
|
||||||
|
"hakurei.app/internal/wayland"
|
||||||
"hakurei.app/message"
|
"hakurei.app/message"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Info returns the address to a populated [hst.Info].
|
||||||
|
//
|
||||||
|
// This must not be called from within package outcome.
|
||||||
|
func Info() *hst.Info {
|
||||||
|
hi := hst.Info{WaylandVersion: wayland.Version,
|
||||||
|
Version: info.Version(), User: new(Hsu).MustID(nil)}
|
||||||
|
env.CopyPaths().Copy(&hi.Paths, hi.User)
|
||||||
|
return &hi
|
||||||
|
}
|
||||||
|
|
||||||
// envAllocSize is the initial size of the env map pre-allocated when the configured env map is nil.
|
// envAllocSize is the initial size of the env map pre-allocated when the configured env map is nil.
|
||||||
// It should be large enough to fit all insertions by outcomeOp.toContainer.
|
// It should be large enough to fit all insertions by outcomeOp.toContainer.
|
||||||
const envAllocSize = 1 << 6
|
const envAllocSize = 1 << 6
|
||||||
|
|||||||
@ -9,6 +9,7 @@ package wayland
|
|||||||
#cgo freebsd openbsd LDFLAGS: -lwayland-client
|
#cgo freebsd openbsd LDFLAGS: -lwayland-client
|
||||||
|
|
||||||
#include "wayland-client-helper.h"
|
#include "wayland-client-helper.h"
|
||||||
|
#include <wayland-version.h>
|
||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
import (
|
import (
|
||||||
@ -17,6 +18,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
// Version is the value of WAYLAND_VERSION.
|
||||||
|
Version = C.WAYLAND_VERSION
|
||||||
|
|
||||||
// Display contains the name of the server socket
|
// Display contains the name of the server socket
|
||||||
// (https://gitlab.freedesktop.org/wayland/wayland/-/blob/1.23.1/src/wayland-client.c#L1147)
|
// (https://gitlab.freedesktop.org/wayland/wayland/-/blob/1.23.1/src/wayland-client.c#L1147)
|
||||||
// which is concatenated with XDG_RUNTIME_DIR
|
// which is concatenated with XDG_RUNTIME_DIR
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user