Skip to content

Commit dab11e1

Browse files
committed
the modules carry the organization that owns the protocol
wayland.client / .server / .util become freedesktop.wayland.client / .server / .util. A module name is global and permanent in a way a package name is not, so it should say who owns the INTERFACE. openkal already learned this the expensive way. Its 0.1.0 was withdrawn rather than kept because it "placed the module a consumer imports under the control of the implementation, which contradicts what the specification is for". wayland is a protocol specification that freedesktop maintains and libwayland implements, so freedesktop is the right owner to name -- and the sibling change in mcpplibs/libglvnd names khronos.egl for exactly the same reason, since EGL is a Khronos specification that libglvnd merely implements. genmod.py generates the two protocol wrappers, so it changed with them; CI regenerates and diffs, and the run was verified idempotent before pushing. Also pins XLINGS_VERSION. Unpinned, the install step took whatever was newest that morning, so a red run could not be told apart from an ecosystem change -- the one thing a fork's CI exists to rule out. mcpp itself stays unpinned on purpose: these packages depend on the ecosystem, and a pinned mcpp tarball carries a frozen snapshot of it. BREAKING for anyone already importing the old names. Doing it now rather than later because freedesktop.wayland 1.26.0 merged into mcpp-index today and the only consumer is the graphics-stack example, which moves with it.
1 parent af1cc5f commit dab11e1

8 files changed

Lines changed: 44 additions & 31 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,22 @@ jobs:
3535
# /dev/tty` — and a runner has a /dev/tty that is readable but not
3636
# connected, so it dies with "No such device or address" before anything
3737
# is installed.
38+
#
39+
# XLINGS_VERSION PINS THE INSTALLER. Unpinned, this step installed
40+
# whatever was newest that morning, so a red run could never be told
41+
# apart from an ecosystem change — the one thing a fork's CI exists to
42+
# rule out. The installer reads `${1:-${XLINGS_VERSION:-}}`, so the
43+
# environment form pins it without changing the `curl | bash` shape.
44+
#
45+
# mcpp itself stays UNPINNED on purpose, and that is not an oversight:
46+
# these packages depend on the ECOSYSTEM (`xim:mesa`'s GBM/EGL discovery
47+
# rows, the toolchains), and a pinned mcpp tarball carries a frozen
48+
# snapshot of it. Pinning the tool that installs, floating the ecosystem
49+
# under test, is the split that makes a failure attributable.
3850
- name: Install xlings + mcpp
3951
env:
4052
XLINGS_NON_INTERACTIVE: "1"
53+
XLINGS_VERSION: "2026.8.27.4"
4154
run: |
4255
curl -fsSL https://d2learn.org/xlings-install.sh | bash
4356
echo "$HOME/.xlings/bin" >> "$GITHUB_PATH"
@@ -159,12 +172,12 @@ jobs:
159172
160173
- name: every module produced an interface
161174
run: |
162-
for m in wayland.client wayland.server wayland.util; do
175+
for m in freedesktop.wayland.client freedesktop.wayland.server freedesktop.wayland.util; do
163176
find . \( -name "$m.gcm" -o -name "$m.pcm" \) | head -1 | grep -q . \
164177
|| { echo "::error::$m has no module interface"; find . -name '*.gcm' -o -name '*.pcm'; exit 1; }
165178
echo "$m ok"
166179
done
167-
echo "wayland.client, wayland.server and wayland.util all have interfaces"
180+
echo "freedesktop.wayland.client, freedesktop.wayland.server and freedesktop.wayland.util all have interfaces"
168181
169182
upstream:
170183
# `upstream/` must be the release tarball, byte for byte.

README.mcpp.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ four packages, all out of this one tarball:
77
| package | output |
88
|---|---|
99
| `freedesktop.wayland-scanner` | `wayland-scanner`, the protocol code generator |
10-
| `freedesktop.wayland` | `libwayland-client.so.0` + `import wayland.client;` |
11-
| `freedesktop.wayland-server` | `libwayland-server.so.0` + `import wayland.server;` |
12-
| `freedesktop.wayland-util` | `import wayland.util;` — the macros, as entities |
10+
| `freedesktop.wayland` | `libwayland-client.so.0` + `import freedesktop.wayland.client;` |
11+
| `freedesktop.wayland-server` | `libwayland-server.so.0` + `import freedesktop.wayland.server;` |
12+
| `freedesktop.wayland-util` | `import freedesktop.wayland.util;` — the macros, as entities |
1313

1414
```bash
1515
mcpp build --workspace
1616
```
1717

1818
## The module wrappers add no API
1919

20-
`import wayland.client;` replaces `#include <wayland-client.h>` and changes
20+
`import freedesktop.wayland.client;` replaces `#include <wayland-client.h>` and changes
2121
nothing else. Every exported name is upstream's, spelled upstream's way, with
2222
upstream's semantics — there are no wrapper types, no RAII, no renaming — so
2323
code written against the C headers ports by swapping one line.
@@ -48,7 +48,7 @@ rule decides the whole layout here:
4848
## Macros are the one thing that could not cross
4949

5050
`export` names entities, and a macro is not one. Wayland's public surface has
51-
fourteen, so `wayland.util` maps each to what it actually is:
51+
fourteen, so `freedesktop.wayland.util` maps each to what it actually is:
5252

5353
| macro | in the module |
5454
|---|---|
@@ -111,8 +111,8 @@ mcpp/ everything this fork adds
111111
scanner/ the generator
112112
util/ the macro mappings + their test
113113
generated/ wayland-scanner's output, checked in — see its README
114-
client/ libwayland-client + wayland.client
115-
server/ libwayland-server + wayland.server
114+
client/ libwayland-client + freedesktop.wayland.client
115+
server/ libwayland-server + freedesktop.wayland.server
116116
mcpp.toml the workspace root
117117
```
118118

mcpp/client/src/wayland-client.cppm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// wayland.client — libwayland-client, as a C++23 module.
1+
// freedesktop.wayland.client — libwayland-client, as a C++23 module.
22
//
33
// A module wrapper and nothing more: every name below is upstream's, spelled
4-
// upstream's way, with upstream's signature. `import wayland.client;` replaces the
4+
// upstream's way, with upstream's signature. `import freedesktop.wayland.client;` replaces the
55
// #include and changes nothing else, so code written against the C headers
66
// ports by swapping one line.
77
//
@@ -23,13 +23,13 @@
2323
// thing that changed is a linkage the caller cannot observe.
2424
//
2525
// MACROS ARE NOT HERE, and cannot be: `export` names entities and a macro is
26-
// not one. wayland's public macros live in the `wayland.util` module
26+
// not one. wayland's public macros live in the `freedesktop.wayland.util` module
2727
// (freedesktop.wayland-util), which maps each to the entity it actually is.
2828
module;
2929

3030
#include <wayland-client-core.h>
3131

32-
export module wayland.client;
32+
export module freedesktop.wayland.client;
3333

3434
export {
3535

@@ -116,7 +116,7 @@ using ::wl_proxy_wrapper_destroy;
116116
// -- interfaces / data --
117117
}
118118

119-
// The protocol API: client-side wrappers and the interface objects,
119+
// The protocol API: wayland-side wrappers and the interface objects,
120120
// generated by wayland-scanner and included HERE — inside the module purview —
121121
// rather than in the global module fragment above.
122122
//

mcpp/server/src/wayland-server.cppm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// wayland.server — libwayland-server, as a C++23 module.
1+
// freedesktop.wayland.server — libwayland-server, as a C++23 module.
22
//
33
// A module wrapper and nothing more: every name below is upstream's, spelled
4-
// upstream's way, with upstream's signature. `import wayland.server;` replaces the
4+
// upstream's way, with upstream's signature. `import freedesktop.wayland.server;` replaces the
55
// #include and changes nothing else, so code written against the C headers
66
// ports by swapping one line.
77
//
@@ -23,13 +23,13 @@
2323
// thing that changed is a linkage the caller cannot observe.
2424
//
2525
// MACROS ARE NOT HERE, and cannot be: `export` names entities and a macro is
26-
// not one. wayland's public macros live in the `wayland.util` module
26+
// not one. wayland's public macros live in the `freedesktop.wayland.util` module
2727
// (freedesktop.wayland-util), which maps each to the entity it actually is.
2828
module;
2929

3030
#include <wayland-server-core.h>
3131

32-
export module wayland.server;
32+
export module freedesktop.wayland.server;
3333

3434
export {
3535

@@ -194,7 +194,7 @@ using ::wl_signal_emit_mutable;
194194
// -- interfaces / data --
195195
}
196196

197-
// The protocol API: server-side wrappers and the interface objects,
197+
// The protocol API: wayland-side wrappers and the interface objects,
198198
// generated by wayland-scanner and included HERE — inside the module purview —
199199
// rather than in the global module fragment above.
200200
//

mcpp/tools/genmod.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def plain(t):
4444
An elaborated-type-specifier in a module-purview declaration DECLARES the
4545
type there, and clang then rejects it:
4646
47-
error: declaration of 'wl_buffer' in module wayland.client follows
47+
error: declaration of 'wl_buffer' in module freedesktop.wayland.client follows
4848
declaration in the global module
4949
5050
The types are already declared by the global module fragment's includes, so
@@ -94,7 +94,7 @@ def scan(paths):
9494
// thing that changed is a linkage the caller cannot observe.
9595
//
9696
// MACROS ARE NOT HERE, and cannot be: `export` names entities and a macro is
97-
// not one. wayland's public macros live in the `wayland.util` module
97+
// not one. wayland's public macros live in the `freedesktop.wayland.util` module
9898
// (freedesktop.wayland-util), which maps each to the entity it actually is.
9999
module;
100100
@@ -105,12 +105,12 @@ def scan(paths):
105105
'''
106106

107107
for side, mod, incs, title in [
108-
("client", "wayland.client",
108+
("client", "freedesktop.wayland.client",
109109
["<wayland-client-core.h>"],
110-
"wayland.client — libwayland-client, as a C++23 module."),
111-
("server", "wayland.server",
110+
"freedesktop.wayland.client — libwayland-client, as a C++23 module."),
111+
("server", "freedesktop.wayland.server",
112112
["<wayland-server-core.h>"],
113-
"wayland.server — libwayland-server, as a C++23 module."),
113+
"freedesktop.wayland.server — libwayland-server, as a C++23 module."),
114114
]:
115115
proto = GEN / f"wayland-{side}-protocol.h"
116116
hdrs = [F/"upstream/src/wayland-util.h", F/f"upstream/src/wayland-{side}-core.h"]

mcpp/util/mcpp.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# freedesktop.wayland-util — wayland's public macros, as a module.
22
#
33
# A module cannot export a macro, so the fourteen in wayland's public headers
4-
# would simply be missing from `import wayland.client;`. This package carries
4+
# would simply be missing from `import freedesktop.wayland.client;`. This package carries
55
# them as a constant, a function template and a set of ranges — see
66
# src/wayland-util.cppm for the one-to-one table.
77
#

mcpp/util/src/wayland-util.cppm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// wayland.util — wayland's public MACROS, as things a module can export.
1+
// freedesktop.wayland.util — wayland's public MACROS, as things a module can export.
22
//
33
// `export` names entities, and a macro is not one, so the fourteen macros in
4-
// wayland's public headers cannot come through `import wayland.client;`. This
4+
// wayland's public headers cannot come through `import freedesktop.wayland.client;`. This
55
// module carries them instead — as a constant, a function template and a set
66
// of ranges, which is what each macro actually is once the preprocessor is out
77
// of the way.
88
//
99
// This is the one place the C API's SPELLING changes, and it changes because
10-
// C++ has no way to keep it. Everything else in wayland.client / wayland.server
10+
// C++ has no way to keep it. Everything else in freedesktop.wayland.client / freedesktop.wayland.server
1111
// is upstream's name, unchanged.
1212
//
1313
// macro here
@@ -40,7 +40,7 @@ module;
4040
#undef wl_array_for_each
4141
#undef WL_MARSHAL_FLAG_DESTROY
4242

43-
export module wayland.util;
43+
export module freedesktop.wayland.util;
4444

4545
export {
4646

mcpp/util/tests/util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <string>
1414
#include <vector>
1515

16-
import wayland.util;
16+
import freedesktop.wayland.util;
1717

1818
namespace {
1919

0 commit comments

Comments
 (0)