-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 unnecessary ref source projects from Microsoft.Bcl packages #105312
Conversation
Contributes to #58163 - Remove unused reference assembly projects and move the forwards.cs files into the src folder. - Don't rely on IsPartialFacadeAssembly switch anymore which makes it possible to use the compiler generated xml file and removes the dependency on the reference source project. - Enable package baseline validation for Microsoft.Bcl.Numerics This improves restore and build perf in total as well as per leaf project on the CLI and inside VS.
- Update projects that now need to reference the src project as the ref project got deleted. - Remove target that validates that ref projects only reference ref project. That target doesn't make sense anymore with our direction towards removing reference assembly projects.
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries |
/ba-g dead lettered helix queue |
|
||
namespace System.Buffers.Text | ||
{ | ||
public static class Base64Url |
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.
@ViktorHofer, I'm confused by this change. Where does the netstandard2.0 ref for this come from now that this is deleted? Is the idea that we no longer ship a ref and just let the implementation assembly be the surface area? Or rely on Roslyn to generate a ref assembly from the implementation assembly?
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.
That's the idea afaik yeah. From the linked issue:
Since .NET 6, out-of-band reference assemblies like Microsoft.Extensions.* don't ship to customers anymore as they aren't part of the generated packages. Their sole purpose today is infrastructure only needs (ApiCompat and GenFacades).
/cc @ericstj
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.
I'm out on leave but just saw this message. Yes, @akoeplinger is correct. Reference assemblies that don't ship inside a shared framework don't reach the customer anymore. This started between .NET 5 and .NET 6.
Example:
https://nuget.info/packages/System.Data.Odbc/5.0.0 (has a "ref" folder)
https://nuget.info/packages/System.Data.Odbc/8.0.0 (doesn't have a "ref" folder)
Microsoft.Bcl packages are in the same boat, i.e. AsyncInterfaces already haven't had a ref folder before this change: https://nuget.info/packages/Microsoft.Bcl.AsyncInterfaces/9.0.0-preview.6.24327.7
Therefore we don't need to even let Roslyn generate them.
For libraries that ship inside any of our available shared frameworks (Microsoft.NETCore.App.Ref, Microsoft.AspNetCore.App.Ref and Microsoft.WindowsDesktop.App.Ref) we need reference assemblies. The idea here is that we let the compiler automatically generate them from the implementation assembly instead of us hand authoring them via dedicated ref projects (#58163).
Remove unused reference assembly projects from Bcl folders
Contributes to #58163
See the linked issue for more details. The most important detail here is that runtime nuget packages don't include reference assemblies anymore so those projects aren't useful and only slow down the restore and build.
Commit 1:
forwards.cs files into the src folder.
which makes it possible to use the compiler generated xml
file and removes the dependency on the reference source project.
in favor of the information listed in the package readmes.
This improves restore and build perf in total as well as per leaf
project on the CLI and inside VS.
Commit 2:
the ref project got deleted.
project. That target doesn't make sense anymore with our direction
towards removing reference assembly projects.
APICompat and package baseline validation validates that this change doesn't impact the public API surface area.