Skip to content

Commit af79fd2

Browse files
authored
feat(libinput): 让输入链的顶端第一次真的被编译 (#298)
* feat(libinput): 让输入链的顶端第一次真的被编译 compat.libinput 随 #294 进了索引,而它从未被编译过——没有测试成员消费它, 而没人编译的包不会编译失败。加上 tests/examples/libinput 之后一次构建暴露出 四类问题,都是"上游用 meson,我们不用"才会有的: 1. 缺 libinput-version.h。meson 从 .h.in 生成,libinput-private.h:45 无条件 include 它,所以 40 个源文件全挂。补成 generated_files。 2. config.h 只写了一半。HTTP_DOC_LINK / LIBINPUT_QUIRKS_OVERRIDE_FILE / LIBINPUT_PLUGIN_{LIB,ETC}DIR / HAVE_VERSIONSORT / HAVE_MTDEV 都缺。 HAVE_VERSIONSORT 尤其关键:不定义它,libinput-versionsort.h 会给出自己的 static strverscmp,而 glibc 已经 extern 声明过——是硬错误不是遮蔽。 3. include_dirs 少了包根。全树只有 libinput-plugin-mouse-wheel-lowres.c:31 写 `#include "src/evdev-frame.h"`,上游因为从项目根编译而免费拿到这个拼法。 4. typeof。util-mem.h:180 的 (typeof(*ptr_))_steal(ptr_) 是 GNU 关键字, -std=c11 下被当成未声明函数调用,cast 塌成 int,伤害落在十几个根本没提 typeof 的文件里,报成 -Wint-conversion。 c_standard = "gnu11" 不是解法:mcpp 收下这个字符串,仍然发 -std=c11。 这次是实测的——设过 gnu11,上面这些错误原样还在。所以走 -Dtypeof=__typeof__。 测试成员断言的是四包交接处(libudev 起 context、udev 枚举 seat、dispatch、 可 poll 的 fd),不断言能打开 /dev/input/event*——那需要权限,设 MCPP_RUN_INPUT_DEVICES=1 才要求。6 项全过。 顺带把 quirks 那段注释改准:LIBINPUT_QUIRKS_DIR 是有环境变量出口的 (libinput.c:1911),和 GBM_BACKENDS_PATH 同一形状,缺的是提供方而不是机制。 * docs: 记录 xkeyboard-config 跨索引闭环与 libinput 的四个 bug §10.9.1 xkeyboard-config 已落地(xim-pkgindex#732),含实现中改的两处 discovery 形状:XKB_CONFIG_ROOT 是标量所以用 op=set(表里第一个非列表项),以及 declare_xkb —— 声明变量和放置内容是两件事,只声明的那一版让变量指向不存在的目录。 §10.9.2 新增:libinput quirks 是同一形状的第三处。之前注释里写的「编译期路径」 不准确,libinput.c:1911 是 getenv 优先。所以不是死路,是缺提供方。 §10.10 G5 从「待接上」改为已做,并把测试成员抓出的四个 bug 列出来——它们全都是 「包进了索引但从没被编译过」造成的。另加一张发现变量总表,标出哪两行仍是空的。 * docs(libinput): 对齐两处与改动后不符的注释 c_standard 从 gnu11 改回 c11 之后,config.h 里 HAVE_C23_AUTO 那段还写着 「builds as gnu11」。 以及 config.h 顶部对 LIBINPUT_QUIRKS_DIR 的说明还停在「编译期路径」, 与文件头已改准的版本不一致——libinput.c:1911 是 getenv 优先、编译期值兜底。 * docs: 补记从已发布索引的复验,以及它抓到的 store 撞名陷阱 合并 xim#732 后又从「已发布索引 + 全新 subos + 沙箱」复验一遍——上一次用的是 --add-xpkg 的本地副本,证明力不同。 第一次复验数据没放进去,差点得出「包坏了」。真因是 store 里还留着本地验证时的 local:xkeyboard-config@2.48,而 store 查找忽略 namespace,(name, version) 撞上 就把 install() 静默跳过、payload 为空,config() 照常跑。 顺带记下:declare_xkb 的 os.isdir 守卫确实触发了,但那条 log.warn 在 install 输出里没出现(同一次输出里 xlings 自己的 [warn] 是打出来的)。所以 declare_dri / declare_gbm / declare_xkb 的警告都不能当诊断依赖。
1 parent 3f5a31f commit af79fd2

5 files changed

Lines changed: 316 additions & 20 deletions

File tree

.agents/docs/2026-08-30-graphics-stack-coverage-design.md

Lines changed: 131 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -600,17 +600,141 @@ share/{bash-completion,man}` —— **不带 xkb 数据**。所以 `XKB_CONFIG_R
600600
⚠ 顺带一提:一个**只需要 `xkb_keymap_new_from_string`** 的合成器不需要这份数据 ——
601601
那正是它从客户端收到 keymap 的路径,也是本索引测试跑通 parser 的方式。
602602

603+
#### 10.9.1 已落地(openxlings/xim-pkgindex#732)
604+
605+
上面的结论已实现,并在实现过程中改了 discovery 层的两处形状:
606+
607+
**`XKB_CONFIG_ROOT` 是表里第一个非列表项。** DISCOVERY 的另外四行都是冒号分隔的搜索
608+
路径,`prepend` 在那里既正确又无损(而且必须是 prepend:一个提供方 `set` 会盖掉另一
609+
个,NVIDIA vendor 目录消失就是这么来的)。`XKB_CONFIG_ROOT`**标量** —— libxkbcommon
610+
读一次当一个目录用,`prepend` 上第二个提供方就变成 `dirA:dirB`,一个不存在的路径,而
611+
报错只会说「keymap 编译失败」。所以给 DISCOVERY 行加了可选的 `op`,默认仍是 `prepend`,
612+
这一行写 `set`
613+
614+
> 这与记忆里那条 `xvm envs 是 PATH 式合并`(标量 env 会被冒号拼接)是同一件事的第二次
615+
> 撞见。第一次的答案是「生成 launcher」;这次因为发现点在 discovery 层内部,所以修在
616+
> 了机制里。
617+
618+
**声明变量 ≠ 放置内容。** 第一版只加了 DISCOVERY 行和 `declare_subos_env` 调用,装完之后:
619+
620+
```
621+
XKB_CONFIG_ROOT=[.../subos/eco-2026-8-30-1/share/X11/xkb]
622+
ls: cannot access '.../share/X11/xkb': No such file or directory
623+
```
624+
625+
变量在 shell 里读得好好的,指向不存在的目录。补 `graphics.declare_xkb`,与
626+
`declare_dri` / `declare_gbm` 同形(`xvm.files` 把树放进 subos)。
627+
628+
**跨索引闭环已实测** —— mcpp 侧的 `freedesktop.libxkbcommon` 消费 xim 侧的数据集:
629+
630+
```
631+
XKB_CONFIG_ROOT = .../subos/eco-2026-8-30-1/share/X11/xkb
632+
xkb_keymap_new_from_names(evdev/pc105/us) against that root ok
633+
real layout: keycode 24 -> "q"
634+
…and the real us layout maps keycode 24 to "q" ok
635+
0 check(s) failed
636+
```
637+
638+
消费侧断言写在 `tests/examples/libxkbcommon`,且是**条件式**的:`XKB_CONFIG_ROOT`
639+
设置时只报告,设置了才要求编得出来。没有数据集的机器不是这个包的缺陷。
640+
641+
**合并后又从「已发布索引 + 全新 subos + 沙箱」复验了一遍**,因为上面那次用的是
642+
`xlings config --add-xpkg` 的本地副本:
643+
644+
```
645+
xim:xkeyboard-config@2.48 installed ← 来自已发布索引,不是 local:
646+
ROOT=[.../subos/eco-2026-8-30-2/share/X11/xkb]
647+
compat geometry keycodes rules symbols types
648+
rules/evdev 行数: 512
649+
布局数: 151
650+
```
651+
652+
**这次复验抓到一个真实陷阱,而且差点得出"包坏了"的结论**:第一次从已发布索引装,
653+
数据**没有**放进去。原因不在包 —— store 里还留着本地验证时的
654+
`local:xkeyboard-config@2.48`,而 xlings 的 store 查找**忽略 namespace**,
655+
`(name, version)` 撞上就把 `install()` 静默跳过,payload 是空的,而 `config()` 照常跑。
656+
清掉 store 重装即正常。
657+
658+
**两条要记住的**:
659+
660+
1.`--add-xpkg` 本地验证过的包,发布后必须**先清 store 再验一遍**,否则验的
661+
仍然是本地那份。
662+
2. `declare_xkb``os.isdir` 守卫确实触发了,但那条 `log.warn`
663+
**在 install 输出里根本没出现**(同一次输出里 xlings 自己的 `[warn]` 是打出来的)。
664+
所以 `declare_dri` / `declare_gbm` / `declare_xkb` 的警告都不能当诊断依赖 ——
665+
判断内容有没有真放进去只能直接 `ls`
666+
667+
#### 10.9.2 同一形状的第三处:libinput quirks
668+
669+
`compat.libinput` 时把 `LIBINPUT_QUIRKS_DIR` 也编译成空,注释里当时写的是「编译期
670+
路径,空即用内置默认」。**这句话不准确**:`libinput.c:1911`
671+
`getenv("LIBINPUT_QUIRKS_DIR")` 优先、编译期值兜底 —— 和 `GBM_BACKENDS_PATH`
672+
一模一样的形状。
673+
674+
所以这不是死路,是**缺提供方**:`.quirks` 文件就在 libinput 自己的 tarball 里,但
675+
mcpp-index 没有发布数据目录的机制(与 §10.9 同因)。在有东西填上之前,libinput 打印
676+
677+
```
678+
failed to find data files ... will negatively affect device behavior
679+
```
680+
681+
并跑在内置默认上。这是**优雅降级**:枚举、事件、手势都正常,丢的是逐机型调校(比如
682+
某块触摸板的压力区间)。`tests/examples/libinput` 就是在这条消息存在的情况下全绿的。
683+
684+
补法与 xkeyboard-config 完全对称(xim 数据包 + 一行 DISCOVERY),优先级低于布局数据:
685+
布局缺了是**硬失败**,quirks 缺了只是不够贴合。
686+
603687
### 10.10 仍未做
604688

605689
- ~~G4b `libxkbcommon`~~ **已做**(fork,bison parser 预生成)。它需要的数据集见 §10.9:
606690
属于生态,不属于这里。
607-
- ~~G5 `libinput`~~ **描述符已做**;测试成员待本 PR 合并、`freedesktop.libevdev` 发布
608-
后接上 —— 它同时需要 `compat.*``freedesktop.*` 两个 namespace 指向同一个
609-
checkout,而成员级 `[indices]` 是替换而非合并。
691+
- ~~G5 `libinput`~~ **已做,并且测试成员一接上就抓出了四个 bug**(#298)。
692+
形态问题解决得很朴素:这个成员**不声明 `[indices]`**,继承根的
693+
`compat = { path = "." }` —— compat 来自 checkout,`freedesktop.libevdev` 来自已发布
694+
索引(它确实已发布)。声明 `freedesktop` 反而会让 `compat.libinput` 去查已发布索引。
695+
696+
四个 bug 值得单列,因为它们**全都是"包进了索引但从没被编译过"造成的** ——
697+
没有测试成员消费它,而没人编译的包不会编译失败(记忆里那条「绿 CI 不等于包被编译」
698+
的教科书案例):
699+
700+
| 问题 | 症状落点 |
701+
|------|---------|
702+
|`libinput-version.h`(meson 从 `.h.in` 生成) | `libinput-private.h:45` 无条件 include,40 个源文件全挂 |
703+
| `config.h` 只写了一半 | `HTTP_DOC_LINK` / `LIBINPUT_QUIRKS_OVERRIDE_FILE` / `LIBINPUT_PLUGIN_{LIB,ETC}DIR` / `HAVE_VERSIONSORT` / `HAVE_MTDEV` |
704+
| `include_dirs` 少了包根 | 全树只有一个文件写 `#include "src/evdev-frame.h"` |
705+
| `typeof` 是 GNU 关键字 | `-std=c11` 下 cast 塌成 `int`,错误落在十几个没提 typeof 的文件里 |
706+
707+
其中两条有普遍意义:
708+
709+
**`HAVE_VERSIONSORT`** —— 不定义它,`libinput-versionsort.h` 会给出自己的
710+
`static strverscmp`,而 glibc 已经 `extern` 声明过。这是硬错误,不是遮蔽。
711+
「少定义一个 HAVE_ 宏最多退化」的直觉在这里是错的。
712+
713+
**`c_standard = "gnu11"` 不生效,这次是实测的** —— mcpp 收下这个字符串,仍然发
714+
`-std=c11`,那些 typeof 错误原样还在。所以走 `-Dtypeof=__typeof__`。这与记忆里
715+
「c_standard 的 gnu 模式被静默忽略」一致,但那条记的是 `_GNU_SOURCE` 类的**库特性
716+
**;`typeof`**语言方言**,`-D_GNU_SOURCE` 对它无效。两者要分开记。
610717
- ~~G6 `libudev` / `libseat`~~ **已做**,而且没有碰 systemd:libudev
611718
**libudev-zero**(三个实现里唯一既活着又可独立分发的),libseat 只开 seatd 与
612719
builtin 后端。两者的代价都在描述符里点名了。
613-
- **xkeyboard-config**:见 §10.9,应进 xim-pkgindex。
614-
615-
前两条是普通工作量;G6 是需要决策的。合成器可以在「已有 DRM master」的前提下开发
616-
(从 TTY 直接启动、或 `SEATD_SOCK`),把 session 管理留到最后。
720+
- ~~**xkeyboard-config**~~ **已做**(xim-pkgindex#732),见 §10.9.1。跨索引闭环已实测。
721+
- **libinput quirks 数据**:见 §10.9.2。形状与 xkeyboard-config 对称,优先级更低 ——
722+
布局缺了是硬失败,quirks 缺了只是不够贴合。**未做**
723+
724+
至此渲染链与输入链都不再有「静默落到宿主」的边:
725+
726+
| 子系统 | 发现变量 | 提供方 | 状态 |
727+
|--------|---------|--------|------|
728+
| DRI 驱动 | `LIBGL_DRIVERS_PATH` | `xim:mesa` ||
729+
| EGL vendor | `__EGL_VENDOR_LIBRARY_DIRS` | `xim:mesa` + host-link 哨兵 ||
730+
| Vulkan ICD | `XDG_DATA_DIRS` / 共享 vendor 目录 | 同上 |#731 待合 |
731+
| GBM 后端 | `GBM_BACKENDS_PATH` | `xim:mesa` ||
732+
| 键盘布局 | `XKB_CONFIG_ROOT` | `xim:xkeyboard-config` |#732 待合 |
733+
| 输入 quirks | `LIBINPUT_QUIRKS_DIR` | *(无)* | ⬜ 优雅降级中 |
734+
| USB 名字库 | `USB_IDS_PATH` | *(无)* | ⬜ 优雅降级中 |
735+
736+
最后两行是同一类:机制在、提供方缺、缺了只丢锦上添花的东西。**它们缺失时会说出来**
737+
—— 这正是当初把编译期默认值一律留空要换的东西。
738+
739+
G6 仍是需要决策的:合成器可以在「已有 DRM master」的前提下开发(从 TTY 直接启动、或
740+
`SEATD_SOCK`),把 session 管理留到最后。

mcpp.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ members = [
8989
"tests/examples/egl",
9090
"tests/examples/gl",
9191
"tests/examples/libevdev",
92+
"tests/examples/libinput",
9293
"tests/examples/libseat",
9394
"tests/examples/libudev",
9495
"tests/examples/libxkbcommon",

pkgs/c/compat.libinput.lua

Lines changed: 119 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,25 @@
3131
-- way. Nothing in this index provides it, and without it libinput falls back
3232
-- to generic tablet handling rather than failing.
3333
--
34-
-- The quirks database (`quirks.c`) reads `.quirks` files at runtime from a
35-
-- directory compiled in as `LIBINPUT_QUIRKS_DIR`. That path is EMPTY here for
36-
-- the same reason libgbm's backend path and libxkbcommon's config root are:
37-
-- upstream's default points into the build prefix, which after relocation is
38-
-- the HOST's dataset. Empty means devices get libinput's built-in defaults
39-
-- rather than a host machine's model quirks — correct behaviour, one fewer
40-
-- silent host edge.
34+
-- The quirks database (`quirks.c`) reads `.quirks` files at runtime — model
35+
-- specific tuning like a touchpad's pressure range. `libinput.c:1911` takes the
36+
-- directory from `getenv("LIBINPUT_QUIRKS_DIR")` and falls back to a
37+
-- compiled-in path, and the compiled-in path is EMPTY here for the same reason
38+
-- libgbm's backend path and libxkbcommon's config root are: upstream's default
39+
-- points into the build prefix, which after relocation is the HOST's dataset.
40+
--
41+
-- So this is a WIRING question, not a dead end — the same shape as
42+
-- GBM_BACKENDS_PATH, down to the environment variable. What is missing is a
43+
-- provider: the `.quirks` files ship inside libinput's own tarball, but
44+
-- mcpp-index has no way for a package to publish a data DIRECTORY, so nothing
45+
-- currently fills the variable. Until something does, libinput logs
46+
--
47+
-- failed to find data files ... will negatively affect device behavior
48+
--
49+
-- and runs on its built-in defaults. That is a real degradation and it is
50+
-- graceful: enumeration, events and gestures all work — what is lost is
51+
-- per-model tuning. Verified in tests/examples/libinput, which passes with the
52+
-- message present.
4153
package = {
4254
spec = "1",
4355
namespace = "compat",
@@ -62,30 +74,103 @@ package = {
6274
mcpp = {
6375
language = "c++23",
6476
import_std = false,
77+
-- Upstream asks for `c_std=gnu99` and means it — see the `typeof`
78+
-- note in cflags. `c_standard = "gnu11"` was tried here first and is
79+
-- NOT the fix: mcpp accepts the string and still emits `-std=c11`, so
80+
-- the descriptor would claim a dialect the compiler never sees.
6581
c_standard = "c11",
6682

67-
include_dirs = { "*/src", "*/include", "mcpp_generated" },
83+
-- `"*"` is the package ROOT, and it is here for exactly one file:
84+
-- `libinput-plugin-mouse-wheel-lowres.c:31` writes
85+
-- `#include "src/evdev-frame.h"` while every other source in the tree
86+
-- writes `#include "evdev-frame.h"`. Upstream gets both spellings for
87+
-- free because meson compiles from the project root; a package that
88+
-- only puts `*/src` on the search path resolves 39 files and fails the
89+
-- fortieth.
90+
include_dirs = { "*", "*/src", "*/include", "mcpp_generated" },
6891

6992
generated_files = {
7093
["mcpp_generated/config.h"] = [==[
7194
#ifndef MCPP_LIBINPUT_CONFIG_H
7295
#define MCPP_LIBINPUT_CONFIG_H
7396
/* meson's config.h, written out for Linux with a GCC-compatible toolchain.
7497
75-
LIBINPUT_QUIRKS_DIR is EMPTY on purpose. quirks.c reads model-specific
76-
`.quirks` files from it at runtime; upstream's default points into the
77-
build prefix, which after relocation is the HOST's dataset. Empty means a
78-
device gets libinput's built-in defaults instead of another machine's
79-
quirks — the same stance compat.libgbm takes with GBM_BACKENDS_PATH.
98+
LIBINPUT_QUIRKS_DIR is EMPTY on purpose, and it is a FALLBACK rather than
99+
the only way in: `libinput.c:1911` reads `getenv("LIBINPUT_QUIRKS_DIR")`
100+
first. Upstream's compiled-in default points into the build prefix, which
101+
after relocation is the HOST's dataset — so empty means a device gets
102+
libinput's built-in defaults instead of another machine's quirks, and an
103+
environment that has a dataset can still name it. Exactly the shape
104+
compat.libgbm has with GBM_BACKENDS_PATH, down to the variable.
80105
81106
HAVE_LUA and HAVE_LIBWACOM are absent: both are optional upstream and both
82107
would add a dependency this package does not need to do its job. */
83108
#define LIBINPUT_QUIRKS_DIR ""
84109
#define LIBINPUT_QUIRKS_SRCDIR ""
110+
/* The user's quirks override, `<sysconfdir>/libinput/local-overrides.quirks`
111+
upstream. Empty for the reason above: relocated, it names the HOST's file. */
112+
#define LIBINPUT_QUIRKS_OVERRIDE_FILE ""
113+
114+
/* Plugin search paths, both EMPTY and both required to exist:
115+
`libinput_plugin_system_append_default_paths` (libinput-plugin.c:387) names
116+
them unconditionally, outside any HAVE_PLUGINS guard. Empty paths append
117+
nothing, which is the behaviour this package wants — see the header comment
118+
on why the Lua plugin system is off. */
119+
#define LIBINPUT_PLUGIN_LIBDIR ""
120+
#define LIBINPUT_PLUGIN_ETCDIR ""
121+
122+
/* Printed into log messages that point a user at the documentation for the
123+
behaviour being reported. meson builds it from the version: micro < 90 means
124+
a release, so the URL names this release rather than `latest`. */
125+
#define HTTP_DOC_LINK "https://wayland.freedesktop.org/libinput/doc/1.31.3"
126+
85127
#define HAVE_LIBEVDEV_DISABLE_PROPERTY 1
86128
#define HAVE_MEMFD_CREATE 1
87129
#define HAVE_LOCALE_H 1
88130
#define HAVE_STRERRORNAME_NP 1
131+
#define HAVE_SIGABBREV_NP 1
132+
#define HAVE_PIDFD_OPEN 1
133+
134+
/* glibc has versionsort(3), and saying so is load-bearing rather than
135+
cosmetic: `libinput-versionsort.h` provides its OWN static fallback when
136+
this is unset, and a static definition of a name glibc already declared
137+
extern is a hard error, not a shadow. */
138+
#define HAVE_VERSIONSORT 1
139+
140+
/* mtdev is a declared dependency of this package, so the plugin that uses it
141+
is compiled unconditionally (see `libinput-plugin-mtdev.c` in sources). */
142+
#define HAVE_MTDEV 1
143+
144+
/* HAVE_C23_AUTO is deliberately ABSENT. meson probes for it by compiling
145+
`auto foo = gmtime(NULL);`, which needs C23; this package builds as c11, so
146+
the probe would fail here too and upstream's non-auto path is correct. */
147+
#endif
148+
]==],
149+
150+
-- meson's `src/libinput-version.h.in`, substituted for 1.31.3.
151+
--
152+
-- `libinput-private.h:45` includes it unconditionally, so every one
153+
-- of the 40 sources below needs it — this is not an optional
154+
-- convenience header. It went missing in the first version of this
155+
-- descriptor and NOTHING CAUGHT IT: the package validated, entered
156+
-- the index and shipped, because no test member consumed it and a
157+
-- package nobody compiles cannot fail to compile. The
158+
-- `tests/examples/libinput` member exists so that stays true only
159+
-- until someone builds it — which is what found this.
160+
--
161+
-- The three numbers are the version in `xpm` above, split. They are
162+
-- the package's public version macros, so a consumer doing
163+
-- `#if LIBINPUT_VERSION_MAJOR >= 1` gets a real answer; leaving
164+
-- them at 0 would compile just as well and lie.
165+
["mcpp_generated/libinput-version.h"] = [==[
166+
#ifndef LIBINPUT_VERSION_H
167+
#define LIBINPUT_VERSION_H
168+
169+
#define LIBINPUT_VERSION_MAJOR 1
170+
#define LIBINPUT_VERSION_MINOR 31
171+
#define LIBINPUT_VERSION_MICRO 3
172+
#define LIBINPUT_VERSION "1.31.3"
173+
89174
#endif
90175
]==],
91176
},
@@ -144,6 +229,27 @@ package = {
144229
cflags = {
145230
"-D_GNU_SOURCE",
146231
"-DHAVE_CONFIG_H",
232+
233+
-- The GNU `typeof` keyword, supplied by hand.
234+
--
235+
-- `util-mem.h:180` is `(typeof(*ptr_))_steal(ptr_)` — the cast that
236+
-- makes every `steal()` in the tree type-safe. Bare `typeof` is a
237+
-- GNU extension (and C23's spelling); ISO C11 has only
238+
-- `__typeof__`. Under `-std=c11` GCC parses `typeof(...)` as a call
239+
-- to an undeclared function, the cast collapses to `int`, and the
240+
-- damage lands as `-Wint-conversion` errors in a dozen unrelated
241+
-- files that never mention typeof.
242+
--
243+
-- This is a `-D` rather than `c_standard = "gnu11"` because the
244+
-- gnu dialects do not reach the compiler: mcpp accepts the string
245+
-- and still emits `-std=c11`. Measured, not assumed — gnu11 was
246+
-- set here and these exact errors survived it.
247+
--
248+
-- Safe because `__typeof__` IS `typeof`, always available in any
249+
-- dialect, and nothing can be named `typeof` in code that expects
250+
-- gnu99 anyway.
251+
"-Dtypeof=__typeof__",
252+
147253
"-fPIC",
148254
},
149255

tests/examples/libinput/mcpp.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# libinput test project — the top of the input chain.
2+
#
3+
# NO `[indices]` OF ITS OWN, and that is the interesting part.
4+
#
5+
# This member needs packages from TWO namespaces: `compat.libinput` (and the
6+
# `compat.libudev` / `compat.mtdev` it depends on) from this checkout, and
7+
# `freedesktop.libevdev` which libinput also links. A member-level `[indices]`
8+
# REPLACES the root's rather than merging, and one path can only be registered
9+
# under one namespace — so declaring `freedesktop = { path = "../../.." }` here
10+
# would make `compat.libinput` resolve against the published index instead.
11+
#
12+
# Inheriting the root's `compat = { path = "." }` is what works: the compat
13+
# packages come from the checkout, and `freedesktop.libevdev` resolves from the
14+
# PUBLISHED index — which is correct, because it is published. Same arrangement
15+
# tests/examples/asio-ssl relies on for the opposite reason.
16+
[package]
17+
name = "libinput-tests"
18+
version = "0.1.0"
19+
standard = "c++23"
20+
21+
[target.'cfg(linux)'.dependencies.compat]
22+
libinput = "1.31.3"

0 commit comments

Comments
 (0)