dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.7k stars 1.06k forks source link

PackageDependencyResolution.targets error only occurring on Ubuntu 18.04.2 LTS #3055

Open aeos opened 5 years ago

aeos commented 5 years ago

We have a series of build scripts run through gulp which work flawlessly on windows, and inside a linux docker container. However, when run on a Ubuntu 18.04.2 LTS laptop, we get the following errors for various packages. If I build pack and push the project by itself the issue goes away. But if I build all of the projects through gulp the package won't build and failes with the following error:

/usr/share/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: The "ResolvePackageAssets" task failed unexpectedly. [/home/carlos/workspace/stream-forms-backend/Common/Services/Services.csproj] /usr/share/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: System.IO.EndOfStreamException: Unable to read beyond the end of the stream. [/home/carlos/workspace/stream-forms-backend/Common/Services/Services.csproj] /usr/share/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: at System.IO.BinaryReader.FillBuffer(Int32 numBytes) [/home/carlos/workspace/stream-forms-backend/Common/Services/Services.csproj] /usr/share/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: at System.IO.BinaryReader.ReadInt32() [/home/carlos/workspace/stream-forms-backend/Common/Services/Services.csproj] /usr/share/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.ReadItem() [/home/carlos/workspace/stream-forms-backend/Common/Services/Services.csproj] /usr/share/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.ReadItemGroup() [/home/carlos/workspace/stream-forms-backend/Common/Services/Services.csproj] /usr/share/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups() [/home/carlos/workspace/stream-forms-backend/Common/Services/Services.csproj] /usr/share/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore() [/home/carlos/workspace/stream-forms-backend/Common/Services/Services.csproj] /usr/share/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute() [/home/carlos/workspace/stream-forms-backend/Common/Services/Services.csproj] /usr/share/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/carlos/workspace/stream-forms-backend/Common/Services/Services.csproj] /usr/share/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/carlos/workspace/stream-forms-backend/Common/Services/Services.csproj]

livarcocc commented 5 years ago

Can you provide us with a set of repro steps that we could try ourselves? Could you share a repro repo on github that we can use to build and reproduce this issue?

aeos commented 5 years ago

I will try as soon as I can!

arakis commented 5 years ago

It happens (to me, too, but only in the following situation:

I know the situation is "special", but a proper way to reproduce this error message.

Repo: https://github.com/mosa/MOSA-Project

arakis commented 5 years ago

Just a small hint: If using the way above, when some binaries are compiled on windows and some on debian, there can occur Path Errors. It seems, the binaries (cli-dll) differs in generation depending on which platform they are build. By the way, on Debian i use the optimization flag when running the app (mono -O=all app.exe). But this is regarding runtime. The bug we're talking about happens during build time.