-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
'The "Microsoft.DotNet.Compatibility.ValidatePackage" task failed unexpectedly' in libs legs #59908
Comments
Tagging subscribers to this area: @vitek-karas, @agocke Issue Details /__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: The "Microsoft.DotNet.Compatibility.ValidatePackage" task failed unexpectedly. [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: System.TypeLoadException: Method 'CompareSourceLocations' in type 'Microsoft.CodeAnalysis.CSharp.CSharpCompilation' from assembly 'Microsoft.CodeAnalysis.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation. [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: at Microsoft.DotNet.ApiCompatibility.AssemblySymbolLoader..ctor(Boolean resolveAssemblyReferences) [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: at Microsoft.DotNet.PackageValidation.ApiCompatRunner.GetAssemblySymbolFromStream(Stream assemblyStream, MetadataInformation assemblyInformation, Boolean& resolvedReferences) in /_/src/Compatibility/Microsoft.DotNet.PackageValidation/ApiCompatRunner.cs:line 111 [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: at Microsoft.DotNet.PackageValidation.ApiCompatRunner.RunApiCompat() in /_/src/Compatibility/Microsoft.DotNet.PackageValidation/ApiCompatRunner.cs:line 49 [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: at Microsoft.DotNet.PackageValidation.CompatibleFrameworkInPackageValidator.Validate(Package package) in /_/src/Compatibility/Microsoft.DotNet.PackageValidation/CompatibleFrameworkInPackageValidator.cs:line 62 [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: at Microsoft.DotNet.Compatibility.ValidatePackage.ExecuteCore() in /_/src/Compatibility/Microsoft.DotNet.Compatibility/ValidatePackage.cs:line 92 [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute() in /_/src/Tasks/Common/TaskBase.cs:line 38 [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: at Microsoft.DotNet.Compatibility.ValidatePackage.Execute() in /_/src/Compatibility/Microsoft.DotNet.Compatibility/ValidatePackage.cs:line 49 [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
System.Security.Cryptography.X509Certificates -> /__w/1/s/artifacts/source-build/self/src/artifacts/bin/System.Security.Cryptography.X509Certificates/net7.0-Unix-Release/System.Security.Cryptography.X509Certificates.dll
|
Tagging subscribers to this area: @Anipik, @safern, @ViktorHofer Issue DetailsLogs from /__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: The "Microsoft.DotNet.Compatibility.ValidatePackage" task failed unexpectedly. [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: System.TypeLoadException: Method 'CompareSourceLocations' in type 'Microsoft.CodeAnalysis.CSharp.CSharpCompilation' from assembly 'Microsoft.CodeAnalysis.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation. [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: at Microsoft.DotNet.ApiCompatibility.AssemblySymbolLoader..ctor(Boolean resolveAssemblyReferences) [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: at Microsoft.DotNet.PackageValidation.ApiCompatRunner.GetAssemblySymbolFromStream(Stream assemblyStream, MetadataInformation assemblyInformation, Boolean& resolvedReferences) in /_/src/Compatibility/Microsoft.DotNet.PackageValidation/ApiCompatRunner.cs:line 111 [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: at Microsoft.DotNet.PackageValidation.ApiCompatRunner.RunApiCompat() in /_/src/Compatibility/Microsoft.DotNet.PackageValidation/ApiCompatRunner.cs:line 49 [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: at Microsoft.DotNet.PackageValidation.CompatibleFrameworkInPackageValidator.Validate(Package package) in /_/src/Compatibility/Microsoft.DotNet.PackageValidation/CompatibleFrameworkInPackageValidator.cs:line 62 [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: at Microsoft.DotNet.Compatibility.ValidatePackage.ExecuteCore() in /_/src/Compatibility/Microsoft.DotNet.Compatibility/ValidatePackage.cs:line 92 [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute() in /_/src/Tasks/Common/TaskBase.cs:line 38 [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: at Microsoft.DotNet.Compatibility.ValidatePackage.Execute() in /_/src/Compatibility/Microsoft.DotNet.Compatibility/ValidatePackage.cs:line 49 [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
/__w/1/s/artifacts/source-build/self/package-cache/microsoft.dotnet.compatibility/1.0.0-rc.1.21459.41/build/Microsoft.NET.Compatibility.Common.targets(32,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/__w/1/s/artifacts/source-build/self/src/src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj]
System.Security.Cryptography.X509Certificates -> /__w/1/s/artifacts/source-build/self/src/artifacts/bin/System.Security.Cryptography.X509Certificates/net7.0-Unix-Release/System.Security.Cryptography.X509Certificates.dll
|
Abstract member added here? dotnet/roslyn@7f5a439 Is it possible we're loading old derived class and newer base class? cc @sharwell |
Could have something to do with https://github.com/dotnet/sdk/blob/8e652a081d0dd2c68ca377e5b7514a6b73e05ebd/src/Compatibility/Microsoft.DotNet.Compatibility/ValidatePackage.cs#L106-L120 and someone already loading a different copy of one of those assemblies in the process. My guess is we have some other task which uses We should find out the reason for the mismatch then decide what needs to change to avoid it. |
Thanks @ericstj, that's helpful info. I'm looking into this now. |
Question as I was not following the flow here closely. How did the official and presumably the rolling builds regress? Did a commit went into main that upgraded the Compatibility package? If so, should we revert that asap to unblock official builds? We are currently at 0% pass rate. |
@ViktorHofer that is what I'm trying to figure out 😄 . I was able to repro but haven't found the culprit, still investigating. |
There was a breaking change in between these 2 versions where an abstract and an interface member were added and unfortunately there is a race condition (I haven't found where), that sometimes This started happening since we updated arcade on Friday and we consumed the newer version of the compiler package containing these new members. I submitted #60026 to pin the version and mitigate the issue while I find a long term fix. |
The mitigation is merged, I will remove blocking-clean-* labels but will keep the issue open until I find a long term solution. |
We're hitting another variant of this as part of the SDK upgrade to RC2. I'll try to work around it by matching the compiler toolset package to the version in the SDK. We definitely need to figure this out, it keeps us from bumping up the compiler version (something we could do without an infra rollout) without bumping the SDK version (something that requires a rollout and only releases monthly at most anyway). |
@jkoritzinsky I've figured out the issue. I'm working on a fix that should be out soon into the SDK repository. The problem is that a condition on the package targets is causing different codeanalysis dlls to be loaded from different locations for different projects and also we are running package validation on |
Fix is out, once we get a new version of the package out, I'll update it and unpin the compiler version: dotnet/sdk#22277 |
The package with the fix is already available. Do you plan to open a PR? Asking as we could then remove the pinning of the compiler here: #60256. |
Yes I will put up a PR to update the package and remove the pinning of the compiler. |
Logs from
Build Linux x64 release SourceBuild
: https://dev.azure.com/dnceng/public/_build/results?buildId=1400355&view=logs&jobId=000ba8e3-34f8-51d2-8d06-9b61f10256d0&j=000ba8e3-34f8-51d2-8d06-9b61f10256d0&t=ca9b6e26-8c16-57f9-673e-2bc0dc655f25Runfo Tracking Issue: Microsoft.DotNet.Compatibility.ValidatePackage failing
Build Result Summary
The text was updated successfully, but these errors were encountered: