-
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
Ensure no component embed the Index/Range source code and reference Microsoft.Bcl.Memory package instead #104308
Comments
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries |
Please also see my concerns that I shared here. |
I don't think we should be taking dependencies in our source generators. Analyzers don't have a great system for distributing dependencies - no way to specify those to the compiler, nor control loading - also no way to use the framework version when it exists. In cases of our analyzers it's better to share source. |
Closing as by design. We don't want source generator assemblies to take dependencies on other locally built assemblies for the above reasons (a contract system / targeting pack for compiler plugins don't exist today). |
Description
We have poly filled the Index and Range types to make them work on ns2.0 and netfx. This issue is tracking to ensure all components we build in .NET shouldn't carry its own version of these types and instead should be referencing
Microsoft.Bcl.Memory
package.Searching the sources, looks only ComInterfaceGenerator.csproj is using the Index source file. To remove this dependency, we will need to have this project depend on
Microsoft.Bcl.Memory
and ensureMicrosoft.Bcl.Memory
library is included inmicrosoft.netcore.app.ref
pack too under theanalyzers\dotnet\cs
folder. Unfortunately, the current infrastructure does not allow to bin pace such dependency.Here are the things need to be done:
runtime/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComInterfaceGenerator.csproj
Line 29 in 7b1c0f3
Microsoft.Bcl.Memory
.runtime/src/libraries/Directory.Build.targets
Lines 205 to 209 in 7b9f1c3
Microsoft.Bcl.Memory
is bin placed inside themicrosoft.netcore.app.ref
package underanalyzers\dotnet\cs
folder and next to the ComInterfaceGenerator lib.#if
there and only keeppublic
specifier.Microsoft.Bcl.Memory.csproj
from librarysrc
folder to remove the line<DefineConstants>MICROSOFT_BCL_MEMORY;$(DefineConstants)</DefineConstants>
Microsoft.Bcl.Memory
pass and the packagemicrosoft.netcore.app.ref
includeMicrosoft.Bcl.Memory
library.Reproduction Steps
Com interface source gen is including the Index.cs in the project.
Expected behavior
No component in .NET is embedding the Index/Range sources.
Actual behavior
Com interface source gen carries a copy of the Index type code.
Regression?
No
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: