Materialize outputs after recursively memoized cache hits
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- csharp
- Lĩnh vực
- build-system
Hướng nghiên cứu
Đọc src/Common/MSBuildCachePluginBase.cs, tập trung vào đường dẫn kết quả đệ quy của ConcurrentDictionary<NodeContext, Lazy<Task>> và cách materializeOutputs được xử lý. Theo dõi các truy vấn đệ quy và trực tiếp, sau đó thêm một kiểm thử đồng thời/thứ tự mang tính tất định, bao quát các truy vấn phụ thuộc không theo thứ tự và các inner build của multi-targeting. Hoàn thành khi một kết quả đệ quy không materialize khiến các đầu ra bắt buộc được materialize đúng một lần, trong khi hành vi mặc định và hành vi không đệ quy vẫn không thay đổi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- C#
- Star
- 64
- Fork
- 24
- Merge trung bình
- 1 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 2
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/MSBuildCache
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
microsoft/MSBuildCache#154 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
microsoft/MSBuildCache#164 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
microsoft/MSBuildCache#159 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
microsoft/MSBuildCache#155 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
microsoft/MSBuildCache#149 · 3 bình luận ·
Tất cả issue của microsoft/MSBuildCache
Issue tương tự
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
sillsdev/languageforge-lexbox#2665 ·
-
bug documentation frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
azurenoops/spin_agent#975 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
SubtitleEdit/subtitleedit#15108 · 1 bình luận ·