mono / mono-addins

Mono.Addins is a generic framework for creating extensible applications, and for creating add-ins which extend those applications.
MIT License
163 stars 94 forks source link

Fix bxc #58815 build breakage #88

Closed radical closed 7 years ago

radical commented 7 years ago

The VSMac 2017-08 branch build breaks with mono 5.6.0.x:

Using "ReportAssetsLogMessages" task from assembly "/usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk/build/../tools/net46/Microsoft.NET.Build.Tasks.dll". Task "ReportAssetsLogMessages" /usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk/build/Microsoft.PackageDependencyResolution.targets(323,5): error MSB4018: The "ReportAssetsLogMessages" task failed unexpectedly. [/Users/ludovic/Xamarin/monodevelop/main/external/RefactoringEssentials/RefactoringEssentials.2017/RefactoringEssentials.csproj] /usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk/build/Microsoft.PackageDependencyResolution.targets(323,5): error MSB4018: System.TypeLoadException: Could not resolve type with token 0100005b (from typeref, class/assembly NuGet.ProjectModel.IAssetsLogMessage, NuGet.ProjectModel, Version=4.3.0.5, Culture=neutral, PublicKeyToken=31bf3856ad364e35) [/Users/ludovic/Xamarin/monodevelop/main/external/RefactoringEssentials/RefactoringEssentials.2017/RefactoringEssentials.csproj] /usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk/build/Microsoft.PackageDependencyResolution.targets(323,5): error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute () [0x00000] in <01420900fd004c128de2d2ee31bad624>:0 [/Users/ludovic/Xamarin/monodevelop/main/external/RefactoringEssentials/RefactoringEssentials.2017/RefactoringEssentials.csproj] /usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk/build/Microsoft.PackageDependencyResolution.targets(323,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in <765502eb2f884ce79731edeb4b0517fb>:0 [/Users/ludovic/Xamarin/monodevelop/main/external/RefactoringEssentials/RefactoringEssentials.2017/RefactoringEssentials.csproj] /usr/local/share/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk/build/Microsoft.PackageDependencyResolution.targets(323,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder+d__26.MoveNext () [0x0022d] in <765502eb2f884ce79731edeb4b0517fb>:0 [/Users/ludovic/Xamarin/monodevelop/main/external/RefactoringEssentials/RefactoringEssentials.2017/RefactoringEssentials.csproj]

The missing token token 0100005b (from typeref, class/assembly NuGet.ProjectModel.IAssetsLogMessage, NuGet.ProjectModel, Version=4.3.0.5) is referenced from the Microsoft.NET.Build.Tasks.dll. The NuGet.ProjectModel.dll next to the tasks assembly has the type available. But looking at assembly loader logs, it turns out that the assembly is actually being loaded via a raw byte[] instead of from the file.

More digging reveals that this is being done by Costura.AssemblyLoader[1] which was loading the assembly from embedded resources in NuGet.Build.Packaging.Tasks.dll assembly:

1e70e0: costura.nuget.projectmodel.dll.zip (size 55791)

And this seems to be out of sync with the nuget assemblies bundled with the Microsoft.NET.Build.Tasks.dll.

NuGet.Build.Packaging.Tasks's ReadLegacyDependencies targets gets triggered because Mono.Addins.csproj has PackOnBuild=true for Release builds. Hence, the issue is never seen in debug builds.

The Costura change was reverted in the nuget package upstream[2] but that was committed after v0.1.276, which is the version being used currently.

So, we bump to latest version of the package - v0.2.0.

--

  1. https://github.com/Fody/Costura
  2. https://github.com/NuGet/NuGet.Build.Packaging/commit/7838a0a95fb8ce5c9db7b7d4d2bfe62f38b4eddb
radical commented 7 years ago

Is this enough to bump the version? I'll open a corresponding PR to bump the version in monodevelop too, once this is merged.