-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce the size of the MSBuildWorkspace BuildHost directories #70945
Comments
When using packages above version 4.8, buildHost related folders will be generated, which takes up too much space. I want to know, is there any way to reduce the generated content now? |
@niltor Which version are you using? We've made some improvements in more recent versions to bring the size back down. |
(i.e. I think we may be able to close this bug as fixed) |
@jasonmalinowski Version 4.9 or 4.10. Now I'm using version 4.8 to avoid this issue! |
@niltor Looks like the improvements are in 4.11.0-2.final. Give that a shot, the final 4.11 packages should be out in a week or two. |
As far as what would be left to do:
Beyond that things get much smaller and also much more esoteric to replace. So I'll leave this bug open for the resources removal, but that's going to be about as small as we can get then. |
Thank you for what you are doing. As a user, when using version 4.8, the generated files do not include the two huge directories BuildHost-472 and BuildHost-netcore, and the program can still run normally. But when using 4.9 or 4.10, there will be these two additional directories, each of which is close to 20mb in size. It is indeed an unacceptable change. I tried the latest preview version 4.11.0-3.final, and the generated content is much smaller than before, but it is still much larger than 4.8. I will continue to use the 4.8 version. |
The size should be down to around 3 MB for each directory now. |
I wonder if #73497 is the reason this hangs in azure pipelines windows 2022 CI/CD: using var workspace = MSBuildWorkspace.Create();
workspace.WorkspaceFailed += (_, args) => Console.WriteLine(args.Diagnostic.Message);
var solution = await workspace.OpenSolutionAsync(solutionPath); I haven't found a workaround and is happening 4.9+. |
I'm not aware of issues here. @kamronbatman can you file a new bug with some more details? |
I opened an issue here: #75967 |
Closing out as complete (as jason says we're down to 3mb). |
As of this writing, this BuildHost directories we deploy as part of MSBuildWorkspace are about 15 MB each, totaling around 30 MB. But the majority of that size is us deploying Microsoft.CodeAnalysis.dll and Microsoft.CodeAnalysis.Workspaces.dll and their dependencies. Of the 15 MB of a single BuildHost, those are at least 10 MB (counting some obvious dependencies).
However, for the most part we're not really using much from those projects. We're using the SourceCodeKind enum from Microsoft.CodeAnalysis.dll and some of our Contract asserts from Workspaces, and not much else. With a few small tweaks (or linked files) we can easily cut these references and save a bunch of space on deployments on disk.
The text was updated successfully, but these errors were encountered: