-
Notifications
You must be signed in to change notification settings - Fork 383
Description
Context
Base issue: #11225
Reference package path: microsoft.bcl.asyncinterfaces
Roslyn-based GenAPI location: https://github.com/dotnet/sdk/tree/main/src/GenAPI/
Usage:
/repos/source-build-reference-packages]# ./generate.sh --pkg microsoft.extensions.logging,2.1.1 --genapi-backend roslyn --dest /repos/source-build-reference-packages/src/referencePackages/roslyn/
Steps:
- Generate SBRP package using SBRP generator with the roslyn-based backend
- Compare cci-based <-> roslyn-based reference assemblies
- Build the SBRP generated with the roslyn-based backend
- Collect issues, their occurrence, create bugs for each.
- Run the
sdk/ApiCompattool to compare generated API with original
How to compile project in SBRP
Use a docker or a VM and from root folder of source-build-reference-packages run:
/repos/source-build-reference-packages]# ./build.sh --projects ./build.sh --projects /repos/source-build-reference-packages/src/referencePackages/roslyn/system.memory/4.5.1/System.Memory.4.5.1.csproj
How to use the ApiCompat tool
sdk\artifacts\bin\Microsoft.DotNet.ApiCompat.Tool\Debug\net6.0> .\Microsoft.DotNet.ApiCompat.Tool.exe --strict-mode true --enable-rule-attributes-must-match true --enable-rule-cannot-change-parameter-name true --lref ... --rref ... -l ... -r ...
Found Issues:
Occurrence: 3
Occurrence: 1
Occurrence: 2
/!? Does not affect compilation
- public partial interface IAsyncEnumerable<T>
+ public partial interface IAsyncEnumerable<out T>
{
}Occurrence: 2
Occurrence: 1
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
public sealed partial class AsyncIteratorStateMachineAttribute : System.Runtime.CompilerServices.StateMachineAttribute
{
// error CS7036: There is no argument given that corresponds to the required formal parameter 'stateMachineType' of 'StateMachineAttribute.StateMachineAttribute(Type)'
// Must be something like: public AsyncIteratorStateMachineAttribute(System.Type stateMachineType) : base(stateMachineType) {}
public AsyncIteratorStateMachineAttribute(System.Type stateMachineType) { throw null; }
}Occurrence: 3
/!? Does not affect compilation