Control embedding Restore files in binlog#5494
Conversation
|
I have tested this by building this PR version of NuGet and inserting into a boostrap version of MSBuild that I also built myself. I've verified that the two new properties work as expected when passing via command-line: However I've found that setting I did find that it works as expected when I create a <Project>
<PropertyGroup>
<EmbedDGSpecInBinlog>false</EmbedDGSpecInBinlog>
</PropertyGroup>
</Project>It then gets imported during Restore: It also does work as expected when restoring a specific .csproj, Another thing I've learned is that even if you set https://github.com/dotnet/sdk/pull/16840/files I've verified that So technically to turn off embedding However this PR works fine for the main goal: to be able to turn off .dgspec files specifically and keep other files, which is the behavior I want for those large binlogs. |
|
Another minor unexpected thing is that setting properties in |
|
This PR has been automatically marked as stale because it has no activity for 7 days. It will be closed if no further activity occurs within another 90 days of this comment. If it is closed, you may reopen it anytime when you're ready again, as long as you don't delete the branch. |
If you open %localappdata%\microsoft\MSBuildStructuredLog\Settings.txt and add IgnoreEmbeddedFiles=.dgspec.json, they won't be read from the binlog, thus saving memory and startup time. This is primarily to work around NuGet/NuGet.Client#5494, which embeds 600 MB of .nuget.dgspec.json files in a binlog, growing its size from 300 MB -> 900 MB, and slowing down the binlog loading time from 1:50 to 2:30.
|
@jeffkl this continues to be super painful for us, my proposal is to merge something in to get us unblocked for the next release, and if you like, we can still find the proper nice solution later. I'm worried we'll miss the next train and I'll have to live with 900 MB binlogs for another several months. |
9337d45 to
dc99fb4
Compare
|
@NuGet/nuget-client I have pushed a commit to update this pull request based on a conversation I had with the author. Please review. |
donnie-msft
left a comment
There was a problem hiding this comment.
I'm a little uncertain about "N/A" for documentation since there's a table in this PR description. Would customers benefit from updating one or more of the following?
I think this feature is only useful for us when a customer is reporting a problem and we need the dgspec. We would have them restore again with But my opinion is that we don't need to document it at this time since its really only on when you enable the binary logger and these files have already been embedded by default for 2+ years. |
76a91d5 to
159b386
Compare
Adds two new properties on the Restore and RestoreEx tasks: EmbedRestoreFilesInBinlog and EmbedDGSpecInBinlog The first one controls whether to embed any files from the Restore task into the binlog at all, the second allows to turn off .dgspec.json files specifically, as these can get quite large. In one case the binlog size increased from 300 MB to 900 MB by including the .dgspec.json files. Both are true by default to preserve existing behavior. Fixes NuGet/Home#12957
159b386 to
e48c3c7
Compare
|
OMG this makes me so happy! I can’t wait to consume this! Thanks! |


Bug
Fixes: NuGet/Home#12957
Regression? Last working version:
Description
This changes allows users to specify what level of files to embed in the MSBuild binary log.
0orfalse2Users can specify what get embedded via the MSBuild property
RestoreEmbedFilesInBinlog:For example, to disable the functionality:
Or to opt into embedding everything:
Any other value embeds just the default (assets file, g.props, and g.targets)
PR Checklist
PR has a meaningful title
PR has a linked issue.
Described changes
Tests
Documentation