-
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
Remove dependency on all Roslyn assemblies from build host #73497
Conversation
@@ -1034,8 +1021,8 @@ public static int Sum<T>(this ImmutableArray<T> items, Func<T, int, int> selecto | |||
where TNamedTypeSymbol : class, TNamespaceOrTypeSymbol | |||
where TNamespaceSymbol : class, TNamespaceOrTypeSymbol | |||
{ | |||
foreach (var (name, value) in dictionary) | |||
result.Add(name, createMembers(value)); | |||
foreach (var entry in dictionary) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid dependency on KeyValuePair deconstructor extension
@jasonmalinowski @dibarbet @dotnet/roslyn-ide @dotnet/roslyn-compiler ptal |
@@ -11,45 +11,6 @@ namespace Roslyn.Utilities | |||
{ | |||
internal static class EnumUtilities | |||
{ | |||
/// <summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved, renamed and simplified
using System.Text; | ||
|
||
namespace Microsoft.CodeAnalysis | ||
{ | ||
internal static partial class EncodingExtensions | ||
{ | ||
/// <summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved and simplified
@@ -764,19 +764,6 @@ public static ImmutableArray<T> Distinct<T>(this ImmutableArray<T> array, IEqual | |||
return result; | |||
} | |||
|
|||
internal static bool HasAnyErrors<T>(this ImmutableArray<T> diagnostics) where T : Diagnostic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems reasonable
Implements #70945
Reduces size of the Workspace.MSBuild package from 33.5MB down to 4.3MB.
This in turn reduces the size of the .NET SDK and the VS Code Extension by the same amount.
net472:
![image](https://private-user-images.githubusercontent.com/41759/330974344-9e3d8bc4-8018-449d-ac08-0968fd991c0c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwMzAzOTgsIm5iZiI6MTcyNDAzMDA5OCwicGF0aCI6Ii80MTc1OS8zMzA5NzQzNDQtOWUzZDhiYzQtODAxOC00NDlkLWFjMDgtMDk2OGZkOTkxYzBjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDAxMTQ1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFkZTc5ZjM3MzczM2I0YzZkZTA2OTE0MDRkNjFlYWMxNzgzMmM4ZjE4NWVjNjVhOGIyYTkzYTQ5ZDNkMTU2Y2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.qz8NkH6_R2zabgbYCbJyKphKp4AwKKZNxtDjqWxDapI)
netcore:
![image](https://private-user-images.githubusercontent.com/41759/330974385-c1d1b8b8-eebf-4062-9c0b-4a8838f8b4e8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwMzAzOTgsIm5iZiI6MTcyNDAzMDA5OCwicGF0aCI6Ii80MTc1OS8zMzA5NzQzODUtYzFkMWI4YjgtZWViZi00MDYyLTljMGItNGE4ODM4ZjhiNGU4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDAxMTQ1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY3OTEyNmFkNDU4MjA1Y2FhNzJjNGY4ZWQzY2VjMzVlNDVhOWIxNzIyMjhiODQ5MjBmZDJkNDZkOWQyZGQzZDEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.9qLjhGZ156J3n-03ZvebDQRh-qHu9buDwmJYLyk7R4o)
As noted in #70945, the build host only used a handful of compiler types. These types can be easily avoided. The build host also uses quite a few extensions and utilities, which can be linked instead of referenced. To make the linking cleaner this change moves a few types defined in the compiler
InternalUtilities
that had dependencies on non-utility Roslyn types elsewhere. This allows the host to simply link to all internal utilities.As a follow up, I believe it would be useful to rename
InternalUtilities
toFrameworkUtilities
and treat this code as a layer below the compiler (on the same level as PooledObjects and Collections).