dotnet / arcade

Tools that provide common build infrastructure for multiple .NET Foundation projects.
MIT License
666 stars 341 forks source link

ApiCompat incorrectly erroring out with ParameterModifiersCannotChange #7511

Open utpilla opened 3 years ago

utpilla commented 3 years ago

ApiCompat tool is erroring out with the error ParameterModifiersCannotChange

Error ParameterModifiersCannotChange : Custom modifiers on parameter 'batch' on method 'OpenTelemetry.BaseExporter<T>.Export(OpenTelemetry.Batch<T>)' are 'System.Runtime.InteropServices.InAttribute' in the implementation but 'System.Runtime.InteropServices.InAttribute' in the contract.

I tried to debug this issue and I believe the issue is with the Union method in the code which is treating them as unique CustomModifiers.

I have attached the dlls here:

These were the parameters used for ApiCompat.exe: --impl-dirs "C:\opentelemetry-dotnet\src\OpenTelemetry\obj\Debug\net452\,C:\opentelemetry-dotnet\src\OpenTelemetry.Api\bin\Debug\net452\,C:\Users\utpilla.REDMOND\.nuget\packages\microsoft.netframework.referenceassemblies.net452\1.0.0\build\.NETFramework\v4.5.2\,C:\Users\utpilla.REDMOND\.nuget\packages\system.buffers\4.5.1\ref\net45\,C:\Users\utpilla.REDMOND\.nuget\packages\system.collections.immutable\1.4.0\lib\portable-net45+win8+wp8+wpa81\,C:\Users\utpilla.REDMOND\.nuget\packages\system.diagnostics.diagnosticsource\5.0.1\lib\net45\,C:\Users\utpilla.REDMOND\.nuget\packages\system.memory\4.5.4\lib\netstandard1.1\,C:\Users\utpilla.REDMOND\.nuget\packages\system.runtime.compilerservices.unsafe\5.0.0\ref\netstandard1.0\,C:\Users\utpilla.REDMOND\.nuget\packages\microsoft.netframework.referenceassemblies.net452\1.0.0\build\.NETFramework\v4.5.2\Facades\,"

Please update the path accordingly in the command line argument.

utpilla commented 3 years ago

dlls.zip

ericstj commented 3 years ago

I believe this is a duplicate of https://github.com/dotnet/arcade/issues/2136

ericstj commented 3 years ago

Reactivating as this is specific to the scenario of no dependencies provided.