Skip to content

all: depend on golang.design/x/x11 instead of the internal copy#122

Merged
changkun merged 1 commit into
mainfrom
x11/use-package
Jun 6, 2026
Merged

all: depend on golang.design/x/x11 instead of the internal copy#122
changkun merged 1 commit into
mainfrom
x11/use-package

Conversation

@changkun

@changkun changkun commented Jun 6, 2026

Copy link
Copy Markdown
Member

Final step of the X11 work: extract the pure-Go X11 wire codec into its own
reusable module and depend on it, instead of keeping a private copy.

  • New module golang.design/x/x11
    (v0.1.0) — the minimal, dependency-free X11 wire-protocol client, promoted
    from internal/x11wire. Pure Go, no Cgo, no libX11, no sockets
    (caller-supplied transport), unit-tested on any platform.
  • This PR replaces internal/x11wire with a dependency on the published
    package (aliased as x11wire so the backend code is otherwise unchanged) and
    deletes the internal copy.

Dependency note

This adds a first-party golang.design module dependency. The package is
itself pure Go with no third-party or C dependencies, so the clipboard stays
Cgo-free on Linux and the BSDs — consistent with the goal of #25. (The codec is
now reusable for other golang.design graphics work.)

Verification

  • Cross-builds CGO_ENABLED=0 for linux, freebsd, openbsd, netbsd, darwin, and
    windows — all green; go vet clean.
  • macOS go test passes; Linux go test passes in both cgo modes against a
    headless Xvfb (the X11 backend behavior is unchanged — same code, now sourced
    from the module).
  • go.sum pins golang.design/x/x11 v0.1.0.

The pure-Go X11 wire codec was extracted to its own module,
golang.design/x/x11 (v0.1.0), so it can be reused for other graphics work.
Replace internal/x11wire with a dependency on the published package (imported
under the x11wire alias to keep the backend code unchanged) and delete the
internal copy.

This adds a first-party golang.design module dependency; the package itself
stays pure Go with no third-party or C dependencies, so the clipboard remains
Cgo-free on Linux and the BSDs.
@changkun changkun merged commit 1f198eb into main Jun 6, 2026
7 checks passed
@changkun changkun deleted the x11/use-package branch June 6, 2026 22:04
changkun added a commit that referenced this pull request Jun 7, 2026
#149) (#154)

These shipped (darwin #117; linux/X11 #119/#120, BSD #121; Wayland #109-#116)
but the specs still read 'Proposed'. Flip Status to Implemented and add an
Outcome section to each documenting what shipped and where the implementation
deviated from the design:

- darwin: OS-thread pinning for autorelease pools (unanticipated); the
  suggested pure-Go TIFF unit test was not added; silent TIFF-transcode nil.
- linux: internal/x11wire was extracted to the golang.design/x/x11 module
  (#122, now v0.2.0); one shared clipboard_x11.go for Linux+BSD; added
  sequence-matching/retry robustness. INCR/PRIMARY still unimplemented.
- wayland: phase 6 folded into the wire core; PRIMARY not shipped;
  same-process self-read limitation for custom selections (verified
  cross-process); enumeration added later.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant