Commit30e1c434Recorded19 Nov 2026Repositorysigil-ui
Use the sigil-window Wayland protocol tables
Changed
NEWS.md | 7 +++++++
docs/release.md | 9 +++++++++
native/wayland.c | 17 ++++-------------
package.sgl | 22 ++++++++--------------
scripts/check-configure-peer.sgl | 2 +-
scripts/test-wayland-dual-link.sgl | 28 ++++++++++++++++++++++++++++
sigil.lock | 4 ++--
test/link-check/package.sgl | 10 +++++++++-
test/link-check/src/link/main.sgl | 7 ++++++-
test/wayland/configure-peer.c | 1 +
test/wayland/cursor-native.c | 1 +
test/wayland/dmabuf-feedback-peer.c | 1 +
test/wayland/dmabuf-import-peer.c | 1 +
test/wayland/native-bridge.c | 1 +
test/wayland/scroll-native.c | 1 +
test/wayland/services-native.c | 1 +
test/wayland/standalone-protocols.h | 14 ++++++++++++++
17 files changed, 95 insertions(+), 32 deletions(-)Diff
NEWS.mdmodified
@@ -1,3 +1,10 @@
+1
# sigil-ui 0.2.8+2
+3
- Require sigil-window 0.2.2 or later in the 0.2 series. The Linux native+4
archives link together using sigil-window's Wayland protocol tables.+5
- Preserve sigil-ui's existing Wayland C bridge and DMA-BUF behavior.+6
- Check the combined native link and global symbols under GCC and Zig cc.+7
8
# sigil-ui 0.2.7 9
10
A Wayland DMA-BUF import fix. Requirements are unchanged from 0.2.6.docs/release.mdmodified
@@ -1,5 +1,14 @@
1
# Release dependency gates 2
+3
## 0.2.8 and later in the 0.2 series+4
+5
Publish sigil-window 0.2.2 before resolving the sigil-ui registry lock. Linux+6
uses sigil-window's Wayland protocol tables. Check the locked combination+7
with `sigil scripts/test-wayland-dual-link.sgl` on Linux with GCC and Zig+8
installed.+9
+10
## 0.2.6 release record+11
12
For 0.2.6, publish sigil-window 0.2.0 and sigil-font 0.1.3 before finalizing 13
the UI registry lock: 14
native/wayland.cmodified
@@ -6,9 +6,8 @@
6
* libwayland-client and libxkbcommon are loaded with dlopen when the first 7
* surface opens, so a program that never opens one (a boot screen drawing 8
* to DRM, a test rendering offscreen) needs neither library, at link time−9
* or at run time. The protocol code is generated from the XML files in−10
* native/wayland and checked in, so building needs no Wayland headers−11
* either (scripts/generate-wayland-protocols regenerates it).+9
* or at run time. The checked-in protocol headers keep the build independent+10
* of system Wayland headers. Sigil-window supplies the interface tables. 11
* 12
* Presenting. Two shm buffers in XRGB8888, the canvas's own layout, so a 13
* present is a row copy. Each buffer remembers which parts of it are older@@ -67,9 +66,8 @@
66
#define wl_proxy_set_user_data (*sui_wl_proxy_set_user_data) 67
#define wl_proxy_get_user_data (*sui_wl_proxy_get_user_data) 68
−70
/* The interface tables are defined here too (the generated private code),−71
* hidden, so they never interpose on another copy of libwayland-client in−72
* the same process. libwayland-client matches interfaces by name. */+69
/* These declarations bind to sigil-window's hidden interface tables. */+70
#define SIGIL_UI_EXTERNAL_WAYLAND_PROTOCOLS 1 71
#pragma GCC visibility push(hidden) 72
#include "wayland-client.h" 73
#include "xdg-shell-client-protocol.h"@@ -77,13 +75,6 @@
75
#include "wlr-layer-shell-unstable-v1-client-protocol.h" 76
#include "cursor-shape-v1-client-protocol.h" 77
#include "linux-dmabuf-v1-client-protocol.h"−80
#include "wayland-protocol.c"−81
#include "xdg-shell-protocol.c"−82
#include "xdg-decoration-unstable-v1-protocol.c"−83
#include "wlr-layer-shell-unstable-v1-protocol.c"−84
#include "cursor-shape-v1-protocol.c"−85
#include "tablet-v2-protocol.c"−86
#include "linux-dmabuf-v1-protocol.c" 78
#pragma GCC visibility pop 79
80
#include "xkb.h"package.sglmodified
@@ -29,7 +29,7 @@
29
30
(package 31
name: "sigil-ui"−32
version: "0.2.7"+32
version: "0.2.8" 33
sigil: "0.24.8" 34
description: "Retained-mode UI framework with a software renderer" 35
url: "https://git.usesigil.org/sigil/sigil-ui"@@ -54,17 +54,11 @@
54
debug?: #f 55
optimize: 2)) 56
−57
dependencies: (append−58
(cond-expand−59
(windows−60
(list (from-pkg name: "sigil/sigil-window" version: "^0.2.0")))−61
(darwin−62
(list (from-pkg name: "sigil/sigil-window" version: "^0.2.0")))−63
(else '()))−64
(list−65
(from-pkg name: "sigil/sigil-font" version: "^0.1.3")−66
(from-pkg name: "sigil/sigil-lib" version: "^0.24.8")−67
(from-pkg name: "sigil/sigil-stdlib" version: "^0.24.8")))+57
dependencies: (list+58
(from-pkg name: "sigil/sigil-window" version: "^0.2.2")+59
(from-pkg name: "sigil/sigil-font" version: "^0.1.3")+60
(from-pkg name: "sigil/sigil-lib" version: "^0.24.8")+61
(from-pkg name: "sigil/sigil-stdlib" version: "^0.24.8")) 62
63
;; The test runner declares its package/build/store helpers transitively. 64
dev-dependencies: (list@@ -73,8 +67,8 @@
67
(from-pkg name: "sigil/sigil-test-runner" version: "^0.24.6")) 68
69
;; Pixel loops and device access are native. Linux uses runtime-loaded−76
;; Wayland libraries and checked-in protocol code. AppKit host ownership−77
;; and native child services are supplied by sigil-window.+70
;; Wayland libraries and the protocol tables from sigil-window. Sigil-window+71
;; also supplies the AppKit host and native child services. 72
libraries: (list 73
(library 74
name: 'sigil-uiscripts/check-configure-peer.sglmodified
@@ -31,7 +31,7 @@
31
(define source (path evidence "configure-peer-prior.c")) 32
(write-text source (string-replace text "../../native/wayland.c" (realpath prior-source))) 33
(define prior (path evidence "configure-peer-prior"))−34
($ ,compiler ,@flags ,source ,archive -lm -ldl -lpthread -o ,prior+34
($ ,compiler ,@flags ,(str "-I" (path root "test/wayland")) ,source ,archive -lm -ldl -lpthread -o ,prior 35
out: ,(path evidence "configure-prior-compile.log") err: 'merge timeout: 40) 36
(each case '("early-close" "close-configure" "expired-pending") 37
(define log (path evidence (str "configure-baseline-" case ".log")))scripts/test-wayland-dual-link.sgladded
@@ -0,0 +1,28 @@
+1
#!/usr/bin/env sigil+2
(import (sigil shell prelude))+3
+4
(requires (tools gcc zig nm))+5
(define root (realpath (path (script-dir) "..")))+6
(define fixture (path root "test/link-check"))+7
(define cli (arg 1 default: (executable-path)))+8
+9
(define (global-definitions archive)+10
(map (lambda (line) (car (split line " ")))+11
(filter (lambda (line) (and (not (equal? line "")) (not (ends-with? line ":"))))+12
(lines nm -P -g --defined-only ,archive timeout: 30))))+13
+14
($ ,cli deps install cwd: ,fixture timeout: 180)+15
(each config '("gcc" "dev")+16
($ ,cli build --config ,config cwd: ,fixture timeout: 300)+17
(define build (path fixture "build" config))+18
(define ui (global-definitions (path build "native/libsigil-ui.a")))+19
(define window (global-definitions (path build "native/libsigil-window.a")))+20
(define collisions (filter (lambda (name) (member name window)) ui))+21
(unless (null? collisions)+22
(error "Wayland libraries define duplicate globals" config collisions))+23
(unless (and (member "sui_wayland_acquire" ui)+24
(member "sigil_window_wayland_acquire" window)+25
(member "wl_display_interface" window))+26
(error "Expected both Wayland bridges and sigil-window protocol tables" config))+27
($ ,(path build "bin/sigil-ui-link-check") timeout: 30)+28
(println "PASS: ~a linked both Wayland archives with unique globals" config))sigil.lockmodified
@@ -2,8 +2,8 @@
2
(lock 3
(package name: "sigil/sigil-window" 4
source: pkg−5
integrity: "sha256:80b8e28c13b6df1c6b53b03fc2d9524637c4b2ce0ddd8c5a19e192a49495671f"−6
version: "0.2.0"+5
integrity: "sha256:377589effa0077a23c4c0378db651516eb78449f86d6b3caa7fe9ae776e2aee4"+6
version: "0.2.2" 7
dependencies: ((from-pkg name: "sigil/sigil-lib" version: "^0.24.8") (from-pkg name: "sigil/sigil-stdlib" version: "^0.24.8"))) 8
(package name: "sigil/sigil-font" 9
source: pkgtest/link-check/package.sglmodified
@@ -1,4 +1,7 @@
1
;;; A real executable link catches duplicate native libraries and symbols.+2
(import (sigil process))+3
(define window-source (getenv "SIGIL_WINDOW_TEST_SOURCE"))+4
5
(package 6
name: "sigil-ui-link-check" 7
version: "0.0.0"@@ -6,10 +9,15 @@
9
entry: '(link main) 10
dependencies: (list 11
(from-path dir: "../.." package: "sigil-ui")+12
(if window-source+13
(from-path dir: window-source package: "sigil-window")+14
(from-pkg name: "sigil/sigil-window" version: "^0.2.2"))+15
(from-pkg name: "sigil/sigil-font" version: "^0.1.3") 16
(from-pkg name: "sigil/sigil-lib" version: "0.24.8") 17
(from-pkg name: "sigil/sigil-stdlib" version: "0.24.8")) 18
configs: (list−12
(config name: 'dev toolchain: 'zig target: "x86_64-linux-musl"+19
(config name: 'gcc backend: 'native c-compiler: "gcc" static?: #f output-dir: "build/gcc")+20
(config name: 'dev backend: 'native toolchain: 'zig target: "x86_64-linux-musl" 21
static?: #t output-dir: "build/dev")) 22
tasks: (list 23
(task name: 'build steps: (listtest/link-check/src/link/main.sglmodified
@@ -1,8 +1,13 @@
1
(define-library (link main)−2
(import (sigil ui raster) (sigil io))+2
(import (sigil ui raster) (sigil io)+3
(prefix (sigil ui wayland) ui:)+4
(prefix (sigil window wayland) window:)) 5
(export main) 6
(begin 7
(define (main)+8
(unless (and (procedure? ui:open-wayland-surface)+9
(procedure? window:open-wayland-surface))+10
(error "Both linked Wayland entry points must be available")) 11
(let ((canvas (make-canvas 12 10))) 12
(canvas-fill! canvas 2 3 4 5 #x123456) 13
(unless (= (canvas-pixel canvas 3 4) #x123456)test/wayland/configure-peer.cmodified
@@ -12,6 +12,7 @@ static int count_dispatch_polls, dispatch_polls;
12
static int observed_poll(struct pollfd *fds, nfds_t count, int timeout); 13
#define poll observed_poll 14
#include "../../native/wayland.c"+15
#include "standalone-protocols.h" 16
#undef poll 17
18
/* Observe real polling without changing its result, timeout or clock. */test/wayland/cursor-native.cmodified
@@ -3,6 +3,7 @@
3
#include <stdarg.h> 4
#include <sys/resource.h> 5
#include "../../native/wayland.c"+6
#include "standalone-protocols.h" 7
8
static uint32_t observed_serial, observed_shape; 9
static int requests, hidden;test/wayland/dmabuf-feedback-peer.cmodified
@@ -7,6 +7,7 @@
7
#include <sys/socket.h> 8
#include <sys/wait.h> 9
#include "../../native/wayland.c"+10
#include "standalone-protocols.h" 11
12
enum PeerObject { PEER_DISPLAY = 1, PEER_REGISTRY, PEER_COMPOSITOR, PEER_DMABUF, 13
PEER_SUBCOMPOSITOR, PEER_SURFACE, PEER_FEEDBACK };test/wayland/dmabuf-import-peer.cmodified
@@ -10,6 +10,7 @@
10
#define SUI_TEST_WAYLAND_SOURCE "../../native/wayland.c" 11
#endif 12
#include SUI_TEST_WAYLAND_SOURCE+13
#include "standalone-protocols.h" 14
#include "owned-peer.h" 15
16
#define LARGE_SPAN_SIZE 70778880test/wayland/native-bridge.cmodified
@@ -3,6 +3,7 @@
3
#include <sys/resource.h> 4
#include <sys/socket.h> 5
#include "../../native/wayland.c"+6
#include "standalone-protocols.h" 7
8
typedef struct { int released, rendered, canceled; } Notifications; 9
static void test_release(void *data) { ((Notifications *)data)->released++; }test/wayland/scroll-native.cmodified
@@ -1,6 +1,7 @@
1
/* Scroll frame metadata must survive fractional detents and source changes. */ 2
#include <assert.h> 3
#include "../../native/wayland.c"+4
#include "standalone-protocols.h" 5
6
static Event *finish_frame(Wl *window) 7
{test/wayland/services-native.cmodified
@@ -1,6 +1,7 @@
1
/* Stale/thread guards use the actual bindings without a desktop connection. */ 2
#include <assert.h> 3
#include "../../native/wayland.c"+4
#include "standalone-protocols.h" 5
6
typedef struct { SigilVM *vm; Value handle, text; } ServiceFixture; 7
test/wayland/standalone-protocols.hadded
@@ -0,0 +1,14 @@
+1
/* Fixtures that include the UI implementation exercise private state with+2
* mock peers in an independent executable. Supply its tables locally for+3
* sources that do not already define them. */+4
#ifdef SIGIL_UI_EXTERNAL_WAYLAND_PROTOCOLS+5
#pragma GCC visibility push(hidden)+6
#include "wayland-protocol.c"+7
#include "xdg-shell-protocol.c"+8
#include "xdg-decoration-unstable-v1-protocol.c"+9
#include "wlr-layer-shell-unstable-v1-protocol.c"+10
#include "cursor-shape-v1-protocol.c"+11
#include "tablet-v2-protocol.c"+12
#include "linux-dmabuf-v1-protocol.c"+13
#pragma GCC visibility pop+14
#endif