-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Poly fill Index and Range types #104170
Poly fill Index and Range types #104170
Conversation
Note regarding the
|
Note regarding the
|
Tagging subscribers to this area: @dotnet/area-system-memory |
CC @stephentoub @bartonjs @tannergooding @terrajobst @jaredpar @ViktorHofer I appreciate if you can take a quick look too. |
This comment was marked as resolved.
This comment was marked as resolved.
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.
LGTM, most comments here are just on style. Tried to look for precedent elsewhere in repo. If you take the suggestions please do the same in src project.
src/libraries/Microsoft.Bcl.Memory/ref/Microsoft.Bcl.Memory.csproj
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Bcl.Memory/ref/Microsoft.Bcl.Memory.csproj
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Bcl.Memory/ref/Microsoft.Bcl.Memory.csproj
Outdated
Show resolved
Hide resolved
What's the reason to target .NET Core explicitly when we just give it the .NET Standard 2.1 assets? |
The existing type |
Gotcha, so .NET Core and .NET Standard are in fact not getting the same assets. I read the configuration wrong then. |
src/libraries/Common/tests/System/Runtime/CompilerServices/RuntimeHelpers.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Bcl.Memory/tests/Microsoft.Bcl.Memory.Tests.csproj
Show resolved
Hide resolved
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.
Changes LGTM. I agree with @stephentoub that we should replace the existing usages of IncludeIndexRangeTypes
.
We need to make sure to ship the netstandard2.0 version of Microsoft.Bcl.Memory in the ref pack in the |
But then you also need to make sure that System.Memory.dll is present as this library depends on it. Redistributing System.Memory.dll which last shipped in 2022 from a corefx branch inside the Microsoft.NETCore.App.Ref targeting pack is problematic, to say the least. Unless we know that the compiler already includes System.Memory.dll when targeting .NET Framework, then it would be fine to omit the assembly (source generators are just compiler plugins). I find it very weird that we now ship this Bcl assembly inside the Microsoft.NETCore.App.Ref targeting pack (inside the source gen folder) but given that source generators must target netstandard2.0, this might be OK. cc @jaredpar as this is related to your design doc about compilers shipping inside the SDK vs VS. |
@jkoritzinsky @ViktorHofer do you know how I can add
This didn't work and I am not sure either if it will be correct. The list there is detect if it is analyzer and handle it accordingly. It is not right every project reference |
I will take a look tomorrow. |
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Microsoft.Interop.SourceGeneration\Microsoft.Interop.SourceGeneration.csproj" Pack="true" PackagePath="analyzers/dotnet/cs" /> | ||
<ProjectReference Include="$(LibrariesProjectRoot)\Microsoft.Bcl.Memory\src\Microsoft.Bcl.Memory.csproj" /> |
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.
Look at the ProjectReference above. You need to specify Pack and PackagePath so that the ProjectReference gets copied correctly.
<ProjectReference Include="$(LibrariesProjectRoot)\Microsoft.Bcl.Memory\src\Microsoft.Bcl.Memory.csproj" /> | |
<ProjectReference Include="$(LibrariesProjectRoot)\Microsoft.Bcl.Memory\src\Microsoft.Bcl.Memory.csproj" Pack="true" PackagePath="analyzers/dotnet/cs" /> |
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.
Let me try that. Thanks!
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.
@jkoritzinsky @stephentoub after trying and talking to @ViktorHofer, looks it needs non-trivial change in the infra to allow bin-placing the Bcl library next to the source gen library in the ref pack. For now, I am going to revert the source gen changes and will create an issue to track the infrastructure work and to add the source gen dependency on the new Bcl library.
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 created the issue #104308 to track the work need to be done.
That doc only covers two items:
It wouldn't change anything related to how dependencies of analyzers load |
Fixes #28285