Materialize outputs after recursively memoized cache hits
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- csharp
- 领域
- build-system
调研方向
阅读 src/Common/MSBuildCachePluginBase.cs,重点关注 ConcurrentDictionary<NodeContext, Lazy<Task>> 的递归结果路径,以及 materializeOutputs 的处理方式。跟踪递归查询和直接查询,然后添加一个确定性的并发/顺序测试,覆盖乱序依赖查询和 multi-targeting 内部构建。完成标准是:一次不进行 materialize 的递归命中会使所需输出恰好 materialize 一次,同时默认行为和非递归行为保持不变。
由索引模型根据 Issue 内容生成。
描述
Summary
Recursive cache results are memoized only by NodeContext, but each memoized Lazy<Task<CacheResult>> captures whether outputs should be materialized.
Impact
With MSBuildCacheGetResultsForUnqueriedDependencies=true, a recursive query that does not require outputs can populate the memoized result first. A later direct query for the same node reuses that cache hit without materializing required files, allowing MSBuild to proceed with missing reference assemblies or other outputs.
Evidence
src/Common/MSBuildCachePluginBase.cs stores recursive results in ConcurrentDictionary<NodeContext, Lazy<Task<CacheResult>>>. materializeOutputs is not part of the key or separately tracked. The implementation comments assume the node will not later be queried directly, while the setting is documented for builds that are not executed in graph order.
Suggested fix
Separate result lookup from materialization state. A direct caller requiring outputs should be able to materialize a previously memoized non-materialized hit without repeating fingerprint/cache lookup. Alternatively, include the materialization requirement in memoization while preventing duplicate result mutation.
Acceptance criteria
- A recursive non-materializing hit followed by a direct query materializes outputs exactly once.
- The fix covers out-of-order dependency queries and multi-targeting inner builds.
- Default and non-recursive behavior remains unchanged.
- A deterministic concurrency/order test covers the regression.
- 主要语言
- C#
- 星标
- 64
- 派生
- 24
- 平均合并
- 1 天 14 小时
- 30 天内合并 PR
- 2
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/MSBuildCache 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 85/100
microsoft/MSBuildCache#154 ·
-
难度 4/5 3-5 天 新手友好度 48/100
microsoft/MSBuildCache#164 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
microsoft/MSBuildCache#159 ·
-
难度 4/5 3-5 天 新手友好度 25/100
microsoft/MSBuildCache#155 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
microsoft/MSBuildCache#149 · 3 条评论 ·
查看 microsoft/MSBuildCache 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
-
bug needs response
难度 2/5 1-3 小时 新手友好度 82/100
Adyen/adyen-dotnet-api-library#1869 ·
-
Status: Needs Triage Type: Bug
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 88/100
-
bug effort:S P3
难度 2/5 1-3 小时 新手友好度 84/100
nightscout/nocturne#1602 ·