Travis-CI failure with .NET Core
See original GitHub issueHi,
You may remember me as the person who asked for .NET Core support. I finally got around to unit-testing my game and decided to add Travis-CI integration.
TL;DR it failed with something related to MonoGame. Can you please tell me if/what I’m doing wrong? It looks like it’s failing to build the project.
The core error appears to be:
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018: The "GetMGCBTask" task failed unexpectedly.
The full stack:
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018: The "GetMGCBTask" task failed unexpectedly. [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018: System.IO.InvalidDataException: Central Directory corrupt. ---> System.IO.IOException: Invalid argument [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018: at System.IO.FileStream.CheckFileCall(Int64 result, Boolean ignoreNotSupported) [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018: at System.IO.FileStream.Seek(Int64 offset, SeekOrigin origin) [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018: at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory() [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018: --- End of inner exception stack trace --- [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018: at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory() [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018: at System.IO.Compression.ZipArchive.Init(Stream stream, ZipArchiveMode mode, Boolean leaveOpen) [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018: at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode, Boolean leaveOpen, Encoding entryNameEncoding) [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018: at System.IO.Compression.ZipFile.Open(String archiveFileName, ZipArchiveMode mode, Encoding entryNameEncoding) [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018: at System.IO.Compression.ZipFile.ExtractToDirectory(String sourceArchiveFileName, String destinationDirectoryName, Encoding entryNameEncoding, Boolean overwrite) [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018: at MSBuildTasks.GetMGCBTask.Execute() in /home/harry/GitHub/MonoGame.Content.Builder/Tasks/GetMGCBTask.cs:line 38 [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(27,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/travis/build/nightblade9/escape-to-earth/SadConsoleDotNetCore20/SadConsole.csproj]
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MonoGame.Content.Builder.targets(92,5): error MSB3073: The command "mono "/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MGCB/build/MGCB.exe" /@:"/home/travis/build/nightblade9/escape-to-earth/EscapeToEarth/Content/Content.mgcb" /platform:DesktopGL /quiet /outputDir:"bin/DesktopGL/Content" /intermediateDir:"obj/DesktopGL/Content"" exited with code 127. [/home/travis/build/nightblade9/escape-to-earth/EscapeToEarth/EscapeToEarth.csproj]
Travis log here.
Travis configuration:
language: csharp
solution: escape-to-earth.sln
mono: none
dotnet: 2.2.200
script:
cd EscapeToEarth.UnitTests
dotnet test
Project repository lives here. I can build this locally and run tests on Windows 8/10.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Build failed for ASP.NET Core 3.1 in Travis CI
1 Answer 1 · The main problem I think is that the nuget dotnet restore command is not found in linux virtual machine...
Read more >CI failing with .NET core project · Issue #6831 · travis-ci ...
I setup up CI and it's saying the OS doesn't support .NET core. You can view the build results here => https://travis-ci.org/quattro004/ ...
Read more >NET Core 3.1 builds are failing - Enterprise
Hello, the Travis builds for our .NET Core 3.1 projects are failing. I can't provide a link to one of the failed builds...
Read more >Common Build Problems
One possible cause for builds failing unexpectedly can be calling set -e (also known as set errexit ), either directly in your .travis.yml...
Read more >Configuring CI for .Net Core using Travis CI and Xunit
One of the key myths and challenges around using .net core at the moment is the lack of support or information around getting...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I don’t know. Travis workspaces are still a mystery to me (I don’t know how to view/save files on disk).
Instead, I did some googling on how to get MonoGame projects to build on Travis. I found this wonderful answer; the summary is that I added these changes to my
.travis.yml
file:(This is a slightly modified version because one of the packages, erm, I think it doesn’t exist in the version of Linux that the Travis docker container is using.)
This resulted in a successful build, so I’m good to go now. Thanks for your help.
Nope, SadConsole just loads direct PNG files and doesn’t use the pipeline. I just looked up linux exit code 127 and it says that it really means file not found. https://stackoverflow.com/questions/1763156/127-return-code-from
Does
/home/travis/.nuget/packages/monogame.content.builder/3.7.0.4/build/MGCB/build/MGCB.exe
exist?