Create ProjectImports.zip in memory instead of on disk#5718
Create ProjectImports.zip in memory instead of on disk#5718rainersigwald merged 4 commits intodotnet:masterfrom
Conversation
|
|
|
I did some research on binlogs of various sizes and the zip archive size didn't exceed 2.5 MB, so I think there's no need to worry about increased memory consumption, it's negligible. When I initially wrote this I had no idea how large this archive is going to be in practice for people's builds, but fortunately it looks like those fears were unfounded now that we have a large collection of real-life binlogs (largest I have is 3.2GB with 2.5 MB archive size). |
|
@asklar you'll need to sign the agreement here: |
|
thanks @KirillOsenkov I signed it yesterday, it looks like the check has a race condition where it shows unsigned and signed too? :) |
rainersigwald
left a comment
There was a problem hiding this comment.
Nice! @KirillOsenkov disarmed my size concerns.
Co-authored-by: Rainer Sigwald <raines@microsoft.com>
benvillalobos
left a comment
There was a problem hiding this comment.
Looks solid to me. Thanks for the contribution!
|
@rainersigwald I'm trying to find which version of msbuild / VS included my change, I couldn't find it in the notes for any release, could you help me? |
|
From the tags on the commit ec61b6f it looks like it first appeared in 16.8. |


Fixes #5383
The behavior of /bl with Embed (which is the default) is such that it will create a zip file named msbuild.ProjectImports.zip next to the binlog, and when the build completes it will embed the zip into the binlog and delete the binlog.
This poses a problem for some processes (which can be called as part of a build) that expect all files in the local directory to be accessible. Since MSBuild is holding open this ProjectImports.zip file, a process like React Native's
react-native bundlecommand will fail the build due to sharing violations.How tested: Validated with a simple setup of 2 csproj, the first includes the second. Verified that the resulting binlog still includes the imported projects. I changed the closing logic a little because ZipArchive requires to be closed before the data gets flushed to the stream.