|
| 1 | +# mcpp-index: GL Runtime Packages Plan |
| 2 | + |
| 3 | +> 状态: active |
| 4 | +> 分支: `codex/gl-runtime-closure-index` |
| 5 | +> PR: pending |
| 6 | +> Last updated: 2026-06-03 |
| 7 | +> 目标: 让 GLFW/OpenGL 相关包描述表达标准运行时需求,而不是依赖 smoke 脚本里的临时 `LD_LIBRARY_PATH` shim。 |
| 8 | +
|
| 9 | +## Scope |
| 10 | + |
| 11 | +This repository owns package metadata and package-level smoke tests. It should |
| 12 | +model OpenGL headers, GL dispatch/runtime libraries, and system GPU/display |
| 13 | +requirements as separate concepts. |
| 14 | + |
| 15 | +## Package Boundary |
| 16 | + |
| 17 | +- `compat.opengl` |
| 18 | + - Keep as Khronos OpenGL registry/header provider. |
| 19 | + - Do not turn it into a host driver wrapper. |
| 20 | +- `compat.glfw` |
| 21 | + - Owns GLFW source build and X11/GLX backend selection. |
| 22 | + - Should declare runtime requirements for the GLX libraries it loads through |
| 23 | + GLFW's upstream `dlopen` behavior. |
| 24 | +- `compat.glvnd` or `compat.libglvnd` |
| 25 | + - New standard runtime package candidate for GL dispatch libraries: |
| 26 | + `libOpenGL.so`, `libGL.so`, `libGLX.so`, `libGLdispatch.so`. |
| 27 | +- `compat.mesa-llvmpipe` |
| 28 | + - Optional follow-up for self-contained software rendering and CI/headless |
| 29 | + validation. This is larger and should not block the first metadata path. |
| 30 | +- Host GPU/OpenGL driver |
| 31 | + - Model as a system capability such as `opengl.glx.driver`. |
| 32 | + - Do not silently pretend vendor drivers are normal redistributable packages. |
| 33 | + |
| 34 | +## Implementation Plan |
| 35 | + |
| 36 | +- [x] Create this repository-level plan checkpoint. |
| 37 | +- [ ] Keep `compat.opengl` header-only and update docs if needed. |
| 38 | + - Candidate file: `pkgs/c/compat.opengl.lua`. |
| 39 | +- [ ] Add a GL runtime provider package. |
| 40 | + - Candidate file: `pkgs/c/compat.glvnd.lua`. |
| 41 | + - The first version may expose libglvnd runtime/headers if the source build |
| 42 | + is practical in current mcpp package descriptors. |
| 43 | + - If libglvnd source packaging is not yet practical, keep this task open and |
| 44 | + document the exact blocker rather than replacing it with a host shim. |
| 45 | +- [x] Update `compat.glfw` runtime metadata. |
| 46 | + - Candidate file: `pkgs/c/compat.glfw.lua`. |
| 47 | + - Declare `dlopen_libs = {"libGLX.so.0", "libGL.so.1", "libGL.so"}`. |
| 48 | + - Declare `capabilities = {"x11.display", "opengl.glx.driver"}` for Linux |
| 49 | + X11/GLX window execution. |
| 50 | + - Keep X11 link/runtime packages as normal dependencies. |
| 51 | +- [ ] Replace script-only GL runtime behavior in the window smoke. |
| 52 | + - Candidate file: `tests/smoke_compat_imgui_window.sh`. |
| 53 | + - The target behavior is `mcpp run` with package-declared runtime metadata. |
| 54 | + - The existing host shim may remain only as diagnostic evidence until the |
| 55 | + mcpp runtime metadata support lands. |
| 56 | +- [x] Add README package semantics. |
| 57 | + - Candidate file: `README.md`. |
| 58 | + - Document the difference between OpenGL headers, GL runtime dispatch, and |
| 59 | + host display/GPU capabilities. |
| 60 | + |
| 61 | +## Verification |
| 62 | + |
| 63 | +- [x] `lua5.4 -e "assert(loadfile('pkgs/c/compat.glfw.lua', 't'))"` |
| 64 | +- [x] `lua5.4 -e "assert(loadfile('pkgs/c/compat.opengl.lua', 't'))"` |
| 65 | +- [x] Lua syntax check for all `pkgs/**/*.lua` |
| 66 | +- [x] `bash -n tests/smoke_compat_imgui_window.sh` |
| 67 | +- [x] Static metadata check: `compat.glfw` contains `dlopen_libs`, |
| 68 | + `libGLX.so.0`, and `opengl.glx.driver`. |
| 69 | +- [ ] `MCPP=<mcpp> tests/smoke_compat_imgui.sh` |
| 70 | +- [ ] `MCPP=<mcpp> tests/smoke_compat_imgui_window.sh` |
| 71 | + - Attempted locally on 2026-06-03; the run was stopped after the temporary |
| 72 | + sandbox stalled in dependency installation. This remains unchecked until a |
| 73 | + full smoke completes. |
| 74 | +- [ ] `MCPP=<mcpp> MCPP_INDEX_RUN_WINDOW_SMOKE=1 tests/smoke_compat_imgui_window.sh` |
| 75 | +- [ ] A focused GLFW/OpenGL smoke that uses `mcpp run` without script-local |
| 76 | + `LD_LIBRARY_PATH` once mcpp runtime metadata support is available. |
| 77 | + |
| 78 | +## PR / CI / Merge Notes |
| 79 | + |
| 80 | +- [x] Commit this plan as the first checkpoint. |
| 81 | +- [ ] Open a PR with sanitized paths and no local machine details. |
| 82 | +- [ ] Include a test plan and note which runtime checks require a display. |
| 83 | +- [ ] Wait for repository validation CI. |
| 84 | +- [ ] Squash merge after required checks pass. |
| 85 | + |
| 86 | +## Cross-Repository Dependencies |
| 87 | + |
| 88 | +- Depends on `mcpp` runtime metadata support for the final no-shim run smoke. |
| 89 | +- Feeds `imgui-m` validation by making its window example runnable through |
| 90 | + standard package metadata. |
| 91 | +- Does not require `xim-pkgindex` until a released mcpp or package-index update |
| 92 | + needs to be mirrored or distributed through xlings. |
0 commit comments