dotnet / dotnet/msbuild

Feature request: Make project evaluation result machine agnostic to push Project cache from local to the cloud/repo

Open
#6,182 2 comments 0 reactions 0 assignees View on GitHub
Partner request triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

Currently the project evaluation result contains machine and user specific information in the MSBuild.Project returned from an evaluation of the project file.

**Context on caching**
The current plan is to have CPS cache the resulting evaluation result locally to speed up the consequent solution load by using this read-only copy of the project evaluation result. The cache gets read in CPS::PrepareProjects to create a read-only Project collection. The read-only Project is used during solution load to cater to all of the read lock based project evaluation access requests. More details on write and upgradeable lock handling below in Implementation.

**Where is the cache stored now?**
The cache will be written locally in a custom binary format structure in the CPS code (can be moved into msbuild later if we see non-CPS users benefiting from it) that is heavily optimized towards the data types produced by the MSBuild.Project evaluation object. With the ProjectInstance as an indicator, the project evaluation will take upwards of 1.75MB. There will be efforts to compact this by customizing the serializer to data that interests CPS.

The cache will be stored in the .vs folder, mimicking the Project tree format with all the interned strings stored at the solution level and individual Project state with string indexes stored as individual project cache files. The consequent iteration of the cache is meant to converge with the design time build cache to further data deduplicate, but the first phase will be focused on minimizing cache contentions.

More details on the project evaluation caching is in [Improving solution load for CPS based project](https://microsoft.sharepoint.com/:w:/t/DD_VSIDE/EcYtMhB6iwZJlE83X0RS35kBeyjzVwwTQ0WfP16gzDsqtA?e=oGLYaC)

**So what is the problem?**
The cache includes Project evaluation data that is not machine agnostic and hence cannot be moved to the cloud right now to be used across different consumers of the same project.

**Ask**
It is quite possible that the project evaluation result will always contain machine specific information where the cache was created. The ask is to assess feasibility and minimize embedding machine specific information into the project evaluation result, perhaps isolate that into a separate object that can either reacquired via a cheap call into msbuild, GetMachineSpecificProjectEvaluationData or even cache that locally.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.