feat(compat.vulkan-validation-layers): the Khronos validation layer for mcpp-built programs - #406
Draft
Sunrisepeak wants to merge 1 commit into
Draft
Sunrisepeak wants to merge 1 commit into
Sunrisepeak wants to merge 1 commit into
Conversation
…or mcpp-built programs, bound to xim:vulkan-validation-layers A debug build asks the loader for VK_LAYER_KHRONOS_validation; the host's copy is found by manifest and lost at dlopen, because an mcpp-built program runs on the ecosystem's glibc whose loader never searches /usr/lib. Drivers are bridged from the host (compat.vulkan-runtime) because they can only come from the machine; a layer is ordinary software and is a payload of the ecosystem, so this package is the binding: an anchor, a runtime dependency on the xim payload, and nothing to link. Discovery is the xim recipe's: the manifest in the subos's share/vulkan/explicit_layer.d, the subos share on XDG_DATA_DIRS, and mcpp carrying subos declarations into the programs it launches (mcpp#352). tests/examples/vulkan-validation-layers asserts the loader enumerates the layer and can load its library (vkEnumerateInstanceExtensionProperties by layer name), on a runner with no GPU.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
新增
compat.vulkan-validation-layers(shape I,生态绑定,和compat.libgbm同形):把xim:vulkan-validation-layers(openxlings/xim-pkgindex 的VK_LAYER_KHRONOS_validationpayload)作为 runtime 依赖带进项目环境,让 mcpp 构建的程序在 debug 下能开 validation,而不去碰宿主的/usr/lib。为什么:mcpp 产物跑在生态的 glibc 上,宿主装的 layer 能被 loader 按 manifest 找到、却 dlopen 不到(裸 soname,不在 rpath),
vkCreateInstance失败。驱动走compat.vulkan-runtime桥接是因为只能来自机器;layer 是普通软件,进生态。形态:无自有源码,一个 anchor(上游该 tag 的
LICENSE.txt,镜像到mcpp-res/vulkan-validation-layers,sha 一致),deps.runtime = xim:vulkan-validation-layers@1.4.357.0。消费者写在[dev-dependencies]。发现:xim 配方把 manifest 放进 subos 的
share/vulkan/explicit_layer.d并声明XDG_DATA_DIRS;mcpp 把 subos 声明带进mcpp run/mcpp test(mcpp#352),引擎不用改。feature:无。
测试
tests/examples/vulkan-validation-layers:loader 枚举到该 layer,vkEnumerateInstanceExtensionProperties(layer)让 loader 真正加载.so并返回VK_EXT_debug_utils;不创建 instance,无 GPU 的 runner 上成立。Linux only,其它平台 no-op main。设计记录:
.agents/docs/2026-09-13-add-vulkan-validation-layers-plan.md。Test plan
check_mirror_urls、check_package_name、mcpp xpkg parse@ CI 版本)通过;mcpp test -p vulkan-validation-layers通过(输出见下)。vulkan-validation-layers成员。xim:依赖解析不到)。前置:openxlings/xim-pkgindex#835 合并并发布索引之后,这里的 workspace 检查才能通过(
xim:vulkan-validation-layers目前 "not published yet",本地已复现同一错误)。lint 和 mirror 检查不依赖它。