Skip to content

Commit 7bf067b

Browse files
committed
feat: declare GLFW GLX runtime metadata
1 parent 55f273c commit 7bf067b

4 files changed

Lines changed: 26 additions & 5 deletions

File tree

.agents/docs/2026-06-03-gl-runtime-packages-plan.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ requirements as separate concepts.
4242
is practical in current mcpp package descriptors.
4343
- If libglvnd source packaging is not yet practical, keep this task open and
4444
document the exact blocker rather than replacing it with a host shim.
45-
- [ ] Update `compat.glfw` runtime metadata.
45+
- [x] Update `compat.glfw` runtime metadata.
4646
- Candidate file: `pkgs/c/compat.glfw.lua`.
4747
- Declare `dlopen_libs = {"libGLX.so.0", "libGL.so.1", "libGL.so"}`.
4848
- Declare `capabilities = {"x11.display", "opengl.glx.driver"}` for Linux
@@ -53,22 +53,28 @@ requirements as separate concepts.
5353
- The target behavior is `mcpp run` with package-declared runtime metadata.
5454
- The existing host shim may remain only as diagnostic evidence until the
5555
mcpp runtime metadata support lands.
56-
- [ ] Add README package semantics.
56+
- [x] Add README package semantics.
5757
- Candidate file: `README.md`.
5858
- Document the difference between OpenGL headers, GL runtime dispatch, and
5959
host display/GPU capabilities.
6060

6161
## Verification
6262

63+
- [x] `bash -n tests/smoke_compat_imgui_window.sh`
64+
- [x] Static metadata check: `compat.glfw` contains `dlopen_libs`,
65+
`libGLX.so.0`, and `opengl.glx.driver`.
6366
- [ ] `MCPP=<mcpp> tests/smoke_compat_imgui.sh`
6467
- [ ] `MCPP=<mcpp> tests/smoke_compat_imgui_window.sh`
68+
- Attempted locally on 2026-06-03; the run was stopped after the temporary
69+
sandbox stalled in dependency installation. This remains unchecked until a
70+
full smoke completes.
6571
- [ ] `MCPP=<mcpp> MCPP_INDEX_RUN_WINDOW_SMOKE=1 tests/smoke_compat_imgui_window.sh`
6672
- [ ] A focused GLFW/OpenGL smoke that uses `mcpp run` without script-local
6773
`LD_LIBRARY_PATH` once mcpp runtime metadata support is available.
6874

6975
## PR / CI / Merge Notes
7076

71-
- [ ] Commit this plan as the first checkpoint.
77+
- [x] Commit this plan as the first checkpoint.
7278
- [ ] Open a PR with sanitized paths and no local machine details.
7379
- [ ] Include a test plan and note which runtime checks require a display.
7480
- [ ] Wait for repository validation CI.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ mcpp 0.0.3+ 的 transitive walker 自动沿链路传播头文件和依赖,消费
112112

113113
> 当前 X11/XCB/Xau/Xdmcp 以及 GLFW 需要的 Xcursor/Xext/Xfixes/Xi/Xinerama/
114114
> Xrandr/Xrender 都已按上游源码提供 runtime `.so``compat.glfw` 仍沿用
115-
> GLFW 上游的 GLX/OpenGL 动态加载行为,窗口运行时需要宿主环境提供可用的
116-
> X server/GLX/OpenGL 驱动。
115+
> GLFW 上游的 GLX/OpenGL 动态加载行为,包描述会声明需要 `dlopen`
116+
> `libGLX.so.0`/`libGL.so.1`/`libGL.so` 以及 `opengl.glx.driver` 能力。
117+
> 窗口运行时仍需要宿主环境提供可用的 X server/GLX/OpenGL 驱动。
117118
118119
### 本地 smoke 验证
119120

pkgs/c/compat.glfw.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ package = {
5454
},
5555
linux = {
5656
cflags = { "-D_DEFAULT_SOURCE", "-D_GLFW_X11" },
57+
runtime = {
58+
dlopen_libs = { "libGLX.so.0", "libGL.so.1", "libGL.so" },
59+
capabilities = { "x11.display", "opengl.glx.driver" },
60+
},
5761
sources = {
5862
"src/x11_init.c",
5963
"src/x11_monitor.c",

tests/smoke_compat_imgui_window.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ if [[ -z "$MCPP_BIN" || ! -x "$MCPP_BIN" ]]; then
1414
exit 1
1515
fi
1616

17+
glfw_pkg="$ROOT/pkgs/c/compat.glfw.lua"
18+
grep -q 'dlopen_libs' "$glfw_pkg" || {
19+
echo "FATAL: compat.glfw missing GLX/OpenGL dlopen runtime metadata" >&2
20+
exit 1
21+
}
22+
grep -q 'opengl.glx.driver' "$glfw_pkg" || {
23+
echo "FATAL: compat.glfw missing OpenGL GLX system capability metadata" >&2
24+
exit 1
25+
}
26+
1727
TMP="$(mktemp -d)"
1828
if [[ "${MCPP_INDEX_KEEP_SMOKE_TMP:-0}" == "1" ]]; then
1929
echo "KEEP: $TMP"

0 commit comments

Comments
 (0)