fix: 为模块消费者恢复已有 PCM - #15
Open
helantianshen wants to merge 2 commits into
Open
Conversation
helantianshen
marked this pull request as ready for review
August 12, 2026 08:53
Author
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.
问题
mcpp 可能为同一项目生成多个兼容的构建上下文。模块接口的 PCM 已在一个上下文中生成,但测试或其他消费者的
compile_commands.json指向另一个pcm.cache。插件此前只按 CDB 启动 clangd,不会恢复消费者目录缺少的模块产物,因此一键配置或刷新编译数据库后仍可能出现:
Module 'mcpplibs.cmp' not foundmodule file not foundclangd 无法加载所需模块产物修复
插件不自行生成模块映射,也不会跨编译器或跨目标平台复用缓存。
验证
npm test:269/269 通过npm run package:成功生成 VSIXmcpp build与mcpp build --configure-only均成功module_not_found/ast_file_not_found作为结果环境说明
Windows 上 mcpp 2026.8.11.3 检查内置 xlings 时会使用 Linux 重定向写法,
cmd.exe因而输出The system cannot find the path specified.。本机已按 mcpp 支持的配置改用xlings.binary = "system",复用版本一致的 xlings 2026.8.11.2;该环境问题不需要由插件绕过。项目是纯库目标,因此
mcpp run返回error: no binary target in this package属于预期行为。