Check in shim typeforwards and remove the dependency on the underlying targeting...
authorViktor Hofer <viktor.hofer@microsoft.com>
Tue, 28 Mar 2023 15:32:33 +0000 (17:32 +0200)
committerGitHub <noreply@github.com>
Tue, 28 Mar 2023 15:32:33 +0000 (17:32 +0200)
commitc0cca338479fc5274a2d1325ca64e488b741f895
treea6c3857acc34abcc5d6f793210bcffc250adf1a1
parent39c02d99367d80e02757c2207d8652b937ebe5fb
Check in shim typeforwards and remove the dependency on the underlying targeting packs (#79147)

* Make .NET Framework and .NET Standard facade changes trackable

Fixes https://github.com/dotnet/runtime/issues/65997

GenFacade is a tool that inspects a contract assembly's public API surface safe area, compares it with a passed in assembly closure and emits a C# source file with type forwards in it so that the satisfied API can be forwarded from the contract to the "implementation". GenFacades is used to construct the .NETFramework and the .NETStandard shim assemblies which live under src/libraries/shims/.

The generated source file isn't checked into the tree, it's placed into the project's intermediate output path. IMO it would help if we check these files into the tree so that any changes that impact shims - intentional or unintentional - are trackable. As an example, I just recently refactored how the shims are structured under src/libraries/shims and unintentionally removed a type forward from an assembly. I only noticed this regression by pure luck later.

The priority of this issue just rose because source build plans to remove their .NET Framework reference assembly packages during the .NET 8 release. That means that we can't automatically generate the type forwards during source-build. I will work on removing the dependency and check the type forwards in instead.

* Make shim projects declare the dependencies explicitly

Also remove the System.Xml special runtime project which isn't necessary
anymore as the compiler now allows type forwards to Obsolete types with
error=true.

* System.Core build fix

* Remove unused file

* Revert "Remove unused file"

This reverts commit 2f5d410a1ff2ed4705a7256c19cd65aa11107267.

* Add README and fix GenFacades zero version logic
90 files changed:
src/libraries/System.Private.Xml/src/System/Xml/IApplicationResourceStreamResolver.cs
src/libraries/System.Xml.ReaderWriter/src/CompatibilitySuppressions.xml [deleted file]
src/libraries/shims.proj
src/libraries/shims/Directory.Build.props
src/libraries/shims/Directory.Build.targets
src/libraries/shims/Microsoft.VisualBasic/src/Microsoft.VisualBasic.cs [new file with mode: 0644]
src/libraries/shims/Microsoft.VisualBasic/src/Microsoft.VisualBasic.csproj [new file with mode: 0644]
src/libraries/shims/README.md [new file with mode: 0644]
src/libraries/shims/System.ComponentModel.DataAnnotations/src/System.ComponentModel.DataAnnotations.cs [new file with mode: 0644]
src/libraries/shims/System.ComponentModel.DataAnnotations/src/System.ComponentModel.DataAnnotations.csproj [new file with mode: 0644]
src/libraries/shims/System.Configuration/src/System.Configuration.cs [new file with mode: 0644]
src/libraries/shims/System.Configuration/src/System.Configuration.csproj [new file with mode: 0644]
src/libraries/shims/System.Core/src/System.Core.cs [new file with mode: 0644]
src/libraries/shims/System.Core/src/System.Core.csproj [new file with mode: 0644]
src/libraries/shims/System.Data/Directory.Build.props [new file with mode: 0644]
src/libraries/shims/System.Data/ref/System.Data.cs [new file with mode: 0644]
src/libraries/shims/System.Data/ref/System.Data.csproj [new file with mode: 0644]
src/libraries/shims/System.Data/src/System.Data.cs [moved from src/libraries/shims/src/System.Data.forwards.cs with 84% similarity]
src/libraries/shims/System.Data/src/System.Data.csproj [new file with mode: 0644]
src/libraries/shims/System.Drawing/src/System.Drawing.cs [new file with mode: 0644]
src/libraries/shims/System.Drawing/src/System.Drawing.csproj [new file with mode: 0644]
src/libraries/shims/System.IO.Compression.FileSystem/src/System.IO.Compression.FileSystem.cs [new file with mode: 0644]
src/libraries/shims/System.IO.Compression.FileSystem/src/System.IO.Compression.FileSystem.csproj [new file with mode: 0644]
src/libraries/shims/System.Net/src/System.Net.cs [new file with mode: 0644]
src/libraries/shims/System.Net/src/System.Net.csproj [new file with mode: 0644]
src/libraries/shims/System.Numerics/src/System.Numerics.cs [new file with mode: 0644]
src/libraries/shims/System.Numerics/src/System.Numerics.csproj [new file with mode: 0644]
src/libraries/shims/System.Runtime.Serialization/src/System.Runtime.Serialization.cs [new file with mode: 0644]
src/libraries/shims/System.Runtime.Serialization/src/System.Runtime.Serialization.csproj [new file with mode: 0644]
src/libraries/shims/System.Security/src/System.Security.cs [new file with mode: 0644]
src/libraries/shims/System.Security/src/System.Security.csproj [new file with mode: 0644]
src/libraries/shims/System.ServiceModel.Web/src/System.ServiceModel.Web.cs [new file with mode: 0644]
src/libraries/shims/System.ServiceModel.Web/src/System.ServiceModel.Web.csproj [new file with mode: 0644]
src/libraries/shims/System.ServiceProcess/src/System.ServiceProcess.cs [new file with mode: 0644]
src/libraries/shims/System.ServiceProcess/src/System.ServiceProcess.csproj [new file with mode: 0644]
src/libraries/shims/System.Transactions/src/System.Transactions.cs [new file with mode: 0644]
src/libraries/shims/System.Transactions/src/System.Transactions.csproj [new file with mode: 0644]
src/libraries/shims/System.Web/src/System.Web.cs [new file with mode: 0644]
src/libraries/shims/System.Web/src/System.Web.csproj [new file with mode: 0644]
src/libraries/shims/System.Windows/src/System.Windows.cs [new file with mode: 0644]
src/libraries/shims/System.Windows/src/System.Windows.csproj [new file with mode: 0644]
src/libraries/shims/System.Xml.Linq/src/System.Xml.Linq.cs [new file with mode: 0644]
src/libraries/shims/System.Xml.Linq/src/System.Xml.Linq.csproj [new file with mode: 0644]
src/libraries/shims/System.Xml.Serialization/src/System.Xml.Serialization.cs [new file with mode: 0644]
src/libraries/shims/System.Xml.Serialization/src/System.Xml.Serialization.csproj [new file with mode: 0644]
src/libraries/shims/System.Xml/src/System.Xml.cs [new file with mode: 0644]
src/libraries/shims/System.Xml/src/System.Xml.csproj [new file with mode: 0644]
src/libraries/shims/System/Directory.Build.props [moved from src/libraries/shims/ref/System.csproj with 64% similarity]
src/libraries/shims/System/ref/System.cs [new file with mode: 0644]
src/libraries/shims/System/ref/System.csproj [new file with mode: 0644]
src/libraries/shims/System/src/System.cs [moved from src/libraries/shims/src/System.forwards.cs with 72% similarity]
src/libraries/shims/System/src/System.csproj [new file with mode: 0644]
src/libraries/shims/WindowsBase/src/WindowsBase.cs [new file with mode: 0644]
src/libraries/shims/WindowsBase/src/WindowsBase.csproj [new file with mode: 0644]
src/libraries/shims/mscorlib.forwards.cs [deleted file]
src/libraries/shims/mscorlib/Directory.Build.props [new file with mode: 0644]
src/libraries/shims/mscorlib/ref/mscorlib.cs [new file with mode: 0644]
src/libraries/shims/mscorlib/ref/mscorlib.csproj [new file with mode: 0644]
src/libraries/shims/mscorlib/src/mscorlib.cs [moved from src/libraries/shims/src/mscorlib.forwards.cs with 99% similarity]
src/libraries/shims/mscorlib/src/mscorlib.csproj [new file with mode: 0644]
src/libraries/shims/netstandard/src/netstandard.cs [new file with mode: 0644]
src/libraries/shims/netstandard/src/netstandard.csproj [new file with mode: 0644]
src/libraries/shims/ref/Directory.Build.props [deleted file]
src/libraries/shims/ref/System.Data.csproj [deleted file]
src/libraries/shims/ref/System.Xml.csproj [deleted file]
src/libraries/shims/ref/mscorlib.csproj [deleted file]
src/libraries/shims/src/Directory.Build.props [deleted file]
src/libraries/shims/src/Microsoft.VisualBasic.csproj [deleted file]
src/libraries/shims/src/System.ComponentModel.DataAnnotations.csproj [deleted file]
src/libraries/shims/src/System.Configuration.csproj [deleted file]
src/libraries/shims/src/System.Core.csproj [deleted file]
src/libraries/shims/src/System.Data.csproj [deleted file]
src/libraries/shims/src/System.Drawing.csproj [deleted file]
src/libraries/shims/src/System.IO.Compression.FileSystem.csproj [deleted file]
src/libraries/shims/src/System.Net.csproj [deleted file]
src/libraries/shims/src/System.Numerics.csproj [deleted file]
src/libraries/shims/src/System.Runtime.Serialization.csproj [deleted file]
src/libraries/shims/src/System.Security.csproj [deleted file]
src/libraries/shims/src/System.ServiceModel.Web.csproj [deleted file]
src/libraries/shims/src/System.ServiceProcess.csproj [deleted file]
src/libraries/shims/src/System.Transactions.csproj [deleted file]
src/libraries/shims/src/System.Web.csproj [deleted file]
src/libraries/shims/src/System.Windows.csproj [deleted file]
src/libraries/shims/src/System.Xml.Linq.csproj [deleted file]
src/libraries/shims/src/System.Xml.Serialization.csproj [deleted file]
src/libraries/shims/src/System.Xml.csproj [deleted file]
src/libraries/shims/src/System.csproj [deleted file]
src/libraries/shims/src/WindowsBase.csproj [deleted file]
src/libraries/shims/src/mscorlib.csproj [deleted file]
src/libraries/shims/src/netstandard.csproj [deleted file]